2026-02-11 06:15:54 +00:00
|
|
|
|
# Development
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
This page is the contributor workflow for Mission Control.
|
2026-02-11 06:15:54 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
It’s intentionally **CI-aligned**: if you can run these commands locally, you should not be surprised by CI.
|
2026-02-11 06:15:54 +00:00
|
|
|
|
|
2026-02-11 06:36:12 +00:00
|
|
|
|
## Prerequisites
|
2026-02-11 06:15:54 +00:00
|
|
|
|
|
2026-02-11 06:36:12 +00:00
|
|
|
|
- Docker + Docker Compose v2 (`docker compose`)
|
2026-02-11 12:59:37 +00:00
|
|
|
|
- Python **3.12+** + [`uv`](https://github.com/astral-sh/uv)
|
2026-02-11 06:36:12 +00:00
|
|
|
|
- Node.js + npm
|
2026-02-11 12:59:37 +00:00
|
|
|
|
- CI pins **Node 20** via `.github/workflows/ci.yml` (`actions/setup-node@v4`, `node-version: "20"`).
|
2026-02-11 06:15:54 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Repo layout
|
2026-02-11 06:15:54 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
- Backend: `backend/` (FastAPI)
|
|
|
|
|
|
- Frontend: `frontend/` (Next.js)
|
|
|
|
|
|
- Canonical commands: `Makefile`
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Setup (one command)
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
From repo root:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
make setup
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
What it does (evidence: `Makefile`):
|
|
|
|
|
|
- `make backend-sync`: `cd backend && uv sync --extra dev`
|
|
|
|
|
|
- `make frontend-sync`: verifies node tooling (`scripts/with_node.sh --check`), then `npm install` in `frontend/`
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Run the stack (two recommended loops)
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
### Loop A (recommended): DB via Compose, app in dev mode
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
1) Start Postgres:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-02-11 12:59:37 +00:00
|
|
|
|
cp .env.example .env
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
docker compose -f compose.yml --env-file .env up -d db
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
2) Backend dev server:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cd backend
|
|
|
|
|
|
cp .env.example .env
|
2026-02-11 12:59:37 +00:00
|
|
|
|
uv sync --extra dev
|
2026-02-11 06:36:12 +00:00
|
|
|
|
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
3) Frontend dev server:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cd frontend
|
|
|
|
|
|
cp .env.example .env.local
|
2026-02-11 12:59:37 +00:00
|
|
|
|
# ensure this is correct for the browser:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
# NEXT_PUBLIC_API_URL=http://localhost:8000
|
2026-02-11 12:59:37 +00:00
|
|
|
|
npm install
|
2026-02-11 06:36:12 +00:00
|
|
|
|
npm run dev
|
|
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
### Loop B: all-in-one Compose
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
cp .env.example .env
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
docker compose -f compose.yml --env-file .env up -d --build
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Checks (CI parity)
|
|
|
|
|
|
|
|
|
|
|
|
### Run everything
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-02-11 12:59:37 +00:00
|
|
|
|
make check
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
Evidence: `Makefile`.
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
### Common targeted commands
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
Backend:
|
|
|
|
|
|
```bash
|
|
|
|
|
|
make backend-lint # flake8
|
|
|
|
|
|
make backend-typecheck # mypy --strict
|
|
|
|
|
|
make backend-test # pytest
|
|
|
|
|
|
make backend-coverage # pytest + scoped 100% coverage gate
|
|
|
|
|
|
make backend-migrate # alembic upgrade head
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
Frontend:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```bash
|
2026-02-11 12:59:37 +00:00
|
|
|
|
make frontend-lint # eslint
|
|
|
|
|
|
make frontend-typecheck # tsc
|
|
|
|
|
|
make frontend-test # vitest
|
|
|
|
|
|
make frontend-build # next build
|
2026-02-11 06:36:12 +00:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Cypress E2E
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
Evidence: `docs/testing/README.md`, `.github/workflows/ci.yml`.
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
- E2E uses Clerk’s official Cypress integration (`@clerk/testing`).
|
|
|
|
|
|
- Local run pattern:
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
```bash
|
|
|
|
|
|
# terminal 1
|
|
|
|
|
|
cd frontend
|
|
|
|
|
|
npm run dev -- --hostname 0.0.0.0 --port 3000
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
# terminal 2
|
|
|
|
|
|
cd frontend
|
|
|
|
|
|
npm run e2e -- --browser chrome
|
|
|
|
|
|
```
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
## Deep dives
|
2026-02-11 06:36:12 +00:00
|
|
|
|
|
2026-02-11 12:59:37 +00:00
|
|
|
|
- [Testing guide](testing/README.md)
|
|
|
|
|
|
- [Troubleshooting deep dive](troubleshooting/README.md)
|