# aboalsim114/yalla_shoot_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/aboalsim114/yalla_shoot_frontend
- Repository: https://github.com/aboalsim114/yalla_shoot_frontend

## Overview

##### Main System Components

A. Client Layer (Frontend)
- React.js single-page application structure
- Main component groups:
- Authentication components (Login/Register)
- Dashboard components
- User Interface components (Navbar, Graphs)
- Context providers (Theme, Auth)

B. API Layer
- Communication between frontend and backend
- REST endpoints for different features
- Authentication/authorization flow

C. Backend Layer (Spring Boot)
- While not in the frontend repository, include it as it's mentioned in README
- Main backend services:
- User management
- Team matching service
- Calorie calculation service

##### Component Relationships

**[Client Components] ←→ [Context Providers]**
- ↕
**[Private Routes/Auth Guards]**
- ↕
**[API Layer]**
- ↕
**[Backend Services]**

##### Specific Implementation Details

For the React frontend, structure the components as:
**App.js**
- Context Providers (AuthContext, ThemeContext)
- Routes
- Public Routes (HomePage, Login, Register)
- Private Routes (DashboardUser, Profile, CreateTeam)
- Shared Components (Navbar, Graphs)

##### Key Aspects to Highlight

- Authentication Flow:
- Path from Login/Register components through AuthContext to backend
- How PrivateRoute protects dashboard routes

- Feature Modules:
- Team matching system
- Calorie calculation feature
- User dashboard with graphs and statistics

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        App["App.js"]
        Index["index.js"]
        
        subgraph "Authentication"
            Login["Login"]:::auth
            Register["Register"]:::auth
        end
        
        subgraph "Dashboard"
            DashUser["Dashboard User"]:::dashboard
            CardEquipe["Team Card"]:::dashboard
            DataCard["Data Card"]:::dashboard
            GraphCard["Graph Card"]:::dashboard
        end
        
        subgraph "UI Components"
            Navbar["Navbar"]:::ui
            Graph["Graphs"]:::ui
        end
        
        subgraph "Context"
            AuthContext["Auth Context"]:::context
            ThemeContext["Theme Context"]:::context
        end
        
        subgraph "Team Features"
            SearchTeam["Team Search"]:::team
            TeamDetails["Team Details"]:::team
            CreateTeam["Create Team"]:::team
        end
        
        subgraph "User Management"
            Profile["Profile"]:::user
            HomePage["Home Page"]:::user
        end
        
        PrivateRoute["Private Route"]:::security
    end
    
    subgraph "API Layer"
        AuthAPI["Authentication API"]:::api
        TeamAPI["Team Management API"]:::api
        UserAPI["User Management API"]:::api
        CalorieAPI["Calorie Calculation API"]:::api
    end
    
    subgraph "Backend Services"
        UserService["User Service"]:::backend
        TeamService["Team Matching Service"]:::backend
        CalorieService["Calorie Service"]:::backend
    end
    
    %% Relationships
    App --> Index
    App --> AuthContext
    App --> ThemeContext
    App --> PrivateRoute
    
    AuthContext --> AuthAPI
    PrivateRoute --> AuthContext
    
    Login --> AuthContext
    Register --> AuthContext
    
    DashUser --> CardEquipe
    DashUser --> DataCard
    DashUser --> GraphCard
    
    SearchTeam --> TeamAPI
    TeamDetails --> TeamAPI
    CreateTeam --> TeamAPI
    
    Profile --> UserAPI
    
    AuthAPI --> UserService
    TeamAPI --> TeamService
    CalorieAPI --> CalorieService
    
    %% Click Events
    click Login "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/Authentifcation/Login.jsx"
    click Register "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/Register/Register.jsx"
    click DashUser "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/DashboardUser/DashboardUser.jsx"
    click CardEquipe "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/composants/DashboardUser/CardEquipe.jsx"
    click DataCard "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/composants/DashboardUser/DataCard.jsx"
    click GraphCard "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/composants/DashboardUser/GraphCard.jsx"
    click Navbar "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/composants/Navbar/Navbar.jsx"
    click Graph "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/composants/Graphs/Graph.jsx"
    click AuthContext "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/context/AuthContext.jsx"
    click ThemeContext "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/context/ThemeContext.jsx"
    click PrivateRoute "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/utils/PrivateRoute.jsx"
    click SearchTeam "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/DashboardUser/RechercheEquipe.jsx"
    click TeamDetails "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/DashboardUser/EquipeDetailPage.jsx"
    click CreateTeam "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/Admin/CreateTeam.jsx"
    click Profile "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/Profile/Profile.jsx"
    click App "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/App.js"
    click Index "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/index.js"
    click HomePage "https://github.com/aboalsim114/yalla_shoot_Frontend/blob/main/src/pages/HomePage/HomePage.jsx"
    
    %% Styling
    classDef auth fill:#ff6b6b
    classDef dashboard fill:#4ecdc4
    classDef ui fill:#45b7d1
    classDef context fill:#96ceb4
    classDef team fill:#ffeead
    classDef user fill:#d4a5a5
    classDef security fill:#ff6b6b
    classDef api fill:#ffad60
    classDef backend fill:#a8e6cf
    
    %% Legend
    subgraph Legend
        L1["Authentication"]:::auth
        L2["Dashboard"]:::dashboard
        L3["UI Components"]:::ui
        L4["Context"]:::context
        L5["Team Features"]:::team
        L6["User Management"]:::user
        L7["Security"]:::security
        L8["API"]:::api
        L9["Backend"]:::backend
    end
```
