How dongjin2008/astrolink works
Main Components
A. Frontend Layer:
• Next.js App Router (app directory structure)
• Client Components (/components directory)
• Theme Provider
• UI Components
• Client-side Utils
B. Backend Layer:
• Next.js Server Components
• API Routes
• Middleware
• Server-side Utils
C. External Services:
• Supabase Integration
• Database (part of Supabase)
┌─────────────────────────────────────────────────────┐
• Client Browser │
• ┘
• ↕
┌─────────────────────────────────────────────────────┐
• Next.js Application │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Pages │ │Components │ │ Utils │ │
• / │ │- UI │ │- Supabase │ │
• /chat │ │- Theme │ │ Client │ │
• /[slug] │ │- Forms │ │- Store │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
• ↕
┌─────────────────────────────────────────────────────┐
• Middleware │
• ┘
• ↕
┌─────────────────────────────────────────────────────┐
• Supabase │
• ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
• Auth │ │ Database │ │ Real-time │ │
• ┘ └─────────────┘ └─────────────┘ │
• ┘
Important Elements to Highlight
A. App Router Structure:
• Dynamic routing with [slug]
• Server vs. client components
B. Data Flow:
• Client-server communication
• Supabase interactions
• Middleware intercepting requests
C. State Management:
• Store.ts integration
• Theme provider context
Technical Details
• Next.js 13+ App Router architecture
• Supabase client/server utilities
• Authentication flow
• Real-time chat capabilities
• Theme switching mechanism
Relationships to Emphasize
• How the middleware interacts with Supabase
• Component hierarchy and composition
• Data flow between client and server
• State management patterns
Remember to:
• Use consistent notation
• A clear title
• Timestamps and version numbers
• Document any assumptions
• Performance-critical paths
This structure will give other developers a clear understanding of the application's architecture while highlighting the key technical decisions and patterns used in the project.