# tsebo200/aureum-elegance-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/tsebo200/aureum-elegance-frontend
- Repository: https://github.com/tsebo200/aureum-elegance-frontend

## Overview

##### Project type and purpose
- This is a full-stack Warehouse Management System (WMS) for the perfume industry.
- Frontend: Electron-packed React/TypeScript app (“client” folder)
- Backend: .NET Core Web API (separate repo)
- Database: PostgreSQL (hosted via Aiven)
- Auth: JWT + optional Google OAuth

##### File structure
- Top-level “client/” folder holds the entire frontend.
- src/electron: Electron main process (main.ts, util.ts, builder config)
- src/ui: React UI
– Components by feature (AlertCards, Forms, Graphs, Tabs)
– Pages by route (Dashboard, Production, StockRequest, AddStock, AdminManagement, StockManagement, etc.)
– services/: API-client modules for each backend endpoint
– assets/, Sass/, styling (SCSS & CSS modules)
- Configuration: vite.config.ts, tsconfig*.json, babel, jest.config, eslint.config
- Tests: __tests__ (Jest + Testing Library)
- README details frontend tech stack (Vite, React Router, Material-UI, Chart.js) and integration with the .NET Core backend and PostgreSQL.

##### README insights
- 3-tier architecture: UI → API → DB
- Auth flow: JWT, role-based
- Major modules:
- Authentication & routing
- Dashboard (alerts, charts)
- Production workflows (Fragrances, Ingredients, Packaging, Batches, FinishedProducts)
- Stock Requests & Transfers
- Stock & Deliveries
- Warehouse & Admin management
- Waste Loss tracking

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Electron Layer
    subgraph "Electron Layer"
        direction TB
        ElectronMain["Electron Main Process"]:::frontend
        Util["Utilities & Builder Config"]:::frontend
    end

    %% React UI Layer
    subgraph "React UI Layer"
        direction TB
        ReactEntry["React Entry Point (main.tsx)"]:::frontend
        AppRoot["App.tsx (Root Component)"]:::frontend
        subgraph "Pages & Components"
            direction TB
            LoginPage["Login Page"]:::frontend
            DashboardPage["Dashboard Module"]:::frontend
            FragrancesComp["Fragrances Component"]:::frontend
            IngredientsPage["Ingredients Workflow"]:::frontend
            PackagingPage["Packaging Workflow"]:::frontend
            BatchComp["Batch Workflow Component"]:::frontend
            FinishedProductsPage["Finished Products Workflow"]:::frontend
            StockRequestPage["Stock Requests & Transfers"]:::frontend
            AddStockPage["Add Stock & Deliveries"]:::frontend
            WarehousePage["Warehouse Management"]:::frontend
            EmployeesPage["Admin Management (Employees)"]:::frontend
            RecordLossForms["Waste Loss Forms & Tabs"]:::frontend
            WasteLossList["Waste Loss List Component"]:::frontend
        end
    end

    %% API Client Layer
    subgraph "API Client Layer"
        direction TB
        ServicesGroup["Service Facades (services/*.ts)"]:::frontend
        UserService["User Service Route"]:::frontend
        StockRequestService["StockRequest Service Route"]:::frontend
        DeliveryService["Delivery Service Route"]:::frontend
        FinishedProductService["FinishedProduct Service"]:::frontend
        IngredientsService["Ingredients Service Route"]:::frontend
        PackagingService["Packaging Service Route"]:::frontend
        WarehouseService["Warehouse Service Route"]:::frontend
        Models["Data Models (models/*.ts)"]:::frontend
    end

    %% .NET Core Web API Layer
    subgraph ".NET Core Web API Layer"
        direction TB
        Controllers["Controllers"]:::api
        Services["Business Services & Repos"]:::api
        SwaggerUI["Swagger UI"]:::external
    end

    %% Database
    Database["PostgreSQL Database"]:::db

    %% External Services
    subgraph "External Services"
        direction TB
        GoogleOAuth["Google OAuth"]:::external
        PgAdmin["PgAdmin"]:::external
    end

    %% Connections
    ElectronMain -->|launch| ReactEntry
    Util -->|config| ElectronMain
    ReactEntry -->|render| AppRoot
    AppRoot -->|routes| LoginPage
    AppRoot -->|routes| DashboardPage
    AppRoot -->|routes| FragrancesComp
    AppRoot -->|routes| IngredientsPage
    AppRoot -->|routes| PackagingPage
    AppRoot -->|routes| BatchComp
    AppRoot -->|routes| FinishedProductsPage
    AppRoot -->|routes| StockRequestPage
    AppRoot -->|routes| AddStockPage
    AppRoot -->|routes| WarehousePage
    AppRoot -->|routes| EmployeesPage
    AppRoot -->|routes| RecordLossForms
    AppRoot -->|routes| WasteLossList

    %% UI calls API
    LoginPage -->|calls| UserService
    DashboardPage -->|calls| ServicesGroup
    FragrancesComp -->|calls| FinishedProductService
    IngredientsPage -->|calls| IngredientsService
    PackagingPage -->|calls| PackagingService
    BatchComp -->|calls| ServicesGroup
    FinishedProductsPage -->|calls| FinishedProductService
    StockRequestPage -->|calls| StockRequestService
    AddStockPage -->|calls| DeliveryService
    WarehousePage -->|calls| WarehouseService
    EmployeesPage -->|calls| UserService
    RecordLossForms -->|calls| ServicesGroup
    WasteLossList -->|calls| ServicesGroup

    %% API Client to Web API
    ServicesGroup -->|HTTP| Controllers
    UserService -->|HTTP| Controllers
    StockRequestService -->|HTTP| Controllers
    DeliveryService -->|HTTP| Controllers
    FinishedProductService -->|HTTP| Controllers
    IngredientsService -->|HTTP| Controllers
    PackagingService -->|HTTP| Controllers
    WarehouseService -->|HTTP| Controllers
    Models -->|contracts| Controllers

    Controllers -->|invoke| Services
    Services -->|ORM| Database
    Controllers -->|docs| SwaggerUI

    %% Auth flow
    GoogleOAuth -->|OAuth| Controllers
    Controllers -->|issue JWT| LoginPage

    %% Real-time
    Controllers -.->|SignalR| AppRoot

    %% DB management
    PgAdmin -->|manage| Database

    %% Click events
    click ElectronMain "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/electron/main.ts"
    click Util "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/electron/util.ts"
    click Util "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/electron-builder.json"
    click ReactEntry "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/main.tsx"
    click AppRoot "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/App.tsx"
    click LoginPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Login/login.tsx"
    click DashboardPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Dashboard/Dashboard.tsx"
    click DashboardPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Dashboard/Dashboard.module.scss"
    click FragrancesComp "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/components/FragrancesComponent/FragrancesComponent.tsx"
    click IngredientsPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Ingredients/Ingredients.tsx"
    click IngredientsPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Ingredients/Ingredients.module.scss"
    click PackagingPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Packaging/Packaging.tsx"
    click PackagingPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Packaging/Packaging.module.scss"
    click BatchComp "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/components/BatchComponent/BatchComponent.tsx"
    click FinishedProductsPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/FinishedProducts/FinishedProducts.tsx"
    click FinishedProductsPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/FinishedProducts/FinishedProducts.module.scss"
    click StockRequestPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/StockRequest/StockRequest.tsx"
    click StockRequestPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/StockRequest/StockRequest.module.scss"
    click AddStockPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/AddStock/AddStock.tsx"
    click AddStockPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/AddStock/AddStock.scss"
    click WarehousePage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/WarehouseStock.tsx"
    click WarehousePage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/WarehouseStock.module.scss"
    click EmployeesPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Admin Management/Employees.tsx"
    click EmployeesPage "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Pages/Admin Management/Employees.module.scss"
    click RecordLossForms "https://github.com/tsebo200/aureum-elegance-frontend/tree/main/client/src/ui/Components/Forms/Record Loss/"
    click RecordLossForms "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Components/Tabs/Record Loss/RecordLoss.tsx"
    click RecordLossForms "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/Components/Tabs/Record Loss/RecordLoss.module.scss"
    click WasteLossList "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/components/WasteLossListComponent/WasteLossListComponent.tsx"
    click ServicesGroup "https://github.com/tsebo200/aureum-elegance-frontend/tree/main/client/src/ui/services/"
    click UserService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/UserServiceRoute.ts"
    click StockRequestService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/StockRequestServiceRoute.tsx"
    click DeliveryService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/DeliveryServiceRoute.ts"
    click FinishedProductService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/FinishedProductService.ts"
    click IngredientsService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/IngredientsServiceRoutes.ts"
    click PackagingService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/PackagingServiceRoute.ts"
    click WarehouseService "https://github.com/tsebo200/aureum-elegance-frontend/blob/main/client/src/ui/services/WarehouseServiceRoute.ts"
    click Models "https://github.com/tsebo200/aureum-elegance-frontend/tree/main/client/src/ui/services/models/"

    %% Styles
    classDef frontend fill:#D6E8FF,stroke:#888,stroke-width:1px
    classDef api fill:#D5F5E3,stroke:#888,stroke-width:1px
    classDef db fill:#F9E79F,stroke:#888,stroke-width:1px
    classDef external fill:#D5D8DC,stroke:#888,stroke-width:1px
```
