How raymondcsirak/sunlight-tennis works
Main Components
a. Frontend Layer:
• Next.js App Router Structure
• Auth Pages (/auth-pages)
• Protected Routes (/authenticated)
• Profile Management
• Partner Finder System
• Court Booking System
• Training Session Management
• UI Components (shadcn/ui)
• State Management (Client-side)
b. Backend Layer:
• Next.js API Routes
• Server Actions
• Middleware (Authentication)
• Supabase Integration
c. Database Layer (Supabase):
• Authentication System
• Database Tables (visible from migrations):
• Profiles
• Courts
• Training Sessions
• Matches
• Achievements
• Player Stats
• Notifications
• Real-time Subscriptions
• Storage (for avatars)
Key Relationships to Highlight
Client → Auth Pages → Supabase Auth → Protected Routes
• Data flow patterns:
Client → API Routes → Supabase → Client
• Real-time connections:
Supabase Real-time → Client
• Storage interactions:
Client → Storage (Avatar Upload) → Supabase Storage
Architectural Patterns to Emphasize
• Route Groups (shown by the (auth-pages) and (authenticated) directories)
• Server Components vs Client Components
• API Routes Structure
• Database Schema Relationships
Specific Implementation Details
┌─ User Management ─────┐ ┌─ Game Features ──────┐
• Authentication │ │ - Match Making │
• Profile Management │ │ - Court Booking │
• Settings │ │ - Training Sessions │
• ┘ └────────────────────┘
┌─ Gamification ───────┐ ┌─ Social Features ────┐
• XP System │ │ - Partner Finder │
• Achievements │ │ - Notifications │
• Player Stats │ │ - Match Responses │
• ┘ └────────────────────┘
Additional Elements
• A section for external integrations (Vercel deployment)
• Middleware placement and function
• Security layer (RLS policies from migrations)
• File storage system for avatars
• Notification system's real-time capabilities