# julien1100/stockify-front architecture

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

- Interactive diagram: https://gitdiagram.com/julien1100/stockify-front
- Repository: https://github.com/julien1100/stockify-front

## Overview

##### Key Components

A. Frontend Layer (Client-Side):
- Components Module (containing reusable UI components)
- Pages Module (containing route-specific views)
- Services Module (containing API integration logic)
- Layouts Module (containing page structure templates)

B. Authentication Layer:
- Login Component
- Register Component
- Authentication State Management
- Protected Routes

C. Core Features Layer:
- Product Management
- Stock Tracking
- User Profile Management

##### Component Relationships

- User Interface → Authentication Layer
- Authentication Layer → Core Features
- Services Layer → External API (backend)

##### Detailed Component Breakdown

A. UI Components (use rectangles):
- Navbar
- Sidebar
- ColorModeSwitch
- ProductCard
- DeleteAlert

B. Pages (use rounded rectangles):
- Dashboard
- ProductDetails
- NewProduct
- UpdateProduct
- Profile
- UpdatePassword

C. Services (use hexagons):
- productLoader
- productsLoader
- userLoader
- registerAction
- logout

##### Data Flow Indicators

- User interaction flow
- Data fetching flow
- Authentication flow
- CRUD operations flow

##### Technical Stack Indicators

- React + Vite
- ESLint (for code quality)
- Environment configuration (.env)

##### Additional Notes

- Notes for important configuration details (vite.config.js, .env)
- Relationship between layouts and their child components

Remember to include version control considerations and any build/deployment specifics that might be relevant to the overall architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        direction TB
        UI[Frontend UI Layer]
        COMP["Components Module"]
        PAGES["Pages Module"]
        SERV["Services Module"]
        LAY["Layouts Module"]
        
        UI --> COMP
        UI --> PAGES
        UI --> SERV
        UI --> LAY
    end

    subgraph Authentication
        direction TB
        LOGIN["Login Component"]:::auth
        REG["Register Component"]:::auth
        AUTH["Authentication State"]:::auth
        PROT["Protected Routes"]:::auth
        
        LOGIN --> AUTH
        REG --> AUTH
        AUTH --> PROT
    end

    subgraph CoreFeatures
        direction TB
        PM["Product Management"]:::product
        ST["Stock Tracking"]:::product
        UPM["User Profile Management"]:::user
    end

    subgraph UIComponents
        direction TB
        NAV["Navbar"]:::ui
        SB["Sidebar"]:::ui
        CMS["ColorModeSwitch"]:::ui
        PC["ProductCard"]:::ui
        DA["DeleteAlert"]:::ui
    end

    subgraph Pages
        direction TB
        DASH["Dashboard"]:::page
        PD["ProductDetails"]:::page
        NP["NewProduct"]:::page
        UP["UpdateProduct"]:::page
        PROF["Profile"]:::page
        UPW["UpdatePassword"]:::page
    end

    subgraph Services
        direction TB
        PLS["productLoader"]:::service
        PSL["productsLoader"]:::service
        UL["userLoader"]:::service
        RA["registerAction"]:::service
        LO["logout"]:::service
    end

    subgraph Config
        direction TB
        ENV[".env"]:::config
        VITE["vite.config.js"]:::config
        ESL[".eslintrc.cjs"]:::config
    end

    Frontend --> Authentication
    Authentication --> CoreFeatures
    CoreFeatures --> Services
    
    %% Component Mappings
    click COMP "https://github.com/Julien1100/stockify-front/tree/develop/src/components/"
    click PAGES "https://github.com/Julien1100/stockify-front/tree/develop/src/pages/"
    click SERV "https://github.com/Julien1100/stockify-front/tree/develop/src/services/"
    click LAY "https://github.com/Julien1100/stockify-front/tree/develop/src/layouts/"
    click LOGIN "https://github.com/Julien1100/stockify-front/blob/develop/src/components/Login.jsx"
    click REG "https://github.com/Julien1100/stockify-front/blob/develop/src/components/Register.jsx"
    click NAV "https://github.com/Julien1100/stockify-front/blob/develop/src/components/Navbar.jsx"
    click SB "https://github.com/Julien1100/stockify-front/blob/develop/src/components/Sidebar.jsx"
    click CMS "https://github.com/Julien1100/stockify-front/blob/develop/src/components/ColorModeSwitch.jsx"
    click DA "https://github.com/Julien1100/stockify-front/blob/develop/src/components/DeleteAlert.jsx"
    click PC "https://github.com/Julien1100/stockify-front/blob/develop/src/components/NewProductCard.jsx"
    click PD "https://github.com/Julien1100/stockify-front/blob/develop/src/pages/ProductDetails.jsx"
    click NP "https://github.com/Julien1100/stockify-front/blob/develop/src/pages/NewProduct.jsx"
    click UP "https://github.com/Julien1100/stockify-front/blob/develop/src/pages/UpdateProduct.jsx"
    click PROF "https://github.com/Julien1100/stockify-front/blob/develop/src/pages/Profile.jsx"
    click UPW "https://github.com/Julien1100/stockify-front/blob/develop/src/pages/UpdatePassword.jsx"
    click PLS "https://github.com/Julien1100/stockify-front/blob/develop/src/services/productLoader.js"
    click PSL "https://github.com/Julien1100/stockify-front/blob/develop/src/services/productsLoader.js"
    click UL "https://github.com/Julien1100/stockify-front/blob/develop/src/services/userLoader.js"
    click LO "https://github.com/Julien1100/stockify-front/blob/develop/src/services/logout.js"
    click RA "https://github.com/Julien1100/stockify-front/blob/develop/src/services/registerAction.js"
    click ENV "https://github.com/Julien1100/stockify-front/blob/develop/.env"
    click VITE "https://github.com/Julien1100/stockify-front/blob/develop/vite.config.js"
    click ESL "https://github.com/Julien1100/stockify-front/blob/develop/.eslintrc.cjs"

    classDef ui fill:#3498db
    classDef auth fill:#2ecc71
    classDef product fill:#e67e22
    classDef user fill:#9b59b6
    classDef service fill:#95a5a6
    classDef page fill:#1abc9c
    classDef config fill:#7f8c8d

    %% Legend
    subgraph Legend
        L1[UI Components]:::ui
        L2[Authentication]:::auth
        L3[Product Management]:::product
        L4[User Management]:::user
        L5[Services]:::service
        L6[Pages]:::page
        L7[Configuration]:::config
    end
```
