# nhattan-22/shop_fashion_clothing_fe architecture

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

- Interactive diagram: https://gitdiagram.com/nhattan-22/shop_fashion_clothing_fe
- Repository: https://github.com/nhattan-22/shop_fashion_clothing_fe

## Overview

##### Detailed Component Breakdown

a) Layout Structure
- AdminLayout
- AuthLayout
- UserLayout
- ProductLayout

b) Core Components
- Common Components (buttons, dialogs, tables)
- Specific Components (sidebar, breadcrumb, slider)
- Forms (product, supplier)

c) API Integration Layer
- Axios client
- Auth APIs
- Inventory APIs
- Supplier APIs

##### State Management Flow

Redux implementation with:
- Store
- Thunks (auth, inventory, supplier)
- Slices
- Action flows

Use these specific elements:

- Blue: Core application components
- Green: Feature modules
- Orange: API/External communications
- Purple: State management
- Gray: Utility/Helper functions

→ Data flow
⟲ State updates
⟶ API calls

Symbols:
□ Components
◇ Services
○ State stores
⬡ External systems

Important Considerations:

##### Clear separation between
- Public-facing user interface (user/home, blog, contact, product)
- Admin interface (dashboard, inventory, supplier, report)
- Authentication system (login/register)

##### Internationalization system
- Connection between public/locales and i18n utility
- Translation flow

##### Component hierarchy
- Template components
- Layout components
- Page components
- Common components

##### Cross-cutting concerns
- Loading context
- Global styles
- Constants and interfaces

- Component relationships
- Data flow directions
- State management patterns
- API integration points

This structure will provide a clear understanding of how the frontend application is organized and how different parts interact with each other, while maintaining the appropriate level of detail for a principal software engineer to understand the system architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser"]
        Entry["Entry Point"]:::entry
        Assets["Public Assets"]:::assets
    end

    subgraph AppCore["Application Core"]
        App["App Component"]:::app
        Store["Redux Store"]:::store
        Router["Routing System"]:::router
        Auth["Authentication Layer"]:::auth
        I18n["i18n System"]:::i18n
    end

    subgraph Layouts
        AdminL["Admin Layout"]:::layout
        UserL["User Layout"]:::layout
        AuthL["Auth Layout"]:::layout
        ProductL["Product Layout"]:::layout
    end

    subgraph Features
        direction TB
        subgraph AdminModule
            Dashboard["Admin Dashboard"]:::admin
            Inventory["Inventory Management"]:::admin
        end
        
        subgraph UserModule
            UserPages["User Pages"]:::user
            ProductPages["Product Pages"]:::user
        end
        
        subgraph AuthModule
            LoginPage["Login/Register"]:::auth
        end
    end

    subgraph Components
        CommonComp["Common Components"]:::component
        SpecificComp["Specific Components"]:::component
        Forms["Forms"]:::component
    end

    subgraph API
        AxiosClient["Axios Client"]:::api
        AuthAPI["Auth API"]:::api
        InventoryAPI["Inventory API"]:::api
        SupplierAPI["Supplier API"]:::api
    end

    subgraph State
        ReduxStore["Store Configuration"]:::state
        Thunks["Thunks"]:::state
        Hooks["Redux Hooks"]:::state
    end

    Browser --> Entry
    Entry --> App
    App --> Store
    App --> Router
    App --> Auth
    App --> I18n
    
    Router --> Layouts
    Layouts --> Features
    Features --> Components
    Components --> API
    API --> State
    State --> Store

    %% Click Events
    click Entry "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/index.tsx"
    click App "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/App.tsx"
    click Store "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/redux/store.ts"
    click Auth "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/utils/interfaces/auth.ts"
    click I18n "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/utils/i18n.ts"
    click Assets "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/public/locales"
    click AdminL "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/layouts/admin/AdminLayout.tsx"
    click UserL "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/layouts/user/UserLayout.tsx"
    click AuthL "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/layouts/auth/AuthLayout.tsx"
    click ProductL "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/layouts/product/ProductLayout.tsx"
    click Dashboard "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/pages/admin/dashboard"
    click UserPages "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/pages/user"
    click LoginPage "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/pages/auth"
    click Inventory "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/pages/admin/inventory"
    click CommonComp "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/components/common"
    click SpecificComp "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/components/specific"
    click Forms "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/form"
    click AxiosClient "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/apis/axiosClient.ts"
    click AuthAPI "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/apis/auth.ts"
    click InventoryAPI "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/apis/inventory.ts"
    click SupplierAPI "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/apis/supplier.ts"
    click ReduxStore "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/redux/store.ts"
    click Hooks "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/redux/hooks.ts"
    click Thunks "https://github.com/NhatTan-22/shop_fashion_clothing_fe/tree/main/src/thunks"
    click Router "https://github.com/NhatTan-22/shop_fashion_clothing_fe/blob/main/src/utils/constants/route.ts"

    %% Styles
    classDef entry fill:#2196F3,color:white
    classDef app fill:#2196F3,color:white
    classDef store fill:#9C27B0,color:white
    classDef router fill:#2196F3,color:white
    classDef auth fill:#FF9800,color:white
    classDef i18n fill:#2196F3,color:white
    classDef assets fill:#757575,color:white
    classDef layout fill:#4CAF50,color:white
    classDef admin fill:#4CAF50,color:white
    classDef user fill:#4CAF50,color:white
    classDef component fill:#2196F3,color:white
    classDef api fill:#FF9800,color:white
    classDef state fill:#9C27B0,color:white
```
