# jeinciong/automotive-spare-parts-dss-thesis architecture

> Architecture diagram of the GitHub repository jeinciong/automotive-spare-parts-dss-thesis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeinciong/automotive-spare-parts-dss-thesis
- Repository: https://github.com/jeinciong/automotive-spare-parts-dss-thesis

## Overview

This repository implements a sales and inventory management application with forecasting and business reporting. Users sign in, navigate operational views, and manage inventory, sales, suppliers, notifications, and forecasts; frontend contexts fetch and update data through the backend API. Forecasting also has Python model modules for demand classification and revenue prediction. The README is empty, so capability coverage is based on the source tree and sampled frontend references; backend internals and some unsampled view interactions are not detailed here.

Main entry points: [`frontend/src/App.tsx`](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/App.tsx) (Application Shell), [`frontend/src/contexts/SalesReportsContext.tsx`](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/SalesReportsContext.tsx) (Sales Report State), [`frontend/src/lib/api.ts`](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/lib/api.ts) (API URL Client), [`frontend/src/contexts/ForecastContext.tsx`](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/ForecastContext.tsx) (Forecast State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["Application Shell<br/>[App.tsx]"]
  node_login["Sign In<br/>[LoginPage.tsx]"]
  node_navigation["Navigation<br/>[AppSidebar.tsx]"]
end

subgraph group_ops["Business Operations"]
  node_inventoryview["Inventory View<br/>[InventoryView.tsx]"]
  node_inventory["Inventory State"]
  node_suppliers["Supplier Management<br/>[SuppliersView.tsx]"]
  node_supplierstate["Supplier State"]
  node_notifications["Notifications"]
end

subgraph group_insights["Reporting And Forecasting"]
  node_salesview["Sales Reports View"]
  node_salesstate["Sales Report State"]
  node_dashboard["Dashboard<br/>[DashboardView.tsx]"]
  node_analytics["Analytics<br/>[AnalyticsView.tsx]"]
  node_predictions["Forecast View"]
  node_recommendations["Recommendations"]
  node_forecaststate["Forecast State"]
end

subgraph group_services["Data Services"]
  node_api["API URL Client<br/>[api.ts]"]
  node_server["Backend API<br/>[server.ts]"]
  node_arima["ARIMA XGBoost<br/>[arima_xgb_model.py]"]
  node_tsb["TSB XGBoost<br/>[tsb_xgb_model.py]"]
  node_demand["Demand Classifier"]
end

node_user(("Business User"))

node_user -->|"signs in"| node_login
node_login -->|"authenticates into"| node_app
node_app -->|"renders"| node_navigation
node_app -->|"provides state"| node_inventory
node_app -->|"provides state"| node_supplierstate
node_app -->|"provides state"| node_salesstate
node_app -->|"provides state"| node_forecaststate
node_app -->|"provides state"| node_notifications
node_app -->|"renders"| node_salesview
node_app -->|"renders"| node_predictions
node_app -->|"renders"| node_recommendations
node_app -->|"renders"| node_inventoryview
node_app -->|"renders"| node_dashboard
node_salesview -->|"uses reports"| node_salesstate
node_inventoryview -->|"uses inventory"| node_inventory
node_inventoryview -->|"uses suppliers"| node_supplierstate
node_predictions -->|"uses forecasts"| node_forecaststate
node_forecaststate -->|"reads sales"| node_salesstate
node_salesstate -->|"uses inventory"| node_inventory
node_inventory -->|"builds API requests"| node_api
node_salesstate -->|"builds API requests"| node_api
node_forecaststate -->|"builds API requests"| node_api
node_supplierstate -->|"uses API URL"| node_api
node_api -.->|"targets API"| node_server
node_arima -->|"fits and forecasts"| node_arima
node_demand -.->|"classifies demand"| node_arima

click node_app "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/App.tsx"
click node_login "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/LoginPage.tsx"
click node_navigation "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/AppSidebar.tsx"
click node_inventoryview "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/InventoryView.tsx"
click node_inventory "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/InventoryContext.tsx"
click node_suppliers "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/SuppliersView.tsx"
click node_supplierstate "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/SuppliersContext.tsx"
click node_notifications "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/NotificationContext.tsx"
click node_salesview "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/SalesReportsView.tsx"
click node_salesstate "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/SalesReportsContext.tsx"
click node_dashboard "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/DashboardView.tsx"
click node_analytics "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/AnalyticsView.tsx"
click node_predictions "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/PredictionsTrendsView.tsx"
click node_recommendations "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/RecommendationsView.tsx"
click node_forecaststate "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/ForecastContext.tsx"
click node_api "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/lib/api.ts"
click node_server "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/server.ts"
click node_arima "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/models/arima_xgb_model.py"
click node_tsb "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/models/tsb_xgb_model.py"
click node_demand "https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/utils/demand_classifier.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_login,node_navigation,node_user toneBlue
class node_inventoryview,node_inventory,node_suppliers,node_supplierstate,node_notifications toneAmber
class node_salesview,node_salesstate,node_dashboard,node_analytics,node_predictions,node_recommendations,node_forecaststate toneMint
class node_api,node_server,node_arima,node_tsb,node_demand toneRose
```

## Components

### Application Shell

- [Application Shell](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign In](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/LoginPage.tsx): `frontend/src/components/LoginPage.tsx`
- [Navigation](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/AppSidebar.tsx): `frontend/src/components/AppSidebar.tsx`

### Business Operations

- [Inventory View](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/InventoryView.tsx): `frontend/src/components/views/InventoryView.tsx`
- [Inventory State](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/InventoryContext.tsx): `frontend/src/contexts/InventoryContext.tsx`
- [Supplier Management](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/SuppliersView.tsx): `frontend/src/components/views/SuppliersView.tsx`
- [Supplier State](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/SuppliersContext.tsx): `frontend/src/contexts/SuppliersContext.tsx`
- [Notifications](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/NotificationContext.tsx): `frontend/src/contexts/NotificationContext.tsx`

### Reporting And Forecasting

- [Sales Reports View](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/SalesReportsView.tsx): `frontend/src/components/views/SalesReportsView.tsx`
- [Sales Report State](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/SalesReportsContext.tsx): `frontend/src/contexts/SalesReportsContext.tsx`
- [Dashboard](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/DashboardView.tsx): `frontend/src/components/views/DashboardView.tsx`
- [Analytics](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/AnalyticsView.tsx): `frontend/src/components/views/AnalyticsView.tsx`
- [Forecast View](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/PredictionsTrendsView.tsx): `frontend/src/components/views/PredictionsTrendsView.tsx`
- [Recommendations](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/components/views/RecommendationsView.tsx): `frontend/src/components/views/RecommendationsView.tsx`
- [Forecast State](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/contexts/ForecastContext.tsx): `frontend/src/contexts/ForecastContext.tsx`

### Data Services

- [API URL Client](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Backend API](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/server.ts): `backend/server.ts`
- [ARIMA XGBoost](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/models/arima_xgb_model.py): `backend/python/models/arima_xgb_model.py`
- [TSB XGBoost](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/models/tsb_xgb_model.py): `backend/python/models/tsb_xgb_model.py`
- [Demand Classifier](https://github.com/jeinciong/automotive-spare-parts-dss-thesis/blob/main/backend/python/utils/demand_classifier.py): `backend/python/utils/demand_classifier.py`

### Other components

- **Business User**

## Connections

- Business User → Sign In: signs in
- Sign In → Application Shell: authenticates into (evidence: `frontend/src/App.tsx`)
- Application Shell → Navigation: renders (evidence: `frontend/src/App.tsx`)
- Application Shell → Inventory State: provides state (evidence: `frontend/src/App.tsx`)
- Application Shell → Supplier State: provides state (evidence: `frontend/src/App.tsx`)
- Application Shell → Sales Report State: provides state (evidence: `frontend/src/App.tsx`)
- Application Shell → Forecast State: provides state (evidence: `frontend/src/App.tsx`)
- Application Shell → Notifications: provides state (evidence: `frontend/src/App.tsx`)
- Application Shell → Sales Reports View: renders (evidence: `frontend/src/App.tsx`)
- Application Shell → Forecast View: renders (evidence: `frontend/src/App.tsx`)
- Application Shell → Recommendations: renders (evidence: `frontend/src/App.tsx`)
- Application Shell → Inventory View: renders (evidence: `frontend/src/App.tsx`)
- Application Shell → Dashboard: renders (evidence: `frontend/src/App.tsx`)
- Sales Reports View → Sales Report State: uses reports (evidence: `frontend/src/components/views/SalesReportsView.tsx`)
- Inventory View → Inventory State: uses inventory (evidence: `frontend/src/components/views/InventoryView.tsx`)
- Inventory View → Supplier State: uses suppliers (evidence: `frontend/src/components/views/InventoryView.tsx`)
- Forecast View → Forecast State: uses forecasts (evidence: `frontend/src/components/views/PredictionsTrendsView.tsx`)
- Forecast State → Sales Report State: reads sales (evidence: `frontend/src/contexts/ForecastContext.tsx`)
- Sales Report State → Inventory State: uses inventory (evidence: `frontend/src/contexts/SalesReportsContext.tsx`)
- Inventory State → API URL Client: builds API requests (evidence: `frontend/src/contexts/InventoryContext.tsx`)
- Sales Report State → API URL Client: builds API requests (evidence: `frontend/src/contexts/SalesReportsContext.tsx`)
- Forecast State → API URL Client: builds API requests (evidence: `frontend/src/contexts/ForecastContext.tsx`)
- Supplier State → API URL Client: uses API URL (evidence: `frontend/src/contexts/SuppliersContext.tsx`)
- API URL Client → Backend API: targets API
- ARIMA XGBoost → ARIMA XGBoost: fits and forecasts (evidence: `backend/python/models/arima_xgb_model.py`)
- Demand Classifier → ARIMA XGBoost: classifies demand
