How heyibad/ai-content-generator works
Main Components
A. Frontend Layer:
• Client-side Components (src/app/_components, src/components/ui)
• Dashboard Interface (src/app/dashboard)
• Authentication Pages (src/app/(auth))
• Context Providers (src/app/(context))
B. Backend Layer:
• API Routes (src/app/api)
• Authentication System
• Middleware (src/middleware.ts)
C. External Services:
• Google Generative AI
• Neon Database (Postgres)
• Cloudinary
• LemonSqueezy
• Resend Email Service
• OAuth Providers (Google, GitHub)
┌─ Client Layer ─────────────────────┐
• Next.js Frontend │
• Shadcn UI Components │
• Context Providers │
• Dashboard & Tools │
• ┬───────────────────┘
• ↓
┌─ Application Layer ─────────────────┐
• Next.js API Routes │
• NextAuth.js │
• Middleware │
• Business Logic │
• ┬───────────────────┘
• ↓
┌─ Data & Services Layer ────────────┐
• Neon Database │
• Google AI │
• Cloudinary │
• LemonSqueezy │
• Resend │
• ┘
Specific Component Relationships to Highlight
A. Authentication Flow:
• Flow from auth pages through NextAuth.js to OAuth providers
• Email verification system
• To user management in the database
B. Content Generation Flow:
• User input from dashboard
• API route processing
• Google AI integration
• Response handling and storage
C. Subscription System:
• LemonSqueezy integration
• Webhook handling
• Usage tracking
• Database updates
Important Details
A. Data Flow Indicators:
• User authentication requests
• Content generation requests
• File upload processes
• Email notifications
• Payment processing
B. Security Layers:
• API route protection
• Session management
• Middleware verification
Technical Implementation Details
• Relationship between Drizzle ORM and Neon Database
• Where TypeScript types are shared
• Context provider boundaries
• Where middleware intersects with requests
Remember to:
• Use clear, consistent symbols
• Version numbers for major services
• Scalability points
• Error handling paths
• Rate limits and quotas
• Caching layers if present
This will provide a comprehensive view of the system while maintaining clarity and usefulness for development and deployment purposes.