# eyalyehiely/vibes-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/eyalyehiely/vibes-frontend
- Repository: https://github.com/eyalyehiely/vibes-frontend

## Overview

##### Main System Components

a) Frontend Architecture (Primary Focus)
- Client-Side Application Layer
- Component Layer
- Utility/Services Layer
- Asset Management Layer

##### Component Organization

A. Core Application Layer (Top Level)
- App.tsx
- Main.tsx

B. Feature Modules (Second Level)
Into distinct sections:
- Authentication Components
- Layout Components
- Page Components
- Utility Components

C. Supporting Services (Third Level)
- Authentication Services
- CRUD Operations
- Configuration Services
- Chat Services

##### Specific Implementation Details

a) Authentication Flow:
**GoogleSignIn → CompleteProfile → ProtectedRoute**

b) Layout Structure:
**DefaultLayout → {Header, Sidebar, PageContent}**

c) Utility Services:
**Auth Services ←→ CRUD Operations ←→ Component Layer**

##### Key Architectural Patterns to Highlight

- Component-based architecture
- Hook-based state management
- Service-based utility structure
- Protected routing system

##### Technical Stack Indicators

Technology badges:
- React + TypeScript
- Tailwind CSS
- Vite
- External integrations (flatpickr, etc.)

##### Specific Implementation Notes

- The modular structure of components (/src/components)
- The separation of concerns (utils, hooks, pages)
- The authentication flow implementation
- The theming system (dark mode support)

##### Data Flow Patterns

Key flows:
**User Interaction → Component → Service Layer → External Services**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        App["App.tsx"]
        Main["Main.tsx"]
    end
    click App "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/App.tsx"
    click Main "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/main.tsx"

    subgraph AuthComponents
        GoogleSignIn["GoogleSignIn"]
        CompleteProfile["CompleteProfile"]
        OTPInput["OTPInput"]
    end
    click GoogleSignIn "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/Auth/GoogleSignIn.tsx"
    click CompleteProfile "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/Auth/CompleteProfile.tsx"
    click OTPInput "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/Auth/OTPInput.jsx"

    subgraph Layout
        DefaultLayout["DefaultLayout"]
        Header["Header"]
        Sidebar["Sidebar"]
        PageContent["PageContent"]
    end
    click DefaultLayout "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/DefaultLayout.tsx"
    click Header "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/Header/Header.tsx"
    click Sidebar "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/Sidebar/SideBar.tsx"

    subgraph AuthServices
        CompleteProfileService["CompleteProfileService"]
        LogOut["LogOut"]
        SendOTP["SendOTP"]
        SignUp["SignUp"]
        VerifyOTP["VerifyOTP"]
    end
    click CompleteProfileService "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/auth/completeProfileUsingGoogle.js"
    click LogOut "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/auth/logOut.js"
    click SendOTP "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/auth/sendOtp.js"
    click SignUp "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/auth/signup.js"
    click VerifyOTP "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/auth/verifyOtp.js"

    subgraph ChatServices
        FetchMessages["FetchMessages"]
        SendMessage["SendMessage"]
        UserChats["UserChats"]
    end
    click FetchMessages "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/chat/fetchMessages.js"
    click SendMessage "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/chat/sendChatMessage.js"
    click UserChats "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/chat/userChats.js"

    subgraph CRUD
        Favorites["Favorites"]
        RouteOps["Route Operations"]
        UserOps["User Operations"]
    end
    click Favorites "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/utils/crud/favorites"
    click RouteOps "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/utils/crud/route"
    click UserOps "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/utils/crud/user"

    subgraph Config
        AxiosConfig["AxiosConfig"]
    end
    click AxiosConfig "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/utils/config/axiosConfig.js"

    subgraph StateManagement
        ColorMode["useColorMode"]
        LocalStorage["useLocalStorage"]
    end
    click ColorMode "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/hooks/useColorMode.tsx"
    click LocalStorage "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/hooks/useLocalStorage.tsx"

    subgraph Assets
        CSS["CSS"]
        Fonts["Fonts"]
        Images["Images"]
    end
    click CSS "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/css"
    click Fonts "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/fonts"
    click Images "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/images"

    subgraph UserManagement
        EditProfile["EditUserProfile"]
        UserPicHandling["UserPicHandling"]
    end
    click EditProfile "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/User/EditUserProfile.jsx"
    click UserPicHandling "https://github.com/eyalyehiely/vibes-frontend/blob/main/src/components/User/UserPicHandling.jsx"

    subgraph Pages
        Home["Home"]
        Info["Info"]
        Route["Route"]
    end
    click Home "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/pages/Home"
    click Info "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/pages/Info"
    click Route "https://github.com/eyalyehiely/vibes-frontend/tree/main/src/pages/Route"

    %% Relationships
    App --> Main
    App --> DefaultLayout
    DefaultLayout --> Header
    DefaultLayout --> Sidebar
    DefaultLayout --> PageContent
    PageContent --> Pages

    GoogleSignIn --> CompleteProfile
    CompleteProfile --> OTPInput

    AuthComponents --> AuthServices
    AuthServices --> CRUD
    CRUD --> Config

    Pages --> ChatServices
    Pages --> UserManagement
    UserManagement --> CRUD

    StateManagement --> App
    Assets --> App

    %% Styling
    classDef core fill:#2563eb,color:white
    classDef auth fill:#22c55e,color:white
    classDef layout fill:#7c3aed,color:white
    classDef service fill:#eab308,color:white
    classDef config fill:#ef4444,color:white
    classDef state fill:#14b8a6,color:white
    classDef assets fill:#8b5cf6,color:white
    classDef pages fill:#f97316,color:white

    class App,Main core
    class GoogleSignIn,CompleteProfile,OTPInput auth
    class DefaultLayout,Header,Sidebar,PageContent layout
    class CompleteProfileService,LogOut,SendOTP,SignUp,VerifyOTP,FetchMessages,SendMessage,UserChats service
    class AxiosConfig config
    class ColorMode,LocalStorage state
    class CSS,Fonts,Images assets
    class Home,Info,Route pages
```
