How leerob/next-saas-starter works
Main Components
a) Client-Side Layer:
• Next.js Frontend (App Router)
• Marketing Pages (/, /pricing)
• Dashboard Routes (/dashboard/*)
• Authentication Pages (/sign-in, /sign-up)
• UI Components (shadcn/ui)
b) Server-Side Layer:
• Next.js API Routes
• Server Actions
• Authentication Middleware
• Database Layer
• Payment Integration
Frontend Architecture
• Public Routes
• Landing Page
• Pricing Page
• Protected Routes
• Dashboard
• Settings
• Security
• Activity
• Auth Routes
• Sign In
• Sign Up
Middleware Layer
• Global Auth Middleware
• Route Protection
• Schema Validation
Backend Services
• Authentication Service
• JWT Management
• Session Handling
• Database Layer (PostgreSQL)
• User Management
• Team Management
• Activity Logging
• Payment Integration
• Stripe Checkout
• Webhook Handler
• Customer Portal
Key Relationships to Highlight
a) Authentication Flow:
• How auth middleware protects dashboard routes
• JWT flow from login to protected routes
• Demonstrate session management
b) Payment Flow:
• Stripe Checkout integration
• Webhook handling for subscription events
• Customer portal integration
c) Data Flow:
• Server Actions for CRUD operations
• Database queries and migrations
• Activity logging system
Important Technical Details
Specific implementations:
• Next.js App Router structure
• Drizzle ORM integration
• Server Components vs Client Components
• API routes for Stripe integration
• Database schema relationships
Additional Notes
• Version numbers for key technologies
• Authentication strategy (JWT + Cookies)
• RBAC system (Owner/Member roles)
• Activity logging system's integration points
Remember to include a small section showing the development tools and utilities (migrations, seeding, etc.) as a separate panel, as these are important for the complete system understanding but not part of the runtime architecture.