# ramzyn12/emotifyapp architecture

> Architecture diagram of the GitHub repository ramzyn12/emotifyapp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ramzyn12/emotifyapp
- Repository: https://github.com/ramzyn12/emotifyapp

## Overview

##### Main System Components

a) Frontend Layer:
- Next.js Application (Client-side)
- Pages/Routes (/detect, /moodTracker)
- Components (Auth, Navigation, Modals)

b) Backend Layer:
- Next.js API Routes
- Authentication System (NextAuth)
- Firebase Integration

c) External Services:
- Face Detection Models
- Music Service Integration (implied by playlist features)
- Firebase Services

**[Client Layer]**
- ↕
**[Server Layer]**
- ↕
**[External Services Layer]**

##### Additional Elements

Specific features:
- Version information or build requirements
- Key technology stack indicators (Next.js, Firebase, Face Detection)
- API endpoints and their purposes
- Data flow direction indicators

##### Technical Details

- Next.js 13+ App Router structure
- API route patterns
- Authentication flow
- Face detection model integration
- Component hierarchy
- Modal interaction patterns

For this specific application, emphasize:
##### The modal system for user interactions

This will create a clear and accurate representation of your Next.js application's architecture while highlighting its unique features and technical implementation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef page fill:#2563eb,color:white
    classDef component fill:#4b5563,color:white
    classDef api fill:#22c55e,color:white
    classDef external fill:#f97316,color:white
    classDef auth fill:#9333ea,color:white
    classDef modal fill:#64748b,color:white

    %% Legend
    subgraph Legend
        P[Page]:::page
        C[Component]:::component
        A[API]:::api
        E[External Service]:::external
        AU[Auth Component]:::auth
        M[Modal]:::modal
    end

    %% Client Layer
    subgraph ClientLayer[Client Layer]
        Layout[Layout]
        click Layout "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/app/layout.js"
        
        Navbar[Navigation Bar]
        click Navbar "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/Navbar.jsx"
        
        Footer[Footer]
        click Footer "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/Footer.jsx"
        
        Instructions[Instructions]
        click Instructions "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/Instructions.jsx"

        subgraph Pages
            Detect[Face Detection Page]:::page
            click Detect "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/app/detect/page.jsx"
            
            MoodTracker[Mood Tracker Page]:::page
            click MoodTracker "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/app/moodTracker/page.jsx"
        end

        subgraph Modals
            CustomiseModal[Customise Modal]:::modal
            click CustomiseModal "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/CustomiseModal.jsx"
            
            NotesModal[Notes Modal]:::modal
            click NotesModal "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/NotesModal.jsx"
            
            PlaylistModal[Playlist Modal]:::modal
            click PlaylistModal "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/PlaylistModal.jsx"
        end

        subgraph MusicComponents
            Tracks[Tracks]:::component
            click Tracks "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/Tracks.jsx"
            
            TracksCarousel[Tracks Carousel]:::component
            click TracksCarousel "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/TracksCarousel.jsx"
        end

        Notes[Notes Component]:::component
        click Notes "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/Notes.jsx"
    end

    %% Server Layer
    subgraph ServerLayer[Server Layer]
        AuthProvider[Auth Provider]:::auth
        click AuthProvider "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/components/AuthProvider.jsx"
        
        NextAuth[NextAuth Route]:::auth
        click NextAuth "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/app/api/auth/[...nextauth]/route.js"
        
        FirebaseConfig[Firebase Config]:::external
        click FirebaseConfig "https://github.com/Ramzyn12/EmotifyApp/blob/main/src/app/firebase.js"
    end

    %% External Services Layer
    subgraph ExternalLayer[External Services]
        FaceModels[Face Detection Models]:::external
        click FaceModels "https://github.com/Ramzyn12/EmotifyApp/tree/main/public/models/"
        
        Firebase[(Firebase Services)]:::external
        MusicAPI[Music Service API]:::external
    end

    %% Connections
    Layout --> Navbar
    Layout --> Footer
    Layout --> Pages
    
    Detect --> FaceModels
    MoodTracker --> Notes
    MoodTracker --> MusicComponents
    
    AuthProvider --> NextAuth
    NextAuth --> Firebase
    
    Tracks --> MusicAPI
    TracksCarousel --> MusicAPI
    
    FirebaseConfig --> Firebase

    %% Modal Connections
    MoodTracker --> Modals
    Notes --> NotesModal
    MusicComponents --> PlaylistModal
```
