The Makefile is the project's main entry point. Every target uses uv run so dependencies are always resolved from pyproject.toml and the managed virtual environment — the system Python interpreter is never invoked directly.
Run
make helpon your machine to see the live, formatted output.
- Indentation uses real TAB characters (Make requires this; spaces will fail).
- All non-file targets are declared with
.PHONYto avoid name collisions with real files. - Environment variables are auto-loaded from
.envat the top of the Makefile (include .env+export). - Pre-flight checks (
check-deps,doctor) gate every run target — they fail fast if the environment is broken. - No interpreter is ever invoked directly. Every
uv runtarget goes through the managed venv. - Help is generated by
make helpusing plain@echo(nogrep/awk), so it works on Windowscmd.exeand Linux bash alike.
make doctor # 1. verify environment + imports
make run # 2. run the full pipeline (recommended)That's it. make run runs all three stages — ETL, PL/pgSQL, and Great Expectations — in a single Python process and prints a Rich-formatted summary.
| Target | Description | Notes |
|---|---|---|
make run |
Run the full pipeline in-process | Calls uv run python main.py. Recommended default. |
make run-verbose |
Same as run, with full Python tracebacks |
Sets PYTHONVERBOSE=1 |
make run-full |
Full refresh — truncate and reload every collection | Adds --full-refresh |
make install |
uv sync and verify dependencies |
Runs check-deps first |
make doctor |
Pre-flight check: lockfile + Python imports of all 3 modules | Use before any run target in CI |
make check-deps |
Quick uv and lockfile sanity check |
Lighter-weight than doctor |
make verify |
Alias for check-deps |
Same behaviour |
When you only want one stage, use these:
| Target | What it does | Underlying script |
|---|---|---|
make run-etl |
MongoDB → Postgres incremental load | scripts/python/mongo_to_postgres.py |
make run-dq |
PL/pgSQL data-quality suite | scripts/python/plpgsql_loops_tests.py |
make run-gx |
Great Expectations suite | scripts/python/run_gx.py |
make run-etl-only |
ETL + skip all validation | main.py --skip-plpgsql --skip-gx |
make run-etl-dq |
ETL + PL/pgSQL, skip GX | main.py --skip-gx |
Useful when developing or when only one collection has new data:
| Target | Example | What it does |
|---|---|---|
make run-collection |
make run-collection ARGS="--collection orders" |
Incremental ETL for specific collection(s) |
make run-collection-full |
make run-collection-full ARGS="--collection orders" |
Full refresh for specific collection(s) |
make run-gx-table |
make run-gx-table GX_TABLES="orders products" |
Run Great Expectations against specific table(s) |
| Target | Description |
|---|---|
make build |
Build the Docker app image |
make up |
Start Postgres, MongoDB, Pushgateway, Prometheus, Grafana |
make down |
Stop the Docker stack |
make pipeline |
Full pipeline inside Docker (one container) |
make local-pipeline |
Full pipeline via PowerShell — runs each stage in its own uv process, writes per-stage logs to logs/pipeline/, supports -SkipExtract, -SkipPlpgsql, -SkipGx, -ContinueOnError |
make etl |
ETL inside Docker |
make local-etl |
ETL locally (alias for make run-etl) |
make dq-loops |
PL/pgSQL DQ inside Docker |
make local-dq-loops |
PL/pgSQL DQ locally (alias for make run-dq) |
make dq-gx |
Great Expectations inside Docker |
make local-dq-gx |
Great Expectations locally (alias for make run-gx) |
make shell |
Open a shell inside the app container |
make clean |
Remove containers and volumes |
make prune |
Deep prune Docker (system + volumes) |
| Target | Description |
|---|---|
make lint |
Run Ruff, Mypy, and SQLFluff |
make test |
Run pytest |
make format |
Format code with Ruff |
| Target | Description |
|---|---|
make run-clean |
Remove pipeline logs older than 7 days |
make backup-postgres |
Backup Postgres database |
make restore-postgres |
Restore Postgres from a backup |
make backup-mongo |
Backup MongoDB |
make restore-mongo |
Restore MongoDB |
make health-check |
Liveness probe for Postgres and MongoDB |
make seed |
Seed MongoDB with sample data (Docker) |
make local-seed |
Seed MongoDB locally |
make monitor-logs |
Manage Docker pipeline logs |
make log-cleanup |
Local log cleanup |
make inspect-schema |
Inspect Postgres schema (Docker) |
make local-inspect-schema |
Inspect Postgres schema (locally) |
make init-db |
Initialize the database after make up |
git clone <repo>
cd bike-store-relational-database
uv sync
cp .env.example .env # edit with your Postgres + MongoDB credentials
make doctor # verify environment
make run # full pipelinemake check-deps # 5-second sanity check
make run-etl # load new data
make run-dq # run PL/pgSQL tests
make run-gx # run Great Expectationsmake run-collection ARGS="--collection orders"
make run-gx-table GX_TABLES="orders"make run-fullmake run-verbose # full Python tracebacks
make doctor # check imports + lockfile
make run-etl-only # skip validation suites for faster iterationmake up # start the stack
make pipeline # full pipeline in container
make monitor-logs # tail logs
make down # stop everythingmake doctor # lockfile + import check
make lint # Ruff, Mypy, SQLFluff
make test # pytest
make run # end-to-end pipelineInstall uv:
# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | shThe lockfile is out of sync with pyproject.toml. Run:
uv syncYou are running a script directly (e.g. python scripts/python/plpgsql_loops_tests.py) instead of through the Makefile or uv run. Use one of:
uv run python scripts/python/plpgsql_loops_tests.py
make run-dqThe incremental ETL skips a collection when Mongo's count and updated_at match Postgres. To force a reload:
make run-full # all collections
make run-collection-full ARGS="--collection orders" # one collectionGit for Windows ships with make. If it's not in your PATH, run:
# PowerShell
$env:PATH += ";C:\Program Files\Git\usr\bin"Or use the bash shell that comes with Git for Windows.
The help target uses plain @echo (no grep/awk) so it works on both cmd.exe and bash. If you see literal ^ characters, your shell is interpreting caret-escapes. Run make help from a fresh terminal.
- README.md — project overview and quick start
- docs/run_book.md — operational run book
- docs/ARCHITECTURE.md — system architecture
- AGENTS.md — coding standards and conventions