# silashezekiahcarzoncics-hash/capstone_deployment architecture

> Architecture diagram of the GitHub repository silashezekiahcarzoncics-hash/capstone_deployment, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/silashezekiahcarzoncics-hash/capstone_deployment
- Repository: https://github.com/silashezekiahcarzoncics-hash/capstone_deployment

## Overview

This is a sales analytics dashboard for Shopee transaction data. Users upload and prepare sales records, publish or synchronize prepared data, then explore descriptive performance, forecasts, and prescriptive recommendations with geographic and category filters. The frontend routes those workflows through shared analytics requests to an Express API; server-side analytics and forecasting produce the results. The excerpts establish several internal calls, but do not expose the complete route handlers or preparation internals, so those connections are left unverified rather than inferred.

Main entry points: [`server/server.js`](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/server.js) (API server), [`src/App.jsx`](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/App.jsx) (Application router), [`src/data/analyticsApi.js`](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/data/analyticsApi.js) (Analytics API client), [`server/forecasting.js`](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/forecasting.js) (Forecast engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard workflows"]
  node_app["Application router<br/>[App.jsx]"]
  node_data_management["Data management<br/>[DataManagement.jsx]"]
  node_data_preparation["Data preparation"]
  node_analysis_controls["Analysis controls"]
  node_descriptive["Descriptive analytics"]
  node_predictive["Predictive analytics"]
  node_prescriptive["Prescriptive analytics"]
  node_executive["Executive overview"]
  node_scatter["Forecast scatter chart"]
end

subgraph group_ingest["Data preparation"]
  node_preparation["Preparation engine<br/>[preparation.js]"]
  node_live_preparation["Live preparation<br/>[livePreparation.js]"]
  node_staging["Staging synchronization<br/>[stagingSync.js]"]
  node_etl["ETL run tracking<br/>[etlRun.js]"]
end

subgraph group_analysis["Analytics services"]
  node_server["API server<br/>[server.js]"]
  node_analytics_engine["Analytics engine<br/>[analytics.js]"]
  node_server_geo["Server geographic scope<br/>[geographicScope.js]"]
  node_snapshot_cache["Snapshot memo<br/>[snapshotMemo.js]"]
  node_transaction_index["Transaction index"]
end

subgraph group_forecast["Forecasting and advice"]
  node_forecast_engine["Forecast engine<br/>[forecasting.js]"]
  node_prescriptive_evidence["Prescriptive evidence"]
  node_comparisons["Forecast comparisons"]
end

subgraph group_shared["Shared request and scope"]
  node_hook["Analytics hook<br/>[useAnalytics.js]"]
  node_api_client["Analytics API client<br/>[analyticsApi.js]"]
  node_geo_scope["Geographic scope<br/>[geographicScope.js]"]
  node_forecast_settings["Forecast settings"]
  node_accuracy["Forecast accuracy"]
  node_scatter_math["Scatter calculations<br/>[forecastScatter.js]"]
  node_formatters["Number formatters<br/>[formatters.js]"]
end

node_user(("Dashboard user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_data_management
node_app -->|"routes to"| node_data_preparation
node_app -->|"routes to"| node_analysis_controls
node_app -->|"routes to"| node_descriptive
node_app -->|"routes to"| node_predictive
node_app -->|"routes to"| node_prescriptive
node_app -->|"routes to"| node_executive
node_data_preparation -.->|"submits data"| node_preparation
node_server -->|"calls"| node_preparation
node_server -->|"invalidates"| node_live_preparation
node_server -->|"downloads snapshot"| node_staging
node_server -->|"starts run"| node_etl
node_server -.->|"routes analytics"| node_analytics_engine
node_server -.->|"routes forecasts"| node_forecast_engine
node_server -.->|"routes comparisons"| node_comparisons
node_server -->|"normalizes scope"| node_server_geo
node_analytics_engine -->|"uses"| node_server_geo
node_analytics_engine -->|"uses"| node_snapshot_cache
node_analytics_engine -->|"uses"| node_transaction_index
node_forecast_engine -->|"uses"| node_analytics_engine
node_forecast_engine -->|"uses"| node_server_geo
node_forecast_engine -->|"uses"| node_snapshot_cache
node_forecast_engine -->|"uses"| node_prescriptive_evidence
node_hook -->|"fetches data"| node_api_client
node_descriptive -.->|"requests analytics"| node_hook
node_predictive -.->|"requests forecasts"| node_api_client
node_prescriptive -.->|"requests advice"| node_api_client
node_executive -.->|"requests comparisons"| node_api_client
node_api_client -.->|"HTTP requests"| node_server
node_api_client -->|"normalizes filters"| node_geo_scope
node_api_client -->|"uses target"| node_forecast_settings
node_predictive -->|"renders chart"| node_scatter
node_scatter -->|"calculates insights"| node_scatter_math
node_scatter -->|"uses accuracy"| node_accuracy
node_scatter_math -->|"uses"| node_accuracy
node_accuracy -->|"formats values"| node_formatters

click node_app "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/App.jsx"
click node_data_management "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DataManagement.jsx"
click node_data_preparation "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DataPreparation.jsx"
click node_analysis_controls "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/AnalysisControls.jsx"
click node_descriptive "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DescriptiveAnalytics.jsx"
click node_predictive "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/PredictiveAnalytics.jsx"
click node_prescriptive "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/PrescriptiveAnalytics.jsx"
click node_executive "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/ExecutiveOverview.jsx"
click node_scatter "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/components/ForecastScatterChart.jsx"
click node_server "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/server.js"
click node_preparation "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/preparation.js"
click node_live_preparation "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/livePreparation.js"
click node_staging "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/stagingSync.js"
click node_etl "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/etlRun.js"
click node_analytics_engine "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/analytics.js"
click node_server_geo "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/geographicScope.js"
click node_forecast_engine "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/forecasting.js"
click node_prescriptive_evidence "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/prescriptiveEvidence.js"
click node_comparisons "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/forecastComparisons.js"
click node_hook "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/hooks/useAnalytics.js"
click node_api_client "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/data/analyticsApi.js"
click node_geo_scope "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/geographicScope.js"
click node_forecast_settings "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/data/forecastSettings.js"
click node_accuracy "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/forecastAccuracy.js"
click node_scatter_math "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/forecastScatter.js"
click node_formatters "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/formatters.js"
click node_snapshot_cache "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/cache/snapshotMemo.js"
click node_transaction_index "https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/cache/transactionIndex.js"

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_data_management,node_data_preparation,node_analysis_controls,node_descriptive,node_predictive,node_prescriptive,node_executive,node_scatter,node_user toneBlue
class node_preparation,node_live_preparation,node_staging,node_etl toneAmber
class node_server,node_analytics_engine,node_server_geo,node_snapshot_cache,node_transaction_index toneMint
class node_forecast_engine,node_prescriptive_evidence,node_comparisons toneRose
class node_hook,node_api_client,node_geo_scope,node_forecast_settings,node_accuracy,node_scatter_math,node_formatters toneIndigo
```

## Components

### Dashboard workflows

- [Application router](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/App.jsx): `src/App.jsx`
- [Data management](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DataManagement.jsx): `src/pages/DataManagement.jsx`
- [Data preparation](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DataPreparation.jsx): `src/pages/DataPreparation.jsx`
- [Analysis controls](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/AnalysisControls.jsx): `src/pages/AnalysisControls.jsx`
- [Descriptive analytics](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/DescriptiveAnalytics.jsx): `src/pages/DescriptiveAnalytics.jsx`
- [Predictive analytics](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/PredictiveAnalytics.jsx): `src/pages/PredictiveAnalytics.jsx`
- [Prescriptive analytics](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/PrescriptiveAnalytics.jsx): `src/pages/PrescriptiveAnalytics.jsx`
- [Executive overview](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/pages/ExecutiveOverview.jsx): `src/pages/ExecutiveOverview.jsx`
- [Forecast scatter chart](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/components/ForecastScatterChart.jsx): `src/components/ForecastScatterChart.jsx`

### Data preparation

- [Preparation engine](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/preparation.js): `server/preparation.js`
- [Live preparation](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/livePreparation.js): `server/livePreparation.js`
- [Staging synchronization](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/stagingSync.js): `server/stagingSync.js`
- [ETL run tracking](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/etlRun.js): `server/etlRun.js`

### Analytics services

- [API server](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/server.js): `server/server.js`
- [Analytics engine](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/analytics.js): `server/analytics.js`
- [Server geographic scope](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/geographicScope.js): `server/geographicScope.js`
- [Snapshot memo](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/cache/snapshotMemo.js): `server/cache/snapshotMemo.js`
- [Transaction index](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/cache/transactionIndex.js): `server/cache/transactionIndex.js`

### Forecasting and advice

- [Forecast engine](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/forecasting.js): `server/forecasting.js`
- [Prescriptive evidence](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/prescriptiveEvidence.js): `server/prescriptiveEvidence.js`
- [Forecast comparisons](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/server/forecastComparisons.js): `server/forecastComparisons.js`

### Shared request and scope

- [Analytics hook](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/hooks/useAnalytics.js): `src/hooks/useAnalytics.js`
- [Analytics API client](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/data/analyticsApi.js): `src/data/analyticsApi.js`
- [Geographic scope](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/geographicScope.js): `src/utils/geographicScope.js`
- [Forecast settings](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/data/forecastSettings.js): `src/data/forecastSettings.js`
- [Forecast accuracy](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/forecastAccuracy.js): `src/utils/forecastAccuracy.js`
- [Scatter calculations](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/forecastScatter.js): `src/utils/forecastScatter.js`
- [Number formatters](https://github.com/silashezekiahcarzoncics-hash/capstone_deployment/blob/main/src/utils/formatters.js): `src/utils/formatters.js`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Application router: uses (evidence: `src/App.jsx`)
- Application router → Data management: routes to (evidence: `src/App.jsx`)
- Application router → Data preparation: routes to (evidence: `src/App.jsx`)
- Application router → Analysis controls: routes to (evidence: `src/App.jsx`)
- Application router → Descriptive analytics: routes to (evidence: `src/App.jsx`)
- Application router → Predictive analytics: routes to (evidence: `src/App.jsx`)
- Application router → Prescriptive analytics: routes to (evidence: `src/App.jsx`)
- Application router → Executive overview: routes to (evidence: `src/App.jsx`)
- Data preparation → Preparation engine: submits data
- API server → Preparation engine: calls (evidence: `server/server.js`)
- API server → Live preparation: invalidates (evidence: `server/server.js`)
- API server → Staging synchronization: downloads snapshot (evidence: `server/server.js`)
- API server → ETL run tracking: starts run (evidence: `server/server.js`)
- API server → Analytics engine: routes analytics (evidence: `server/server.js`)
- API server → Forecast engine: routes forecasts (evidence: `server/server.js`)
- API server → Forecast comparisons: routes comparisons (evidence: `server/server.js`)
- API server → Server geographic scope: normalizes scope (evidence: `server/server.js`)
- Analytics engine → Server geographic scope: uses (evidence: `server/analytics.js`)
- Analytics engine → Snapshot memo: uses (evidence: `server/analytics.js`)
- Analytics engine → Transaction index: uses (evidence: `server/analytics.js`)
- Forecast engine → Analytics engine: uses (evidence: `server/forecasting.js`)
- Forecast engine → Server geographic scope: uses (evidence: `server/forecasting.js`)
- Forecast engine → Snapshot memo: uses (evidence: `server/forecasting.js`)
- Forecast engine → Prescriptive evidence: uses (evidence: `server/forecasting.js`)
- Analytics hook → Analytics API client: fetches data (evidence: `src/hooks/useAnalytics.js`)
- Descriptive analytics → Analytics hook: requests analytics (evidence: `src/pages/DescriptiveAnalytics.jsx`)
- Predictive analytics → Analytics API client: requests forecasts (evidence: `src/pages/PredictiveAnalytics.jsx`)
- Prescriptive analytics → Analytics API client: requests advice (evidence: `src/pages/PrescriptiveAnalytics.jsx`)
- Executive overview → Analytics API client: requests comparisons (evidence: `src/pages/ExecutiveOverview.jsx`)
- Analytics API client → API server: HTTP requests
- Analytics API client → Geographic scope: normalizes filters (evidence: `src/data/analyticsApi.js`)
- Analytics API client → Forecast settings: uses target (evidence: `src/data/analyticsApi.js`)
- Predictive analytics → Forecast scatter chart: renders chart (evidence: `src/pages/PredictiveAnalytics.jsx`)
- Forecast scatter chart → Scatter calculations: calculates insights (evidence: `src/components/ForecastScatterChart.jsx`)
- Forecast scatter chart → Forecast accuracy: uses accuracy (evidence: `src/components/ForecastScatterChart.jsx`)
- Scatter calculations → Forecast accuracy: uses (evidence: `src/utils/forecastScatter.js`)
- Forecast accuracy → Number formatters: formats values (evidence: `src/utils/forecastAccuracy.js`)
