# ablamalki/shoppy architecture

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

- Interactive diagram: https://gitdiagram.com/ablamalki/shoppy
- Repository: https://github.com/ablamalki/shoppy

## Overview

##### Project Type & Purpose
- A frontend-only React Single-Page Admin Dashboard (“Shoppy”) using React.js, TailwindCSS and Syncfusion EJ2 for charts, tables, calendar and Kanban.

##### Main Components
- Public Layer:
– index.html, manifest and static assets served by a web server.
- React App:
– Entry: src/index.js → ContextProvider → App.js.
– Layout: Sidebar, Navbar, Header, ThemeSettings, UserProfile, Chat, Notifications.
– Pages: Dashboard, Orders, Customers, Kanban, Calendar, Team, Charts (Area, Bar, Line, Pie, Stacked).
– UI Widgets: Button, Charts (LineChart, PieChart, Stacked), ChartsHeader.
– Data: src/assets/data.js (static JSON).
- Styling: Tailwind config + global/index.css + component CSS.

##### Relationships & Data Flow
- Browser → index.html → bundles → React entry.
- ContextProvider manages theme & shared state → consumed by components/pages.
- Pages import UI widgets & data → render charts and tables.
- User actions → Context updates → re-render downstream components.

##### Architectural Patterns & Tech
- SPA with Context API for state management.
- Component-based hierarchy: Layout → Pages → Reusable UI components.
- TailwindCSS utility classes; Syncfusion EJ2 chart/calendar modules.
- Purely client-side; no external API in code (can be extended).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Global Entities
    Browser["Browser"]:::external
    subgraph "Public Layer"
        direction TB
        HTML["index.html"]:::static
        Manifest["manifest.json"]:::static
        Robots["robots.txt"]:::static
    end

    %% React Core
    subgraph "React App" 
        direction TB
        Entry["src/index.js"]:::core
        Context["ContextProvider"]:::core
        AppShell["App.js"]:::core
    end

    %% Layout Components
    subgraph "Layout Components"
        direction TB
        Sidebar["Sidebar"]:::core
        Navbar["Navbar"]:::core
        Header["Header"]:::core
        ThemeSettings["ThemeSettings"]:::core
        UserProfile["UserProfile"]:::core
        ChatPanel["Chat"]:::core
        Notifications["Notifications"]:::core
    end

    %% Pages
    subgraph "Pages"
        direction TB
        Dashboard["Dashboard"]:::core
        Orders["Orders"]:::core
        Customers["Customers"]:::core
        KanbanPage["Kanban"]:::core
        CalendarPage["Calendar"]:::core
        Team["Team"]:::core
        subgraph "Charts Pages"
            direction TB
            Area["Area"]:::core
            Bar["Bar"]:::core
            LinePage["Line"]:::core
            PiePage["Pie"]:::core
            StackedPage["Stacked"]:::core
        end
    end

    %% UI Widgets
    subgraph "UI Widgets"
        direction TB
        Button["Button"]:::ui
        ChartsHeader["ChartsHeader"]:::ui
        subgraph "Chart Widgets"
            direction TB
            LineChart["LineChart"]:::ui
            PieChart["PieChart"]:::ui
            StackedChart["StackedChart"]:::ui
        end
    end

    %% Data Store
    Data["data.js (static JSON)"]:::data

    %% Styling
    subgraph "Styling"
        direction TB
        TailwindConfig["tailwind.config.js"]:::static
        GlobalCSS["index.css"]:::static
        AppCSS["App.css"]:::static
    end

    %% Connections
    Browser -->|"loads"| HTML
    HTML -->|"serves bundles"| Entry
    Entry -->|"wraps with"| Context
    Context --> AppShell
    AppShell --> Sidebar
    AppShell --> Navbar
    AppShell --> Header
    AppShell --> ThemeSettings
    AppShell --> UserProfile
    AppShell --> ChatPanel
    AppShell --> Notifications

    AppShell --> Dashboard
    AppShell --> Orders
    AppShell --> Customers
    AppShell --> KanbanPage
    AppShell --> CalendarPage
    AppShell --> Team
    AppShell --> Area
    AppShell --> Bar
    AppShell --> LinePage
    AppShell --> PiePage
    AppShell --> StackedPage

    Dashboard -->|"uses"| Button
    Area -->|"renders"| LineChart
    Bar -->|"renders"| Bar
    LinePage -->|"renders"| LineChart
    PiePage -->|"renders"| PieChart
    StackedPage -->|"renders"| StackedChart
    ChartsHeader -->|"header for charts"| Area
    ChartsHeader --> Bar
    ChartsHeader --> LinePage
    ChartsHeader --> PiePage
    ChartsHeader --> StackedPage

    Area --> Data
    Bar --> Data
    LinePage --> Data
    PiePage --> Data
    StackedPage --> Data

    %% Styling links
    AppShell --> GlobalCSS
    AppShell --> AppCSS
    AppShell --> TailwindConfig

    %% Click Events
    click HTML "https://github.com/ablamalki/shoppy/blob/main/public/index.html"
    click Manifest "https://github.com/ablamalki/shoppy/blob/main/public/manifest.json"
    click Robots "https://github.com/ablamalki/shoppy/blob/main/public/robots.txt"
    click Entry "https://github.com/ablamalki/shoppy/blob/main/src/index.js"
    click Context "https://github.com/ablamalki/shoppy/blob/main/src/contexts/ContextProvider.jsx"
    click AppShell "https://github.com/ablamalki/shoppy/blob/main/src/App.js"
    click Sidebar "https://github.com/ablamalki/shoppy/blob/main/src/components/Sidebar.jsx"
    click Navbar "https://github.com/ablamalki/shoppy/blob/main/src/components/Navbar.jsx"
    click Header "https://github.com/ablamalki/shoppy/blob/main/src/components/Header.jsx"
    click ThemeSettings "https://github.com/ablamalki/shoppy/blob/main/src/components/ThemeSettings.jsx"
    click UserProfile "https://github.com/ablamalki/shoppy/blob/main/src/components/UserProfile.jsx"
    click ChatPanel "https://github.com/ablamalki/shoppy/blob/main/src/components/Chat.jsx"
    click Notifications "https://github.com/ablamalki/shoppy/blob/main/src/components/Notifications.jsx"
    click Dashboard "https://github.com/ablamalki/shoppy/blob/main/src/pages/Dashboard.jsx"
    click Orders "https://github.com/ablamalki/shoppy/blob/main/src/pages/Orders.jsx"
    click Customers "https://github.com/ablamalki/shoppy/blob/main/src/pages/Customers.jsx"
    click KanbanPage "https://github.com/ablamalki/shoppy/blob/main/src/pages/Kanban.jsx"
    click CalendarPage "https://github.com/ablamalki/shoppy/blob/main/src/pages/Calendar.jsx"
    click Team "https://github.com/ablamalki/shoppy/blob/main/src/pages/Team.jsx"
    click Area "https://github.com/ablamalki/shoppy/blob/main/src/pages/Charts/Area.jsx"
    click Bar "https://github.com/ablamalki/shoppy/blob/main/src/pages/Charts/Bar.jsx"
    click LinePage "https://github.com/ablamalki/shoppy/blob/main/src/pages/Charts/Line.jsx"
    click PiePage "https://github.com/ablamalki/shoppy/blob/main/src/pages/Charts/Pie.jsx"
    click StackedPage "https://github.com/ablamalki/shoppy/blob/main/src/pages/Charts/Stacked.jsx"
    click Button "https://github.com/ablamalki/shoppy/blob/main/src/components/Button.jsx"
    click ChartsHeader "https://github.com/ablamalki/shoppy/blob/main/src/components/ChartsHeader.jsx"
    click LineChart "https://github.com/ablamalki/shoppy/blob/main/src/components/Charts/LineChart.jsx"
    click PieChart "https://github.com/ablamalki/shoppy/blob/main/src/components/Charts/PieChart.jsx"
    click StackedChart "https://github.com/ablamalki/shoppy/blob/main/src/components/Charts/Stacked.jsx"
    click Data "https://github.com/ablamalki/shoppy/blob/main/src/assets/data.js"
    click TailwindConfig "https://github.com/ablamalki/shoppy/blob/main/tailwind.config.js"
    click GlobalCSS "https://github.com/ablamalki/shoppy/blob/main/src/index.css"
    click AppCSS "https://github.com/ablamalki/shoppy/blob/main/src/App.css"

    %% Styles
    classDef core fill:#d0e7ff,stroke:#1f78b4,color:#000
    classDef ui fill:#d2f8d2,stroke:#28a745,color:#000
    classDef static fill:#f0f0f0,stroke:#999,color:#000
    classDef data fill:#fff4cc,stroke:#e0a800,color:#000
    classDef external fill:#ffffff,stroke:#333,color:#000
```
