Production Recipes
Use @tantainnovative/ndpr-recipes as a versioned npm source package for backend persistence, routes, adapters, and compliance workflow templates.
@tantainnovative/ndpr-toolkit gives you the runtime components, hooks, validators, scoring, and server utilities. @tantainnovative/ndpr-recipes gives you versioned backend source templates: database schema, route handlers, middleware, and storage adapters that you copy into your application and own.
Treat the recipes package like a maintained implementation workbook. Install it to pin the source version, copy the pieces you need, then adapt naming, authentication, tenancy, logging, and deployment details to your stack.
pnpm add @tantainnovative/ndpr-toolkit
pnpm add -D @tantainnovative/ndpr-recipes
# Prisma projects
cp node_modules/@tantainnovative/ndpr-recipes/prisma/schema.prisma prisma/schema.prisma
# Copy source templates into your app so you can edit them
cp -r node_modules/@tantainnovative/ndpr-recipes/src/nextjs/app-router/api app/api
cp -r node_modules/@tantainnovative/ndpr-recipes/src/adapters src/ndpr-adaptersThe recipes are intentionally not hidden behind a runtime abstraction. Compliance persistence needs to fit your authentication, data retention, audit logging, tenant isolation, and incident-response process.
Which Package Should I Use?
| Need | Use | Why |
|---|---|---|
| Drop-in UI | @tantainnovative/ndpr-toolkit/presets | Fastest way to ship consent, DSR, DPIA, breach, and policy screens. |
| Custom UI with toolkit logic | @tantainnovative/ndpr-toolkit/hooks | Use hooks and bring your own design system. |
| Server validation and scoring | @tantainnovative/ndpr-toolkit/server | RSC-safe utilities with no React import graph. |
| Production persistence examples | @tantainnovative/ndpr-recipes | Versioned source templates for database schemas, adapters, and route handlers. |
Recipe Inventory
| Area | Path | When to use it |
|---|---|---|
| Prisma schema | prisma/schema.prisma | Use when your app already runs Prisma migrations. |
| Drizzle schema | src/drizzle/schema.ts | Use when your app owns schema changes through Drizzle Kit. |
| Next.js routes | src/nextjs/app-router/api/** | Copy into App Router projects that need server-side persistence. |
| Express routes | src/express/** | Mount in existing Node/Express APIs. |
| Storage adapters | src/adapters/** | Bridge toolkit hooks/components to your database layer. |
| Consent middleware | src/nextjs/app-router/middleware.ts | Gate routes by consent state. |
Module Coverage
| Module | Backend surface | Production purpose |
|---|---|---|
| Consent | Consent records, revocation, audit trail | Persist active and historical consent snapshots. |
| DSR | Request intake, reference IDs, target dates | Track 30-day response workflows. |
| Breach | Incident intake, lifecycle updates, NDPC readiness | Keep 72-hour notification evidence visible. |
| DPIA | Assessment metadata, risk score, approval status | Store Section 28 assessment evidence. |
| ROPA | Processing records and completeness checks | Maintain records of processing activities. |
| Compliance | Compliance score API route | Expose server-calculated posture to dashboards. |
| DCPMI / CAR utilities | Designation tier and audit return schedule | Support GAID 2025 classification and filing planning. |
Production Checklist
- Pin both package versions in your lockfile before copying recipe source.
- Replace sample subject identifiers with authenticated user, tenant, or session identifiers.
- Add your tenant isolation and role checks before every write route.
- Review retention periods, audit-log fields, and breach escalation routing with counsel or your DPO.
- Run migrations in a staging environment and test consent revocation, DSR intake, breach updates, and ROPA completeness.
- Keep copied recipe files in your own source control so future changes are reviewed as normal app code.