What problem does it solve?
Abstracts data storage behind a repository interface, decoupling business logic from database specifics and ensuring typed domain entities are returned.
Core Features & Use Cases
- Interface-first design: define ports in backend/src/services/ports and implement them in backend/src/repositories
- User-scoping and soft-delete: queries must filter by userId and archived records are excluded by default
- Hydration and validation: read records through a Zod schema typed to the entity before returning
- Error handling and portability: centralize errors at the repository boundary and write portable queries usable across SQL/NoSQL
- Configuration via constructor: inject dependencies instead of reading environment variables inside the class
Quick Start
Create a backend repository for an entity by defining a ports interface, implementing it in a repository class, and wiring repository-level rules (user scoping, soft delete, hydration, and error handling) into the data layer.