1.8 KiB
1.8 KiB
Contributing
Setup
- Use Node.js 22 and pnpm.
- Copy
.env.exampleto.envand setDATABASE_URL. - Install dependencies with
pnpm install. - Generate Prisma client with
pnpm db:generate. - Create local schema with
pnpm db:pushor run the reviewed migration flow. - Seed only non-production data with
pnpm db:seed. - Start the app with
pnpm dev.
Required Checks
Run these before opening a pull request:
pnpm prisma validate
pnpm lint
pnpm test
pnpm typecheck
git diff --check
Engineering Rules
- Use server-side authorization for every route. UI visibility is never a substitute for access control.
- Scope every school-owned query to the caller school. Scope teacher data to assigned classes, student data to self, and parent data to linked children.
- Use
src/lib/access-policy.tsandsrc/lib/role-access.tsinstead of duplicating access rules. - Use
src/lib/storage.tsfor local files. Never assemble arbitrary paths from request input. - Use the Calendar and Notification modules as shared sources, not local copies of deadlines or delivery logic.
- Keep new UI icon-based with Lucide. Do not introduce emoji UI affordances.
- Preserve existing palette, shared motion vocabulary, responsive behavior, and
role-aware page ownership defined in
TODO.md. - Add a migration for every Prisma schema change and update relevant docs/tests.
- Do not add hardcoded policy values when a school-configurable policy is required.
Pull Requests
- Keep a pull request narrowly scoped to one TODO phase item.
- Explain security, migration, audit, export/erasure, and retention effects.
- Include tests for authorization failures and cross-school IDOR attempts when a route handles school or student data.
- Do not commit
.env, database files, backup files, uploaded documents, or generated test artifacts.