# naiksneha12/spice-management-app-goa architecture

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

- Interactive diagram: https://gitdiagram.com/naiksneha12/spice-management-app-goa
- Repository: https://github.com/naiksneha12/spice-management-app-goa

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with React, TypeScript, and Vite.
- It serves as a “Spice Management System” front end, offering user authentication, dashboard reporting, inventory browsing, spice‐mix detail views, and billing features.
- There is no dedicated backend code here—data comes from static JSON files bundled under `public/data` (and mirrored in `src/data` for local imports).

##### File structure
- Top-level files: `index.html`, Vite & ESLint configs, `package.json`, `vercel.json` (indicates deployment on Vercel).
- `src/`: application source code
- `main.tsx` & `index.css`: app entrypoint
- `App.tsx`: route definitions & layout
- `components/`: feature-level React components (Login, Dashboard, Inventory, SpiceMixDetails, Billing)
- `assets/`: static media (e.g., loginImage.avif)
- `data/`: JSON copies for import in dev
- `public/data/`: runtime JSON endpoints (inventory.json, sales.json, etc.)
- No server code or API—Vite serves both `index.html` and static JSON in dev; production build is purely static.

##### README for additional insights
- Confirms feature list: Auth → Dashboard → Inventory → SpiceMixDetails → Billing.
- Mentions TypeScript, React, Vite, ESLint; no mention of external APIs or microservices.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        IDE["IDE"]:::devTools
        NPM["npm run dev/build"]:::devTools
        VITE["Vite Dev Server & Build Tool"]:::devTools
        TS_CFG["TypeScript Configs"]:::devTools
        ESLINT["ESLint Config"]:::devTools
    end

    %% Hosting / CDN
    subgraph "Hosting / CDN"
        INDEX["index.html"]:::hosting
        VERCEL["Vercel CDN"]:::hosting
    end

    %% Client Browser & SPA
    subgraph "Client Browser & React SPA"
        BROWSER["Browser"]:::runtime
        SPA["React SPA"]:::runtime
        ROUTING["Client-side Routing (/login → /dashboard → /inventory → /mix/:id → /billing)"]:::runtime
        Login["Login Module"]:::runtime
        Dashboard["Dashboard Module"]:::runtime
        Inventory["Inventory Module"]:::runtime
        SpiceMixDetails["SpiceMixDetails Module"]:::runtime
        Billing["Billing Module"]:::runtime
    end

    %% Static Data Store
    subgraph "Static Data Store"
        subgraph "Runtime JSON Endpoints"
            INV_JSON["inventory.json"]:::dataStore
            MIXSALES_JSON["mixSales.json"]:::dataStore
            SALES_JSON["sales.json"]:::dataStore
            SPICEMIX_JSON["spiceMixes.json"]:::dataStore
        end
        subgraph "Dev JSON Imports"
            DEV_INV["src/data/inventory.json"]:::dataStore
            DEV_SALES["src/data/sales.json"]:::dataStore
            DEV_SPICEMIX["src/data/spiceMixes.json"]:::dataStore
        end
    end

    %% Development Flow
    IDE --> NPM
    NPM --> VITE
    VITE --> VERCEL
    TS_CFG --> VITE
    ESLINT --> VITE

    %% Hosting to Browser
    VERCEL -->|HTTP GET: JS/CSS, index.html| INDEX
    INDEX -->|Serves| BROWSER
    VERCEL -->|Serves Static Assets| BROWSER

    %% Browser SPA Load
    BROWSER -->|Loads JS/CSS| SPA
    SPA --> ROUTING
    SPA --> Login
    SPA --> Dashboard
    SPA --> Inventory
    SPA --> SpiceMixDetails
    SPA --> Billing

    %% Data Fetches
    BROWSER -->|HTTP GET /data/inventory.json| INV_JSON
    BROWSER -->|HTTP GET /data/mixSales.json| MIXSALES_JSON
    BROWSER -->|HTTP GET /data/sales.json| SALES_JSON
    BROWSER -->|HTTP GET /data/spiceMixes.json| SPICEMIX_JSON

    %% Dev HMR
    BROWSER -.->|WebSocket HMR| VITE

    %% Click Events
    click IDE "https://github.com/naiksneha12/spice-management-app-goa/blob/main/vscode://file/src/main.tsx"
    click SPA "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/main.tsx"
    click ROUTING "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/App.tsx"
    click Login "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Login.tsx"
    click Dashboard "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Dashboard.tsx"
    click Inventory "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Inventory.tsx"
    click SpiceMixDetails "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/SpiceMixDetails.tsx"
    click Billing "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Billing.tsx"
    click INV_JSON "https://github.com/naiksneha12/spice-management-app-goa/blob/main/public/data/inventory.json"
    click MIXSALES_JSON "https://github.com/naiksneha12/spice-management-app-goa/blob/main/public/data/mixSales.json"
    click SALES_JSON "https://github.com/naiksneha12/spice-management-app-goa/blob/main/public/data/sales.json"
    click SPICEMIX_JSON "https://github.com/naiksneha12/spice-management-app-goa/blob/main/public/data/spiceMixes.json"
    click DEV_INV "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/data/inventory.json"
    click DEV_SALES "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/data/sales.json"
    click DEV_SPICEMIX "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/data/spiceMixes.json"
    click VITE "https://github.com/naiksneha12/spice-management-app-goa/blob/main/vite.config.ts"
    click TS_CFG "https://github.com/naiksneha12/spice-management-app-goa/blob/main/tsconfig.json"
    click ESLINT "https://github.com/naiksneha12/spice-management-app-goa/blob/main/eslint.config.js"
    click INDEX "https://github.com/naiksneha12/spice-management-app-goa/blob/main/index.html"
    click VERCEL "https://github.com/naiksneha12/spice-management-app-goa/blob/main/vercel.json"

    %% Styles Modules (optional click)
    click Login "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Login.css"
    click Dashboard "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Dashboard.css"
    click Inventory "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Inventory.css"
    click SpiceMixDetails "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/SpiceMixDetails.css"
    click Billing "https://github.com/naiksneha12/spice-management-app-goa/blob/main/src/components/Billing.css"

    %% Styles
    classDef devTools fill:#e0ffe0,stroke:#006600,stroke-width:1px
    classDef hosting fill:#f0f0f0,stroke:#666666,stroke-width:1px
    classDef runtime fill:#e0f0ff,stroke:#00477d,stroke-width:1px
    classDef dataStore fill:#ffe0a0,stroke:#996600,stroke-width:1px
```
