Documentation
Adding Features
Treat StartupKit as the base layer for any SaaS. This guide shows where to plug in new domains, APIs, or UI without breaking the upgrade path you sell to customers.
1. Extend the Data Layer
- Add Prisma models in
prisma/schema.prismafor your feature (projects, tasks, AI runs, etc.). - Run
npx prisma generateandnpx prisma db push. - Create typed helpers in
src/liborsrc/server(e.g.,src/lib/projects.ts).
2. Build API Routes
- Use the App Router API routes (
src/app/api/feature/route.ts) withNextResponse. - Import
getServerSessionfromnext-authand validate access before mutating data. - Return JSON the dashboard can consume (status messages, pagination metadata, etc.).
3. Connect to the Dashboard
- Add new routes inside
src/app/dashboard. The `page.tsx` files are server components so you can fetch data directly with Prisma. - Compose UI from the primitives in
src/components/uiand layout helpers insrc/components/dashboard. - Gate access with
isPlanFeatureEnabledorhasFeatureAccessto keep upsell flows consistent.
4. Update Pricing & Docs
- Edit
STRIPE_PLANSto toggle the new feature per tier. - Update
src/components/pricing-comparison.tsxand any marketing copy. - Mention the new capability in this documentation page before shipping an updated zip to customers.
5. Release Process
- Test locally with multiple accounts and plans.
- Run
npm run lintandnpm run buildto ensure the template still compiles. - Zip the project (excluding
node_modulesif you want a smaller download) and send it to your customers.
Pro Tips
- Keep feature-specific logic in isolated folders so buyers can remove what they do not need.
- Document manual steps (API keys, third-party services) inside
/documentationso resale customers stay unblocked. - Use feature flags or env variables when experimenting—only bake in what is production-ready before exporting the zip.