How mtwn105/githubwrapped works
Main Components
a) Client Layer:
• Next.js 14 Frontend Application
• Server-Side Components
• Client-Side Components
• API Routes
• Server Actions
b) Backend Layer:
• Spring Boot 3.3 Application
• Authentication Filter
• Controllers
• Services
• Repositories
c) External Services:
• GitHub GraphQL API
• MongoDB Database
• OpenPanel Analytics
• Vercel (Frontend Hosting)
• Fly.io (Backend Hosting)
┌─ Client Tier ──────────────────────┐
• Next.js 14 Frontend │
• TypeScript & Tailwind CSS │
• Server/Client Components │
• Server Actions │
• ┬──────────────────┘
┌─ Server Tier ─┴──────────────────┐
• Spring Boot 3.3 │
• Java 21 │
• Controllers & Services │
• Auth Filter │
• ┬──────────────────┘
┌─ Data Tier ───┴──────────────────┐
• MongoDB │
• GitHub GraphQL API │
• ┘
Component Relationships
• Frontend Server Actions → Backend Controllers
• Backend Controllers → Services → Repositories
• Services → GitHub GraphQL API
• Repositories → MongoDB
• API Routes → External Services
Specific Implementation Details
Frontend Section:
• Page routes (/[username], /about, /api)
• Components structure
• Server actions for stats fetching
• OG image generation route
Backend Section:
• Controller endpoints
• Service layer with GitHub integration
• Authentication filter
• Repository layer with MongoDB interaction
Additional Elements
Supporting components:
• Circuit breaker (Resilience4j)
• Analytics integration (OpenPanel)
• Caching mechanisms
• Authentication flow
• Image generation service
Deployment Flow
A separate section showing:
• Vercel deployment for frontend
• Fly.io deployment for backend
• MongoDB Atlas connection
• Environment configurations
Notes for Implementation
• Keep the main application flow clear and centered
• Related components together
• Clear boundaries between different services
• Error handling and fallback paths
• Asynchronous operations