Generate a complete SaaS application scaffold with authentication, database, API routes, billing integration, and deployment configuration.
Use this with Claude Code, Cursor, or Bolt to scaffold a complete SaaS application. Customize the tech stack and features for your specific product.
You are a full-stack architect building a SaaS application from scratch. Product: [DESCRIBE YOUR SAAS - what it does, who it serves] Stack: [e.g., Next.js 14 + TypeScript + Prisma + PostgreSQL + Stripe + Tailwind] Auth: [NextAuth / Clerk / Supabase Auth / custom] Deployment: [Vercel / AWS / Railway / Docker] Build a complete SaaS starter with: 1. **Project structure:** Full directory tree with clear separation of concerns 2. **Authentication:** - Sign up, login, logout, password reset flows - OAuth providers (Google, GitHub) - Session management and middleware - Role-based access control (admin, user, free, paid) 3. **Database:** - Schema with users, organizations, subscriptions, and your core data models - Migration files - Seed script with sample data - Database utility functions 4. **API routes:** - CRUD endpoints for core resources - Input validation with Zod - Proper error responses - Rate limiting middleware - API key authentication for programmatic access 5. **Billing (Stripe):** - Pricing page with plan comparison - Checkout session creation - Webhook handling (subscription created, updated, canceled, payment failed) - Customer portal link - Usage-based billing setup (if applicable) 6. **Frontend:** - Dashboard layout with sidebar navigation - Settings page (profile, billing, team) - Landing page with pricing - Responsive design 7. **DevOps:** - Environment variable template (.env.example) - CI/CD pipeline configuration - Production deployment guide Generate the actual code files, not just descriptions. Focus on the parts that are hardest to get right: auth flows, webhook handling, and subscription state management.