# not2shirts/admin-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/not2shirts/admin-dashboard
- Repository: https://github.com/not2shirts/admin-dashboard

## Overview

##### Project Type and Purpose
- This is a single-page front-end application built with React and Vite, using Tailwind CSS for styling and Redux Toolkit for state management.
- It provides UI pages for Dashboard, Customers, Products, and Sales, along with reusable components and client-side routing.

##### File Structure Analysis
- Top-level config files: vite.config.js, tailwind.config.js, postcss.config.js, eslint.config.js
- Public/static folder: public/ (static assets served as-is)
- Source code:
- src/main.jsx: React app entry point
- src/index.css: global styles
- src/components/: shared UI components (Card, Table, Forms, Header, Sidebar, etc.)
- src/pages/: route‐level components (Dashboard.jsx, Customer.jsx, Products.jsx, Sales.jsx)
- src/store/: Redux Toolkit store and feature slices

##### README Insights
- Confirms use of Vite for fast HMR and React plugin for development.
- Tailwind and ESLint are configured for styling and linting.

##### Detail Level
- Hierarchical containment: Pages contain Components, Components retrieve from Store, Store uses slices.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Legend
    subgraph "Legend"
        UI["UI Layer"]:::legend
        STATE["State Layer"]:::legend
        BUILD["Build Tools"]:::legend
        ASSET["Assets/External"]:::legend
    end

    %% Build & Dev Layer
    subgraph "Build & Dev Tools"
        direction TB
        VITE["vite.config.js"]:::build
        TAILWIND["tailwind.config.js"]:::build
        POSTCSS["postcss.config.js"]:::build
        ESLINT["eslint.config.js"]:::build
        PACKAGE["package.json / package-lock.json"]:::build
        GITIGNORE[".gitignore"]:::build
        README["README.md"]:::build
    end

    %% Static Assets
    subgraph "Assets"
        direction TB
        PUBLIC["public/"]:::asset
        ASSETS["src/assets/"]:::asset
    end

    %% Application
    subgraph "React Application"
        direction TB

        subgraph "Entry"
            BROWSER["Browser / Client"]:::external
            INDEXHTML["index.html"]:::build
            MAIN["src/main.jsx"]:::build
        end

        BROWSER -->|requests| INDEXHTML
        INDEXHTML -->|loads| MAIN

        subgraph "Styling Layer"
            CSS["src/index.css"]:::build
            TAILWINDCSS["Tailwind CSS"]:::build
        end

        subgraph "UI Layer"
            direction TB
            PAGES["src/pages/"]:::ui
            COMPONENTS["src/components/"]:::ui

            subgraph "Pages"
                DASHBOARD["Dashboard.jsx"]:::ui
                CUSTOMERPAGE["Customer.jsx"]:::ui
                PRODUCTSPAGE["Products.jsx"]:::ui
                SALESPAGE["Sales.jsx"]:::ui
            end

            subgraph "Shared Components"
                CARD["Card.jsx"]:::ui
                TABLE["BasicTable.jsx"]:::ui
                FILTER["FilterPanel.jsx"]:::ui
                ADDFORM["AddProductForm.jsx"]:::ui
                CUSTDETAILS["CustDetails.jsx"]:::ui
                DETAILS["Details.jsx"]:::ui
                HEADER["Header.jsx"]:::ui
                SIDEBAR["Sidebar.jsx"]:::ui
                CONTAINER["Container.jsx"]:::ui
                INDEXCOMP["index.js"]:::ui
            end
        end

        subgraph "State Management Layer"
            direction TB
            STORE["store.js"]:::state
            subgraph "Feature Slices"
                DASHSLICE["dashboardSlice.js"]:::state
                CUSTSLICE["customerSlice.js"]:::state
                PRODOSLICE["productSlice.js"]:::state
                SALESSLICE["salesSlice.js"]:::state
            end
        end

        %% External API placeholder
        API["API / Backend Service"]:::external

        %% Interactions
        MAIN -->|"imports styles"| CSS
        MAIN -->|"renders"| PAGES
        MAIN -->|"renders"| COMPONENTS
        PAGES -->|uses| COMPONENTS
        COMPONENTS -->|dispatches actions| STORE
        PAGES -->|dispatches actions| STORE
        STORE -->|provides state| COMPONENTS
        STORE -->|provides state| PAGES
        COMPONENTS -->|loads assets| ASSETS
        PAGES -->|loads assets| ASSETS
        STORE -->|thunks / RTK Query| API

        BROWSER -->|serves static| PUBLIC
    end

    %% Click Events
    click VITE "https://github.com/not2shirts/admin-dashboard/blob/master/vite.config.js"
    click TAILWIND "https://github.com/not2shirts/admin-dashboard/blob/master/tailwind.config.js"
    click POSTCSS "https://github.com/not2shirts/admin-dashboard/blob/master/postcss.config.js"
    click ESLINT "https://github.com/not2shirts/admin-dashboard/blob/master/eslint.config.js"
    click INDEXHTML "https://github.com/not2shirts/admin-dashboard/blob/master/index.html"
    click MAIN "https://github.com/not2shirts/admin-dashboard/blob/master/src/main.jsx"
    click CSS "https://github.com/not2shirts/admin-dashboard/blob/master/src/index.css"
    click PUBLIC "https://github.com/not2shirts/admin-dashboard/tree/master/public/"
    click ASSETS "https://github.com/not2shirts/admin-dashboard/tree/master/src/assets/"
    click COMPONENTS "https://github.com/not2shirts/admin-dashboard/tree/master/src/components/"
    click INDEXCOMP "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/index.js"
    click CARD "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/Card.jsx"
    click TABLE "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/BasicTable.jsx"
    click FILTER "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/FilterPanel.jsx"
    click ADDFORM "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/AddProductForm.jsx"
    click CUSTDETAILS "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/CustDetails.jsx"
    click DETAILS "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/Details.jsx"
    click HEADER "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/Header/Header.jsx"
    click SIDEBAR "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/Sidebar/Sidebar.jsx"
    click CONTAINER "https://github.com/not2shirts/admin-dashboard/blob/master/src/components/container/Container.jsx"
    click PAGES "https://github.com/not2shirts/admin-dashboard/tree/master/src/pages/"
    click DASHBOARD "https://github.com/not2shirts/admin-dashboard/blob/master/src/pages/Dashboard.jsx"
    click CUSTOMERPAGE "https://github.com/not2shirts/admin-dashboard/blob/master/src/pages/Customer.jsx"
    click PRODUCTSPAGE "https://github.com/not2shirts/admin-dashboard/blob/master/src/pages/Products.jsx"
    click SALESPAGE "https://github.com/not2shirts/admin-dashboard/blob/master/src/pages/Sales.jsx"
    click STORE "https://github.com/not2shirts/admin-dashboard/blob/master/src/store/store.js"
    click DASHSLICE "https://github.com/not2shirts/admin-dashboard/blob/master/src/store/features/dashboardSlice.js"
    click CUSTSLICE "https://github.com/not2shirts/admin-dashboard/blob/master/src/store/features/customerSlice.js"
    click PRODOSLICE "https://github.com/not2shirts/admin-dashboard/blob/master/src/store/features/productSlice.js"
    click SALESSLICE "https://github.com/not2shirts/admin-dashboard/blob/master/src/store/features/salesSlice.js"
    click PACKAGE "https://github.com/not2shirts/admin-dashboard/blob/master/package.json"
    click GITIGNORE "https://github.com/not2shirts/admin-dashboard/blob/master/.gitignore"
    click README "https://github.com/not2shirts/admin-dashboard/blob/master/README.md"

    %% Styles
    classDef build fill:#cccccc,stroke:#333,stroke-width:1px
    classDef ui fill:#cce5ff,stroke:#1f77b4,stroke-width:1px
    classDef state fill:#d4edda,stroke:#2ca02c,stroke-width:1px
    classDef asset fill:#fff3cd,stroke:#d4a017,stroke-width:1px
    classDef external fill:#f0f0f0,stroke:#999999,stroke-width:1px
    classDef legend fill:#ffffff,stroke:#000000,stroke-width:0px,font-weight:bold
```
