What problem does it solve?
It reduces fragile and insecure database work by enforcing consistent Prisma structure, validation, error mapping, and migration workflows for spotiarr’s backend.
Core Features & Use Cases
- Prisma placement boundaries: Keeps Prisma client usage confined to infrastructure code so domain and presentation layers remain clean.
- Singleton PrismaClient pattern: Ensures a single Prisma client instance is created and imported from the designated setup module.
- Validation-first database flow: Requires Zod parsing before repository calls to prevent invalid payloads reaching Prisma.
- Typed DTO → repository → Prisma: Standardizes how requests become typed inputs and how repositories interact with the database.
- Prisma error mapping: Translates raw Prisma errors into application-level errors so UI/HTTP layers handle safe, meaningful outcomes.
- Transaction discipline: Uses tight-scope transactions for atomic multi-write operations.
Quick Start
After you change apps/backend/prisma/schema.prisma, run the backend Prisma generate and migration deploy commands to update the client and apply schema changes.