# akamabhoi/mumble architecture

> Architecture diagram of the GitHub repository akamabhoi/mumble, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akamabhoi/mumble
- Repository: https://github.com/akamabhoi/mumble

## Overview

##### Main Components
- Frontend Application (Next.js & React)
- Pages and Routing: Separate pages for authentication (app/auth), matching (app/matches), profile (app/profile), and music discovery (app/swipe).
- Layout and Global Styles: Files like app/layout.tsx, app/globals.css, and similar assets in src/app.
- Reusable UI Components: The components folder (app/components/Navbar.tsx) and others that assemble the UI.
- Backend Services (Supabase)
- Database: PostgreSQL managed via Supabase, as evidenced by the schema.sql file in the supabase directory.
- Authentication: Supabase Auth is used, where tokens and auth flows are managed.
- API / Data Layer: The lib/supabase.ts file that initializes and configures the Supabase client.
- Deployment & Environment:
- Configuration files such as next.config.ts, tailwind.config.js, postcss.config.mjs, and tsconfig.json indicate build-time and styling decisions.
- Public/Static Assets: Serve images, logos, and other static content.

##### Diagramming the Relationships and Interactions
- A separate node for “Reusable Components” (with an example being the Navbar) should be shown as a sub-component that can be used by multiple pages.
- Detail how the lib directory integrates the Supabase client. For clarity, add a note that this file acts as the bridge between the UI and backend services.
- Static asset hosting via the public/ directory, which delivers images and assets directly to the client.

##### Architectural Patterns & Design Decisions
- Separation of Concerns: Clearly list the separation between the frontend (presentation) and backend (data & authentication). This shows an MVC-like separation with React (view/controller) and Supabase taking over data/model responsibilities.
- Componentization: Emphasize the reusable framework of React components (e.g., Navbar) and how these support a modular design.
- API/Data Flow: Indicate that Next.js pages trigger API calls (using functions in lib/supabase.ts) to interact with user authentication and the database.
- Responsive Design: Note the custom design system implemented via Tailwind CSS and global styles, ensuring mobile responsiveness.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Next.js Frontend"
        FE_Layout["Layout & Global Styles"] 
        FE_Auth["Auth Page"]
        FE_Matches["Matches Page"]
        FE_Profile["Profile Page"]
        FE_Swipe["Swipe Page"]
        FE_UI["Reusable UI Components (Navbar)"]
    end

    subgraph "Backend Services - Supabase"
        BE_Auth["Supabase Authentication Service"]
        BE_DB["PostgreSQL Database"]
    end

    API_Layer["Supabase API Client (lib/supabase.ts)"]
    STATIC["Static Assets (public/)"]

    FE_Auth -->|"calls"| API_Layer
    FE_Matches -->|"calls"| API_Layer
    FE_Profile -->|"calls"| API_Layer
    FE_Swipe -->|"calls"| API_Layer

    API_Layer -->|"AuthCalls"| BE_Auth
    API_Layer -->|"DataCalls"| BE_DB

    FE_Layout -->|"loads"| STATIC
    FE_UI -->|"included_in"| FE_Layout

    class FE_Auth,FE_Matches,FE_Profile,FE_Swipe,FE_Layout,FE_UI frontend
    class BE_Auth,BE_DB backend
    class API_Layer utility
    class STATIC static

    classDef frontend fill:#FFCC00,stroke:#333,stroke-width:2px;
    classDef backend fill:#66CCFF,stroke:#333,stroke-width:2px;
    classDef utility fill:#99FF99,stroke:#333,stroke-width:2px;
    classDef static fill:#FF99CC,stroke:#333,stroke-width:2px;

    click FE_Auth "https://github.com/akamabhoi/mumble/blob/main/app/auth/page.tsx"
    click FE_Matches "https://github.com/akamabhoi/mumble/blob/main/app/matches/page.tsx"
    click FE_Profile "https://github.com/akamabhoi/mumble/blob/main/app/profile/page.tsx"
    click FE_Swipe "https://github.com/akamabhoi/mumble/blob/main/app/swipe/page.tsx"
    click FE_Layout "https://github.com/akamabhoi/mumble/blob/main/app/layout.tsx"
    click FE_UI "https://github.com/akamabhoi/mumble/blob/main/app/components/Navbar.tsx"
    click API_Layer "https://github.com/akamabhoi/mumble/blob/main/lib/supabase.ts"
    click BE_DB "https://github.com/akamabhoi/mumble/blob/main/supabase/schema.sql"
    click STATIC "https://github.com/akamabhoi/mumble/tree/main/public"
```
