# quanghiep03198/fe-wms architecture

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

- Interactive diagram: https://gitdiagram.com/quanghiep03198/fe-wms
- Repository: https://github.com/quanghiep03198/fe-wms

## Overview

##### Main Components
- Public / Landing pages (in the “public” folder)
- Auth module (found under “src/app/(auth)”) for login, authorization, and department APIs.
- Features modules (located in “src/app/(features)”) which include multiple layouts (e.g., dashboard, finished production in/outbound, reports, warehouse, etc.) and their corresponding sub-components.
- Shared UI elements and reusable components (in “src/components/shared” and “src/components/ui”) such as banners, navigation elements, error boundaries, loaders, etc.

- Service Layer: Illustrate the service modules (from “src/services”) that manage API calls for authentication, orders, inventory, report generation, RFID, and warehouse procedures. This layer is the communication bridge between the UI and the backend.

- State Management: Show the “src/stores” directory, which contains state management (like auth.store) that holds application state data.

- Providers & Configurations: Include application-wide providers (in “src/providers”) such as the router, theme, and query-client providers. Also, note that global configurations (from “src/configs”) and internationalization settings (from “src/i18n”) support the entire application.

- Infrastructure & Deployment: Even though this project is mainly a front-end application, include a node for deployment/infrastructure (files in the “infrastructure” folder and configurations like “ecosystem.config.cjs”). These show how the app is hosted and managed.

##### Relationships and Interactions
- Global configurations (app.config, axios.config, navigation.config) support the behavior of both services and the UI layer.
- The internationalization modules (i18n) feed language and localization data to UI components, with a connection to providers for global access.

##### Architectural Patterns and Design Principles
- Modularity: The project is built in a highly modular way by splitting the system into “auth”, “features”, and “public” sections, along with a clear separation between UI components, state (stores), and API services.
- Component Driven: The extensive use of sub-folders under “src/app” (with many layout-specific directories) shows a component-driven approach.
- Clean Separation of Concerns: There is a clear separation between presentation (UI components and storybook for documentation), business logic (services and state management), and configuration/infrastructure.
- Provider Pattern: Use of context providers and hooks ensures that dependencies like theming, routing, and API querying are decoupled and accessible across the application.

##### Technologies and Frameworks
- React with TypeScript – central to the UI.
- Tailwind CSS & PostCSS for styling (see tailwind.config.js, postcss.config.js).
- Storybook for UI component documentation (in “.storybook”).
- API handling via Axios or similar (indicated by axios.config.ts).
- State management likely using React hooks (see “src/stores” and custom hooks in “src/common/hooks”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer Subgraph
    subgraph "UI Layer"
        U1["Public / Landing Pages"]:::ui
        U2["Auth Module (Login,Authorization)"]:::ui
        U3["Features Modules (Layouts&Components)"]:::ui
        subgraph "Shared UI Elements"
            S1["Shared UI Components (Shared)"]:::ui
            S2["Shared UI Components (UI)"]:::ui
        end
    end

    %% Service Layer
    SERV["API Services (Auth,Orders,Inventory,Reports,RFID,Warehouse)"]:::service

    %% State Management
    STATE["State Management (Stores)"]:::state

    %% Providers & Configurations
    subgraph "Providers & Configurations"
        PROV["Providers (Router,Theme,Query-Client)"]:::provider
        CONF["Global Configurations & Internationalization"]:::provider
    end

    %% Infrastructure & Deployment
    subgraph "Infrastructure & Deployment"
        INF["Infrastructure"]:::infra
        DEP["Deployment Config (ecosystem.config.cjs)"]:::infra
    end

    %% Relationships and Data Flow
    U1 -->|"interaction"| SERV
    U2 -->|"callsAPI"| SERV
    U3 -->|"callsAPI"| SERV

    SERV -->|"updatesData"| STATE
    STATE -->|"suppliesState"| PROV

    PROV -->|"injectsProps"| U1
    PROV -->|"injectsProps"| U2
    PROV -->|"injectsProps"| U3
    PROV -->|"injectsProps"| S1
    PROV -->|"injectsProps"| S2

    CONF -->|"configures"| SERV
    CONF -->|"configures"| U1
    CONF -->|"configures"| U2
    CONF -->|"configures"| U3
    CONF -->|"configures"| PROV

    INF -->|"hosts"| U1
    DEP -->|"configuresDeployment"| INF

    %% Click Events
    click U1 "https://github.com/quanghiep03198/fe-wms/tree/develop/src/app/(public)"
    click U2 "https://github.com/quanghiep03198/fe-wms/tree/develop/src/app/(auth)"
    click U3 "https://github.com/quanghiep03198/fe-wms/tree/develop/src/app/(features)"
    click S1 "https://github.com/quanghiep03198/fe-wms/tree/develop/src/components/shared"
    click S2 "https://github.com/quanghiep03198/fe-wms/tree/develop/src/components/ui"
    click SERV "https://github.com/quanghiep03198/fe-wms/tree/develop/src/services"
    click STATE "https://github.com/quanghiep03198/fe-wms/tree/develop/src/stores"
    click PROV "https://github.com/quanghiep03198/fe-wms/tree/develop/src/providers"
    click CONF "https://github.com/quanghiep03198/fe-wms/tree/develop/src/configs"
    click CONF "https://github.com/quanghiep03198/fe-wms/tree/develop/src/i18n"
    click INF "https://github.com/quanghiep03198/fe-wms/tree/develop/infrastructure"
    click DEP "https://github.com/quanghiep03198/fe-wms/blob/develop/ecosystem.config.cjs"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef service fill:#FCF3CF,stroke:#F1C40F,stroke-width:2px;
    classDef state fill:#D5F5E3,stroke:#27AE60,stroke-width:2px;
    classDef provider fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef infra fill:#D6EAF8,stroke:#5DADE2,stroke-width:2px;
```
