How henryford-cyber/my-spotify works
Main Architecture Components
a) Frontend Layer:
• Next.js Application (App Router)
• Client-side Components
• Server-side Components
• Client-State Management
• UI Components
b) Backend Layer:
• API Routes
• Authentication System
• Supabase Integration
• Media Storage
Detailed Component Breakdown
a) Core Features:
• Authentication (AuthModal, UserProvider)
• Music Player (Player, PlayerContent)
• Library Management
• Search Functionality
• Liked Songs System
b) State Management:
• Custom Hooks Layer
• Provider Components
• Client-side State
• Server-side State
Top Level (Client Layer)
┌─ User Interface Layer ─────────────────────┐
• ┌─ Components ─┐ ┌─ Pages ──┐ ┌─ Layout ─┐ │
• Sidebar │ │ - Home │ │ - Header │ │
• Player │ │ - Search │ │ - Modal │ │
• Library │ │ - Liked │ │ │ │
• ┘ └──────────┘ └─────────┘ │
• ┘
Middle Layer (State & Logic)
┌─ Application Logic Layer ──────────────────┐
• ┌─ Hooks ────┐ ┌─ Providers ┐ ┌─ Actions ┐│
• usePlayer │ │ UserProvider│ │ getSongs ││
• useUser │ │ ModalProvider│ │ getLiked ││
• ┘ └────────────┘ └─────────┘│
• ┘
Bottom Layer (Data & Storage)
┌─ Data Layer ────────────────────────────┐
• ┌─ Supabase ─┐ ┌─ Media Storage ─┐ │
• Auth │ │ - Song Files │ │
• Database │ │ - Images │ │
• ┘ └────────────────┘ │
• ┘
Important Elements
• Blue: UI Components
• Green: State Management
• Orange: Data Layer
• Purple: Authentication
• Yellow: Media Player
• Data flow between components
• User interaction paths
• State updates
• API calls
Specific Implementation Details
Key architectural patterns:
a) Next.js App Router Structure:
• Routing hierarchy (/app directory structure)
• Server vs. client components
b) State Management Flow:
• Custom hooks interaction with UI
• Provider component hierarchy
• Data fetching patterns
c) Authentication Flow:
• Supabase auth integration
• Protected routes
• User session management
Technical Stack Indicators
• Next.js
• Supabase
• TypeScript
• Tailwind CSS
• React