# mmahmoud95/jobify architecture

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

- Interactive diagram: https://gitdiagram.com/mmahmoud95/jobify
- Repository: https://github.com/mmahmoud95/jobify

## Overview

##### Main System Components

A. Frontend Layer (Client)
- Pages (Dashboard, Landing, Register, etc.)
- Components (Charts, Jobs, Sidebar, etc.)
- Context API State Management
- Assets & Styling

B. Backend Layer (Server)
- API Routes
- Controllers
- Middleware
- Models

C. Database Layer
- MongoDB database representation

##### Component Relationships

A. Client-Side Flow:
**Context API <-> React Components <-> API Calls**

B. Server-Side Flow:
**Routes -> Middleware -> Controllers -> Models -> Database**

##### Detailed Component Breakdown

For each major section, include:

Frontend:
- Context API (appContext.jsx, reducer.js, actions.js)
- Protected Routes
- Authentication Flow
- Dashboard Components
- Charts & Statistics
- Job Management Interface

Backend:
- Authentication Controller
- Jobs Controller
- Error Handling Middleware
- Authentication Middleware
- Database Models (User, Job)

##### Data Flow Indicators

Show:
- User authentication flow
- Job CRUD operations
- Statistics generation
- API requests/responses

**[Frontend Layer]**
- ↑↓
**[API/Middleware Layer]**
- ↑↓
**[Backend Services]**
- ↑↓
**[Database Layer]**

##### Key Integration Points

Emphasize:
- Authentication flow
- Job management operations
- Statistics generation
- Profile management

##### Technical Stack Indicators

- React
- Node.js/Express
- MongoDB
- JWT Authentication
- Styled Components
- Recharts

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        RC[React Client]
        
        subgraph StateManagement
            CA["Context API"]:::context
            RD["Reducer"]:::context
            AC["Actions"]:::context
        end
        
        subgraph Pages
            DP["Dashboard Pages"]:::pages
            LP["Landing Page"]:::pages
            RP["Register Page"]:::pages
            PR["Protected Routes"]:::pages
        end
        
        subgraph Components
            CH["Charts Container"]:::component
            JC["Jobs Container"]:::component
            NB["Navigation Bars"]:::component
            
            subgraph Charts
                AC1["Area Chart"]:::component
                BC["Bar Chart"]:::component
            end
            
            subgraph JobsInterface
                JI["Job Info"]:::component
                JB["Job Component"]:::component
            end
            
            subgraph Navigation
                NAV["Navbar"]:::component
                BSB["Big Sidebar"]:::component
                SSB["Small Sidebar"]:::component
            end
        end
    end
    
    subgraph Backend
        EX["Express Server"]
        
        subgraph Controllers
            AUC["Auth Controller"]:::controller
            JOC["Jobs Controller"]:::controller
        end
        
        subgraph Routes
            AUR["Auth Routes"]:::route
            JOR["Jobs Routes"]:::route
        end
        
        subgraph Middleware
            AM["Auth Middleware"]:::middleware
            EH["Error Handler"]:::middleware
            NF["Not Found"]:::middleware
        end
        
        subgraph Models
            UM["User Model"]:::model
            JM["Job Model"]:::model
        end
        
        subgraph ErrorSystem
            CAE["Custom API Errors"]:::error
            AE["Auth Errors"]:::error
        end
    end
    
    subgraph Database
        DB[(MongoDB)]:::database
        DBC["DB Connection"]:::database
    end
    
    %% Relationships
    RC --> StateManagement
    StateManagement --> Components
    Components --> Pages
    EX --> Routes
    Routes --> Controllers
    Controllers --> Models
    Models --> DB
    Middleware --> Controllers
    
    %% Click Events
    click CA "https://github.com/mmahmoud95/Jobify/blob/main/client/src/context/appContext.jsx"
    click RD "https://github.com/mmahmoud95/Jobify/blob/main/client/src/context/reducer.js"
    click AC "https://github.com/mmahmoud95/Jobify/blob/main/client/src/context/actions.js"
    click LP "https://github.com/mmahmoud95/Jobify/blob/main/client/src/pages/Landing.jsx"
    click RP "https://github.com/mmahmoud95/Jobify/blob/main/client/src/pages/Register.jsx"
    click PR "https://github.com/mmahmoud95/Jobify/blob/main/client/src/pages/ProtectedRout.jsx"
    click DP "https://github.com/mmahmoud95/Jobify/tree/main/client/src/pages/Dashboard/"
    click AC1 "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/AreaChart.jsx"
    click BC "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/BarChart.jsx"
    click CH "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/ChartsContainer.jsx"
    click JB "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/Job.jsx"
    click JC "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/JobsContainer.jsx"
    click JI "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/JobInfo.jsx"
    click NAV "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/Navbar.jsx"
    click BSB "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/BigSideBar.jsx"
    click SSB "https://github.com/mmahmoud95/Jobify/blob/main/client/src/components/SmallSideBar.jsx"
    click AUC "https://github.com/mmahmoud95/Jobify/blob/main/controller/authController.js"
    click JOC "https://github.com/mmahmoud95/Jobify/blob/main/controller/jobsController.js"
    click AUR "https://github.com/mmahmoud95/Jobify/blob/main/routes/authRoutes.js"
    click JOR "https://github.com/mmahmoud95/Jobify/blob/main/routes/jobsRoutes.js"
    click AM "https://github.com/mmahmoud95/Jobify/blob/main/midllewares/auth.js"
    click EH "https://github.com/mmahmoud95/Jobify/blob/main/midllewares/error-handler.js"
    click NF "https://github.com/mmahmoud95/Jobify/blob/main/midllewares/not-found.js"
    click UM "https://github.com/mmahmoud95/Jobify/blob/main/models/user.js"
    click JM "https://github.com/mmahmoud95/Jobify/blob/main/models/job.js"
    click CAE "https://github.com/mmahmoud95/Jobify/blob/main/errors/custom-api.js"
    click AE "https://github.com/mmahmoud95/Jobify/blob/main/errors/unAuthenticated.js"
    click DBC "https://github.com/mmahmoud95/Jobify/blob/main/db/connect.js"
    
    %% Styles
    classDef context fill:#e1f5fe,stroke:#01579b
    classDef pages fill:#e8f5e9,stroke:#2e7d32
    classDef component fill:#f3e5f5,stroke:#7b1fa2
    classDef controller fill:#fff3e0,stroke:#ef6c00
    classDef route fill:#fbe9e7,stroke:#d84315
    classDef middleware fill:#f3e5f5,stroke:#6a1b9a
    classDef model fill:#e8eaf6,stroke:#283593
    classDef error fill:#ffebee,stroke:#c62828
    classDef database fill:#e0f2f1,stroke:#004d40
```
