26.6.14
Highlights
- Refactored the backend into a clearer composition-root and package-oriented structure.
- Split school API and application flows into focused submodules.
- Split domain schemas, auth, tenancy, and SQL row mappers into smaller domain-aligned modules.
- Removed transitional schema compatibility shims after migrating internal imports.
Backend Architecture
- Reduced
backend/app/main.pyto FastAPI application composition and router registration. - Moved HTTP route registration into
backend/app/api/router.pywith focused route packages for assets and schools. - Split school workflows across
backend/app/application/schools/by schools, years, calendars, enrollments, employments, and assignments. - Split tenancy helpers across focused modules for errors, membership, scope resolution, and record validation.
- Split auth logic across token helpers, dependency resolution, and sign-in/sign-up/session use cases.
- Split domain request and response models into domain-specific modules for assets, users, tenants, persons, schools, locations, auth, and system responses.
- Split SQL row mapping into domain-specific mapper modules under
backend/app/infrastructure/mappers/.
Maintainability
- Preserved existing package import surfaces through package
__init__re-exports while reducing file size and responsibility overlap. - Removed the now-unused
backend.app.domain.schemascompatibility shim after updating workspace imports.
Documentation
- Updated the backend project documentation to describe the current hexagonal backend structure.
- Updated the backlog to mark backend modularization and API refinement as completed.