# karthik0747/supplysync-ai architecture

> Architecture diagram of the GitHub repository karthik0747/supplysync-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/karthik0747/supplysync-ai
- Repository: https://github.com/karthik0747/supplysync-ai

## Overview

SupplySync AI is a supplier-acknowledgement and supply-impact governance platform. Planners use its web console to manage purchase orders, reconcile supplier acknowledgements, review threshold-triggered change requests, and assess downstream inventory and production risks; analytics, simulation, and audit exports provide supporting views. The graph preserves the documented capabilities, including data generation and anomaly monitoring. Some subsystem links are documented in the README rather than verified from sampled implementation, so those edges cite the README; unsampled implementation details are not inferred.

Main entry points: [`backend/app.py`](https://github.com/karthik0747/supplysync-ai/blob/master/backend/app.py) (Flask App), [`backend/models.py`](https://github.com/karthik0747/supplysync-ai/blob/master/backend/models.py) (Supply Chain Entities), [`backend/services/workflow.py`](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/workflow.py) (Reconciliation Workflow), [`backend/database.py`](https://github.com/karthik0747/supplysync-ai/blob/master/backend/database.py) (Database Sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web Console"]
  node_console["SupplySync Console"]
  node_browser_api["Browser API Client<br/>[api.js]"]
end

subgraph group_api["REST Application"]
  node_app["Flask App<br/>[app.py]"]
  node_purchase["Purchase Orders<br/>[purchase_orders.py]"]
  node_ack["Acknowledgements"]
  node_changes["Change Requests<br/>[change_requests.py]"]
  node_impacts["Impacts and Alerts<br/>[impacts.py]"]
  node_dashboard["Dashboard Data<br/>[dashboard.py]"]
  node_health["Health Checks<br/>[health.py]"]
end

subgraph group_governance["Governance Services"]
  node_rules["Variance Rules<br/>[rules.py]"]
  node_workflow["Reconciliation Workflow<br/>[workflow.py]"]
  node_simulator_route["Simulation API<br/>[simulator.py]"]
  node_simulator["What-If Simulator<br/>[simulator.py]"]
end

subgraph group_insight["Analytics and Audit"]
  node_analytics_route["Analytics API<br/>[analytics.py]"]
  node_analytics["Supplier Analytics<br/>[analytics.py]"]
  node_timeline["PO Audit Timeline<br/>[timeline.py]"]
  node_reports_route["CSV Reports API<br/>[reports.py]"]
  node_reports["Report Generation<br/>[reports.py]"]
end

subgraph group_persistence["Data and Generation"]
  node_database["Database Sessions<br/>[database.py]"]
  node_models["Supply Chain Entities<br/>[models.py]"]
  node_sqlite[("SQLite Store<br/>[seed.sql]")]
  node_generator["Synthetic Data Generator<br/>[generate.py]"]
end

node_planner(("Supply Planner"))

node_planner -->|"uses"| node_console
node_console -->|"requests through"| node_browser_api
node_browser_api -->|"calls REST"| node_app
node_app -->|"registers"| node_purchase
node_app -->|"registers"| node_ack
node_app -->|"registers"| node_changes
node_app -->|"registers"| node_impacts
node_app -->|"registers"| node_dashboard
node_app -->|"registers"| node_health
node_app -->|"registers"| node_analytics_route
node_app -->|"registers"| node_simulator_route
node_app -->|"registers"| node_reports_route
node_app -->|"initializes"| node_database
node_purchase -->|"gets session"| node_database
node_purchase -->|"builds timeline"| node_timeline
node_ack -->|"submits acknowledgement"| node_workflow
node_changes -->|"applies decision"| node_workflow
node_simulator_route -->|"runs scenario"| node_simulator
node_analytics_route -->|"serves metrics"| node_analytics
node_reports_route -->|"generates exports"| node_reports
node_workflow -->|"evaluates variances"| node_rules
node_simulator -->|"uses thresholds"| node_rules
node_workflow -->|"updates entities"| node_models
node_simulator -->|"queries commitments"| node_models
node_analytics -->|"queries metrics"| node_models
node_reports -->|"uses metrics"| node_analytics
node_timeline -->|"reads history"| node_models
node_database -->|"registers tables"| node_models
node_database -.->|"persists records"| node_sqlite
node_generator -->|"creates data"| node_models
node_generator -->|"validates rules"| node_rules

click node_console "https://github.com/karthik0747/supplysync-ai/tree/master/frontend"
click node_browser_api "https://github.com/karthik0747/supplysync-ai/blob/master/frontend/js/api.js"
click node_app "https://github.com/karthik0747/supplysync-ai/blob/master/backend/app.py"
click node_purchase "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/purchase_orders.py"
click node_ack "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/acknowledgements.py"
click node_changes "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/change_requests.py"
click node_impacts "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/impacts.py"
click node_dashboard "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/dashboard.py"
click node_health "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/health.py"
click node_rules "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/rules.py"
click node_workflow "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/workflow.py"
click node_simulator_route "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/simulator.py"
click node_simulator "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/simulator.py"
click node_analytics_route "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/analytics.py"
click node_analytics "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/analytics.py"
click node_timeline "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/timeline.py"
click node_reports_route "https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/reports.py"
click node_reports "https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/reports.py"
click node_database "https://github.com/karthik0747/supplysync-ai/blob/master/backend/database.py"
click node_models "https://github.com/karthik0747/supplysync-ai/blob/master/backend/models.py"
click node_sqlite "https://github.com/karthik0747/supplysync-ai/blob/master/data/full/seed.sql"
click node_generator "https://github.com/karthik0747/supplysync-ai/blob/master/backend/generator/generate.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_console,node_browser_api toneBlue
class node_app,node_purchase,node_ack,node_changes,node_impacts,node_dashboard,node_health toneAmber
class node_rules,node_workflow,node_simulator_route,node_simulator toneMint
class node_analytics_route,node_analytics,node_timeline,node_reports_route,node_reports toneRose
class node_database,node_models,node_sqlite,node_generator,node_planner toneIndigo
```

## Components

### Web Console

- [SupplySync Console](https://github.com/karthik0747/supplysync-ai/tree/master/frontend): `frontend`
- [Browser API Client](https://github.com/karthik0747/supplysync-ai/blob/master/frontend/js/api.js): `frontend/js/api.js`

### REST Application

- [Flask App](https://github.com/karthik0747/supplysync-ai/blob/master/backend/app.py): `backend/app.py`
- [Purchase Orders](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/purchase_orders.py): `backend/routes/purchase_orders.py`
- [Acknowledgements](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/acknowledgements.py): `backend/routes/acknowledgements.py`
- [Change Requests](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/change_requests.py): `backend/routes/change_requests.py`
- [Impacts and Alerts](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/impacts.py): `backend/routes/impacts.py`
- [Dashboard Data](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/dashboard.py): `backend/routes/dashboard.py`
- [Health Checks](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/health.py): `backend/routes/health.py`

### Governance Services

- [Variance Rules](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/rules.py): `backend/services/rules.py`
- [Reconciliation Workflow](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/workflow.py): `backend/services/workflow.py`
- [Simulation API](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/simulator.py): `backend/routes/simulator.py`
- [What-If Simulator](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/simulator.py): `backend/services/simulator.py`

### Analytics and Audit

- [Analytics API](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/analytics.py): `backend/routes/analytics.py`
- [Supplier Analytics](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/analytics.py): `backend/services/analytics.py`
- [PO Audit Timeline](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/timeline.py): `backend/services/timeline.py`
- [CSV Reports API](https://github.com/karthik0747/supplysync-ai/blob/master/backend/routes/reports.py): `backend/routes/reports.py`
- [Report Generation](https://github.com/karthik0747/supplysync-ai/blob/master/backend/services/reports.py): `backend/services/reports.py`

### Data and Generation

- [Database Sessions](https://github.com/karthik0747/supplysync-ai/blob/master/backend/database.py): `backend/database.py`
- [Supply Chain Entities](https://github.com/karthik0747/supplysync-ai/blob/master/backend/models.py): `backend/models.py`
- [SQLite Store](https://github.com/karthik0747/supplysync-ai/blob/master/data/full/seed.sql): `data/full/seed.sql`
- [Synthetic Data Generator](https://github.com/karthik0747/supplysync-ai/blob/master/backend/generator/generate.py): `backend/generator/generate.py`

### Other components

- **Supply Planner**

## Connections

- Supply Planner → SupplySync Console: uses (evidence: `README.md`)
- SupplySync Console → Browser API Client: requests through (evidence: `README.md`)
- Browser API Client → Flask App: calls REST (evidence: `README.md`)
- Flask App → Purchase Orders: registers (evidence: `backend/app.py`)
- Flask App → Acknowledgements: registers (evidence: `backend/app.py`)
- Flask App → Change Requests: registers (evidence: `backend/app.py`)
- Flask App → Impacts and Alerts: registers (evidence: `backend/app.py`)
- Flask App → Dashboard Data: registers (evidence: `backend/app.py`)
- Flask App → Health Checks: registers (evidence: `backend/app.py`)
- Flask App → Analytics API: registers (evidence: `backend/app.py`)
- Flask App → Simulation API: registers (evidence: `backend/app.py`)
- Flask App → CSV Reports API: registers (evidence: `backend/app.py`)
- Flask App → Database Sessions: initializes (evidence: `backend/app.py`)
- Purchase Orders → Database Sessions: gets session (evidence: `backend/routes/purchase_orders.py`)
- Purchase Orders → PO Audit Timeline: builds timeline (evidence: `backend/routes/purchase_orders.py`)
- Acknowledgements → Reconciliation Workflow: submits acknowledgement (evidence: `backend/routes/acknowledgements.py`)
- Change Requests → Reconciliation Workflow: applies decision (evidence: `backend/routes/change_requests.py`)
- Simulation API → What-If Simulator: runs scenario (evidence: `README.md`)
- Analytics API → Supplier Analytics: serves metrics (evidence: `backend/routes/analytics.py`)
- CSV Reports API → Report Generation: generates exports (evidence: `backend/routes/reports.py`)
- Reconciliation Workflow → Variance Rules: evaluates variances (evidence: `backend/services/workflow.py`)
- What-If Simulator → Variance Rules: uses thresholds (evidence: `backend/services/simulator.py`)
- Reconciliation Workflow → Supply Chain Entities: updates entities (evidence: `backend/services/workflow.py`)
- What-If Simulator → Supply Chain Entities: queries commitments (evidence: `backend/services/simulator.py`)
- Supplier Analytics → Supply Chain Entities: queries metrics (evidence: `backend/services/analytics.py`)
- Report Generation → Supplier Analytics: uses metrics (evidence: `backend/services/reports.py`)
- PO Audit Timeline → Supply Chain Entities: reads history (evidence: `backend/services/timeline.py`)
- Database Sessions → Supply Chain Entities: registers tables (evidence: `backend/database.py`)
- Database Sessions → SQLite Store: persists records (evidence: `README.md`)
- Synthetic Data Generator → Supply Chain Entities: creates data (evidence: `backend/generator/generate.py`)
- Synthetic Data Generator → Variance Rules: validates rules (evidence: `backend/generator/generate.py`)
