Development Setup¶
This guide documents the supported local development workflow for Wait Time Canada.
Prerequisites¶
- Python 3.12+
- Node.js 22+
- npm
- PostgreSQL connection string (
DATABASE_URL) - Mapbox public token (
NEXT_PUBLIC_MAPBOX_TOKEN)
Recommended Database¶
The documented database path for this project is standard PostgreSQL:
- create or choose a PostgreSQL database for development
- copy the connection string
- export it in your shell as
DATABASE_URLbefore backend commands
The application and migrations use standard PostgreSQL features, so local and hosted development databases are both supported.
1. Clone and Configure Environment Files¶
git clone https://github.com/jerdaw/waittimecanada.git
cd waittimecanada
cp frontend/.env.example frontend/.env.local
export DATABASE_URL="postgresql://user:pass@host:5432/dbname" # pragma: allowlist secret
Populate required frontend values in frontend/.env.local. The backend runtime reads DATABASE_URL from the process environment directly and does not auto-load local env files.
2. Python Environment and Backend Dependencies¶
For runtime-only installs, use:
3. Frontend Dependencies¶
4. Database Migrations and Analytics Bootstrap¶
cd backend
uv run python run_migrations.py
uv run python -m waittime.cli.bootstrap_analytics --days 180
cd ..
5. Run the App¶
Open http://localhost:3000.
Common Dev Commands¶
# Backend tests
cd backend
uv run pytest tests
# Backend quality
uv run ruff check src tests scripts
uv run ruff format src tests scripts
uv run mypy src
uv run python scripts/check_migration_sequence.py
# Frontend quality
cd frontend
npm run type-check
npm run type-check:test
npm run lint
npm run test:unit
# Docs quality (run from repo root)
bash scripts/check-docs.sh
Troubleshooting Notes¶
uv sync --lockedfails after dependency edits: refreshbackend/uv.lockintentionally and include that lockfile change.uvis not onPATHduring local troubleshooting: first restore the documenteduvinstall path above. If an already-createdbackend/.venvis available, you may run repo-local tools directly with.venv/bin/python -m pytest ...,.venv/bin/ruff ..., or.venv/bin/mypy ...as a temporary local fallback. Do not use this fallback to update dependencies, and do not inspect local env files while debugging tool availability.- Analytics regions setup warnings on
/analytics: runuv run python -m waittime.cli.bootstrap_analytics --days 180frombackend/. - Missing map rendering: confirm
NEXT_PUBLIC_MAPBOX_TOKENis set infrontend/.env.local.