How david-patrick-chuks/ai-content-creator works
Main Components
A. Frontend Layer:
• Client-Side Components
• Authentication Routes (/sign-in, /sign-up)
• Dashboard Interface
• Content Management
• Billing System
• Settings
• History Tracking
B. Application Layer:
• Next.js Server Components
• Authentication Middleware
• API Routes
• Context Providers (TotalUsageContext, UpdateCreditUsageContext)
C. Database Layer:
• Database (indicated by drizzle.config.js and schema.tsx)
• Data Models
D. External Services:
• Authentication Service (implied by auth directory structure)
• AI Service (implied by AiModal.tsx)
┌─────────────────────────────────────────────────────────┐
• Client Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Public │ │ Auth │ │ Dashboard │ │
• Pages │ │ Pages │ │ Pages │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┤
• Next.js Server Layer │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• API │ │ Server │ │ Context │ │
• Routes │ │ Components │ │ Providers │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┤
• Service Layer │
• ┌─────────────┐ ┌─────────────┐ │
• Auth │ │ AI │ │
• Service │ │ Service │ │
• ┘ └─────────────┘ │
• ┤
• Data Layer │
• ┌─────────────────────────────────┐ │
• Database │ │
• (Drizzle ORM) │ │
• ┘ │
• ┘
Key Relationships to Highlight
• Authentication flow between client, server, and auth service
• Dashboard components interaction with AI service
• Data flow between server components and database
• Context providers' relationship with components
• Middleware interactions for protected routes
Technical Stack Indicators
• Next.js 13+ (App Router)
• TypeScript
• Tailwind CSS
• Drizzle ORM
• Authentication System
• AI Integration
Remember to:
• Keep the main flows clear and visible
• Notes for important architectural decisions
• Scalability points
• Error handling paths
• Security boundaries