Architecture of prefecthq/prefect
prefecthq/prefect is 4,701 source files holding 36,096 symbols across 14 modules, written mainly in Python, TypeScript, Shell. The largest module is ui-v2, with 1,556 files, and 306 files are entry points into the dependency graph.
How prefect fits together
Workflow code enters as ordinary Python functions marked with the flow and task decorators. The package source under src provides the orchestration logic, and src/prefect/__init__.py is the central file that the package is built around. Run activity such as flow runs, task runs, logs and events is persisted by the server, which exposes REST endpoints for it. The logging code is in src/prefect/logging/loggers.py and src/prefect/logging/__init__.py. The ui-v2 and ui directories hold the two web interfaces used to monitor and manage executions. The tests directory contains the test suite, including tests/test_flow_engine.py for the flow engine.
Largest modules
- ui-v2: 1,556 files and 154,411 lines of code
- src: 1,367 files and 300,815 lines of code
- docs: 997 files and 109,110 lines of code
- tests: 552 files and 227,862 lines of code
- .github: 53 files and 4,667 lines of code
- ui: 52 files and 1,192 lines of code
- scripts: 36 files and 2,714 lines of code
- integration-tests: 26 files and 2,150 lines of code
Languages
By file count: Python 1,863 files, TypeScript 1,574 files, Shell 13 files, Dockerfile 10 files, JavaScript 6 files.
Documentation
Repowise documents prefect in 2,450 pages generated from the source, 98 of them written explanations of the repository and its modules.
More on prefect: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos