# SchoolCompare project context ## Maintained documentation Read [README.md](README.md), [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) and [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for the current implementation. [docs/LEGACY_CODE.md](docs/LEGACY_CODE.md) records obsolete paths and deliberate compatibility code. Historical design documents are not current setup instructions. ## Architecture constraints - Next.js serves the public UI. FastAPI serves school data from dbt-built `marts.*`. The backend does not create school tables or import CSVs at startup. - School coverage spans England and multiple phases, not only primary schools in Wandsworth and Merton. - `/api/*` belongs to the FastAPI proxy. Payload uses `/cms-api` and `/admin`. - Payload runs inside Next.js, with its own `payload` schema and persistent media. Keep CMS migrations independent of school-data transformations. - Public and Payload route groups have separate root layouts. Do not introduce `app/layout.tsx`. Keep site-wide metadata files at the `app/` root. - Builds must succeed with `DATABASE_URL` unset. Do not call `getCachedPayload()` at module scope or add DB-backed `generateStaticParams`. - After changing CMS fields/editors, run `npm run generate:importmap` and commit the generated import map. See `nextjs-app/docs/PUBLISHING.md`. - The backend and pipeline GIAS dictionary copies are generated together; preserve their parity. Tests enforce it. ## SDLC Follow [docs/DEPLOY.md](docs/DEPLOY.md). - Never push directly to `main`. Use a feature branch and a PR with passing checks. - Merges deploy staging only. Production promotion is a separate human decision; do not trigger the promotion workflow yourself. - Update E2E journeys in the same PR when changing user-facing behaviour. - Do not attempt to start a local server to test the application; use unit checks and the configured integration environment.