What problem does it solve?
Defines a modular Firestore data access layer with domain-driven structure, including models, repositories, services, and use-cases for scalable data domains. It covers API routes, pagination, search, sort, caching, and error handling, with Zod validation and barrel exports.
Core Features & Use Cases
- Domain-folder architecture: src/data/{domain}/ with models, repositories, service, use-cases, plus a barrel index.ts for imports.
- Layered pattern: UseCase -> Service -> Repository with strict input validation at the boundary and consistent error handling.
- SSR-ready patterns: cursor-based pagination, server-side counts using Firestore aggregation, and cache strategies via use cache and tags.
- Multi-tenant support: profiles/{profileId}/{collection} scope and dependentId threading across layers.
Quick Start
Create a new domain under src/data/{domain} with models, repositories, service, and use-cases, and wire it into the barrel exports.