What problem does it solve?
This guidance provides a structured approach to building backend services for the CRAN/E web project, enabling consistent data access, API routing, and scalable architecture.
Core Features & Use Cases
- Service Layer Pattern: Organizes all data access into statically scoped services (e.g., PackageService, AuthorService, SearchService) to ensure reuse and testability.
- Typed Data Access & Validation: Uses generated Supabase types and Zod schemas to enforce type safety and input validation across services.
- Back-end Best Practices: Includes caching with TTLCache, server-only organization, error handling, and environment variable validation to support production-grade reliability.
- Use Case: When adding a new backend feature, create a service class, wire it to routes, and validate inputs before database calls.
Quick Start
Implement a new backend feature by adding a static service class in app/data, wiring it to a route in app/routes, and validating inputs with Zod.