# sharma572/chargecity architecture

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

- Interactive diagram: https://gitdiagram.com/sharma572/chargecity
- Repository: https://github.com/sharma572/chargecity

## Overview

##### Project type and purpose
- This is a single-page React dashboard application (an “admin panel”) bootstrapped with Create React App.
- It provides charts, tables, widgets, navigation, dark-mode support, and forms, all implemented purely in the front end.

##### File structure
Top-level:
- public/ – static index.html and assets served by a static web server or CDN
- src/ – all application code
– index.js & App.js: application entry point and root component
– components/…: reusable UI widgets (charts, tables, featured items, navbar, sidebar, widget) each with .jsx and .scss
– pages/…: route-level components (home, list, single, new, login) each with their own styling
– context/: React Context + reducer for dark-mode toggling
– datatablesource.js & formSource.js: hard-coded or mock data sets for tables and forms
– style/: global SCSS files (e.g., Dark.scss)
– utils/: any helper functions (not shown in tree but reserved for utilities)

##### README for additional insights
- No custom architecture notes—standard CRA setup.
- No back-end code: implies that API calls will go to external services (real or mock).

## Diagram (Mermaid)

```mermaid
flowchart TB
    ClientBrowser["Client Browser"]:::infra
    StaticHost["Static Hosting\n(public/index.html)"]:::infra
    ClientBrowser -->|"HTTP GET index.html & bundles"| StaticHost
    StaticHost -->|"Serves App"| ClientBrowser

    subgraph "React Application"
        subgraph "Entry & Routing"
            IndexJS["index.js"]:::entry
            AppJS["App.js"]:::entry
            IndexJS --> AppJS
        end

        subgraph "Router & Pages"
            Home["Home.jsx"]:::pages
            List["List.jsx"]:::pages
            Single["Single.jsx"]:::pages
            NewPage["New.jsx"]:::pages
            Login["Login.jsx"]:::pages
        end

        subgraph "Global State (Context)"
            DarkModeContext["darkModeContext.js"]:::state
            DarkModeReducer["darkModeReducer.js"]:::state
            DarkModeContext --> DarkModeReducer
        end

        subgraph "Shared UI Components"
            ChartComp["Chart.jsx"]:::components
            DatatableComp["Datatable.jsx"]:::components
            FeaturedComp["Featured.jsx"]:::components
            NavbarComp["Navbar.jsx"]:::components
            SidebarComp["Sidebar.jsx"]:::components
            TableComp["Table.jsx"]:::components
            WidgetComp["Widget.jsx"]:::components
        end

        subgraph "Data Sources"
            DataTableSource["datatablesource.js"]:::data
            FormSource["formSource.js"]:::data
        end

        AppJS -->|"initializes Router"| Home
        AppJS --> List
        AppJS --> Single
        AppJS --> NewPage
        AppJS --> Login
        AppJS --> DarkModeContext
        Home --> ChartComp
        Home --> FeaturedComp
        List --> DatatableComp
        Single --> TableComp
        NewPage --> FormSource
        Home --> SidebarComp
        Home --> NavbarComp
        ChartComp --> DataTableSource
        DatatableComp --> DataTableSource
        WidgetComp --> FormSource
    end

    ExternalAPI["External API / Backend"]:::infra
    ReactApplication -->|"fetches data"| ExternalAPI

    click StaticHost "https://github.com/sharma572/chargecity/blob/master/public/index.html"
    click IndexJS "https://github.com/sharma572/chargecity/blob/master/src/index.js"
    click AppJS "https://github.com/sharma572/chargecity/blob/master/src/App.js"
    click Home "https://github.com/sharma572/chargecity/blob/master/src/pages/home/Home.jsx"
    click List "https://github.com/sharma572/chargecity/blob/master/src/pages/list/List.jsx"
    click Single "https://github.com/sharma572/chargecity/blob/master/src/pages/single/Single.jsx"
    click NewPage "https://github.com/sharma572/chargecity/blob/master/src/pages/new/New.jsx"
    click Login "https://github.com/sharma572/chargecity/blob/master/src/pages/login/Login.jsx"
    click ChartComp "https://github.com/sharma572/chargecity/blob/master/src/components/chart/Chart.jsx"
    click DatatableComp "https://github.com/sharma572/chargecity/blob/master/src/components/datatable/Datatable.jsx"
    click FeaturedComp "https://github.com/sharma572/chargecity/blob/master/src/components/featured/Featured.jsx"
    click NavbarComp "https://github.com/sharma572/chargecity/blob/master/src/components/navbar/Navbar.jsx"
    click SidebarComp "https://github.com/sharma572/chargecity/blob/master/src/components/sidebar/Sidebar.jsx"
    click TableComp "https://github.com/sharma572/chargecity/blob/master/src/components/table/Table.jsx"
    click WidgetComp "https://github.com/sharma572/chargecity/blob/master/src/components/widget/Widget.jsx"
    click DataTableSource "https://github.com/sharma572/chargecity/blob/master/src/datatablesource.js"
    click FormSource "https://github.com/sharma572/chargecity/blob/master/src/formSource.js"
    click DarkModeContext "https://github.com/sharma572/chargecity/blob/master/src/context/darkModeContext.js"
    click DarkModeReducer "https://github.com/sharma572/chargecity/blob/master/src/context/darkModeReducer.js"

    classDef infra fill:#f9f,stroke:#333,stroke-width:1px
    classDef entry fill:#bbf,stroke:#333,stroke-width:1px
    classDef pages fill:#bfb,stroke:#333,stroke-width:1px
    classDef state fill:#fbf,stroke:#333,stroke-width:1px
    classDef components fill:#ffb,stroke:#333,stroke-width:1px
    classDef data fill:#fbb,stroke:#333,stroke-width:1px
```
