# Backend Documentation Index ## Start Here - Repository working rules: [`../../CLAUDE.md`](../../CLAUDE.md) - Backend architecture: [`backend-architecture.md`](backend-architecture.md) - Database schema: [`database-schema.md`](database-schema.md) - Error handling: [`error-handling.md`](error-handling.md) Read the repository rules first, then use the backend architecture document as the default development contract for backend work. Every product slice and entity has its own document following the per-slice template (Purpose / Slice Files by layer / API / Access Rules / Tenant Scope / Data Contract / Behavior / Tests / Related). ## Architecture And Foundations - [`backend-architecture.md`](backend-architecture.md): three-layer architecture (API -> BLL -> DAL), import direction, module-authoring factories. - [`shared-crud-factories.md`](shared-crud-factories.md): the CRUD service/controller/router factories, repository helpers, and shared service helpers every generic-CRUD slice is built from. - [`database-schema.md`](database-schema.md): generated table/column/relation reference. - [`migrations-and-seeders.md`](migrations-and-seeders.md): the Umzug runner, file conventions, and how to author a migration/seeder. - [`error-handling.md`](error-handling.md): centralized `AppError` pipeline and error body shape. ## Auth And Access - [`auth-profile.md`](auth-profile.md): sign-in, profile, `GET /api/auth/me`, OAuth, permission model. - [`cookie-auth.md`](cookie-auth.md): HttpOnly cookie sessions and refresh rotation. - [`permissions.md`](permissions.md): the `${METHOD}_${ENTITY}` permission catalog and enforcement. - [`roles.md`](roles.md): roles entity and role<->permission linkage. - [`users.md`](users.md): users entity, invitations, and CSV bulk import. ## Product Feature Slices - [`campus-attendance.md`](campus-attendance.md) - [`campus-catalog.md`](campus-catalog.md): public campus records and branding. - [`communications.md`](communications.md) - [`content-catalog.md`](content-catalog.md) - [`documents.md`](documents.md) - [`frame-entries.md`](frame-entries.md) - [`personality-quiz-results.md`](personality-quiz-results.md) - [`safety-quiz-results.md`](safety-quiz-results.md) - [`staff-attendance.md`](staff-attendance.md) - [`user-progress.md`](user-progress.md) - [`walkthrough-checkins.md`](walkthrough-checkins.md) ## Generic CRUD Entity Slices One document per entity (assembled from the shared CRUD factories; identical 9-endpoint surface — see [`shared-crud-factories.md`](shared-crud-factories.md)). - People: [`students.md`](students.md), [`staff.md`](staff.md), [`guardians.md`](guardians.md), [`organizations.md`](organizations.md). - Academics: [`classes.md`](classes.md), [`subjects.md`](subjects.md), [`class_subjects.md`](class_subjects.md), [`class_enrollments.md`](class_enrollments.md), [`academic_years.md`](academic_years.md), [`assessments.md`](assessments.md), [`assessment_results.md`](assessment_results.md), [`grades.md`](grades.md). - Attendance: [`attendance_sessions.md`](attendance_sessions.md), [`attendance_records.md`](attendance_records.md). - Finance: [`invoices.md`](invoices.md), [`payments.md`](payments.md), [`fee_plans.md`](fee_plans.md). - Scheduling: [`timetables.md`](timetables.md), [`timetable_periods.md`](timetable_periods.md). - Messaging: [`messages.md`](messages.md), [`message_recipients.md`](message_recipients.md). - Access: [`campuses.md`](campuses.md) (authenticated CRUD), [`roles.md`](roles.md). ## Infrastructure Slices - [`file.md`](file.md): upload/download, storage backend, ownership notes. - [`search.md`](search.md): cross-entity search endpoint. - [`email.md`](email.md): transactional email senders and HTML templates. - [`shared-crud-factories.md`](shared-crud-factories.md): shared CRUD building blocks. - [`migrations-and-seeders.md`](migrations-and-seeders.md): Umzug runner and conventions.