Development recipes
These recipes are the shortest safe paths for extending Next SaaS while preserving typed contracts, organization isolation, entitlements, quota correctness, and static-export compatibility.
Choose a recipe
| Goal | Guide |
|---|---|
| Add a typed backend endpoint | Add a ServiceStack API |
| Sell or restrict a capability | Add a feature gate |
| Measure and limit customer activity | Add a meter and quota |
| Run reliable work outside a request | Add a background job |
| Change persistent product data | Database migrations |
| Build an authenticated product screen | Add a frontend page |
| Refresh the TypeScript client | Generate typed DTOs |
| Prove behavior and prevent regressions | Testing |
| Work effectively with coding agents | AI-assisted development |
Typical full-stack change
For a new quota-controlled product capability, use this order:

- define the request/response contract;
- register its feature and meter keys;
- add persistence and a migration if necessary;
- implement tenant-bound authorization and metering;
- regenerate TypeScript DTOs;
- add the static-compatible frontend page;
- test policy boundaries and UI behavior;
- run
./scripts/verify.sh.
Keep global product policy in JSON, plan and customer state in the RDBMS, and provider secrets in environment configuration.
Support operations
The /admin Operations Center uses capability-aware side navigation and focused static routes: customer workflows live at /admin/customers, repair queues at /admin/operations, and retention, audit, and support-access controls at /admin/security.
Add a ServiceStack API
Define contracts in C#, implement policy in the service layer, then regenerate the TypeScript client.