# adwaidhnair/newproject1 architecture

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

- Interactive diagram: https://gitdiagram.com/adwaidhnair/newproject1
- Repository: https://github.com/adwaidhnair/newproject1

## Overview

Northstar is a multi-tenant ERP operations intelligence platform. Users enter through the executive control tower, select an organization and location, and use API-backed views to inspect operational KPIs, exceptions, supplier/item risk, and process performance; they can also import purchase orders through a governed CSV workflow. The backend routes requests, enforces access, and delegates analytics to separate engines over canonical operational data. The README documents workflow configuration and industry profiles, but their implementation details were not sampled; those links are therefore omitted. Edges reflect shown imports or documented relationships.

Main entry points: [`backend/app/main.py`](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/main.py) (API and request routing), [`backend/app/models/erp_models.py`](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/models/erp_models.py) (Canonical ERP records), [`backend/app/connectors/csv_connector.py`](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/connectors/csv_connector.py) (Purchase order import), [`frontend/src/App.jsx`](https://github.com/adwaidhnair/newproject1/blob/main/frontend/src/App.jsx) (Executive control tower)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_control_tower["Executive control tower<br/>[App.jsx]"]
end

subgraph group_access["Access and API"]
  node_api["API and request routing<br/>[main.py]"]
  node_authentication["Authentication and access<br/>[auth.py]"]
  node_auth_records["Identity records<br/>[auth_models.py]"]
end

subgraph group_operations["Operational data"]
  node_database[("SQL database sessions<br/>[database.py]")]
  node_erp_records[("Canonical ERP records<br/>[erp_models.py]")]
  node_csv_import["Purchase order import<br/>[csv_connector.py]"]
end

subgraph group_intelligence["Operations intelligence"]
  node_kpis["Control tower KPIs<br/>[kpi_engine.py]"]
  node_rules["Business rule evaluation<br/>[rules_engine.py]"]
  node_risk["Vendor and item risk"]
  node_process_mining["Process mining and simulation"]
end

subgraph group_configuration["Tenant configuration"]
  node_tenant_profiles["Industry terminology profiles"]
  node_workflow_config["Workflow configuration<br/>[main.py]"]
  node_starter_data["Tenant seed scenarios<br/>[seed_data.py]"]
end

node_operator(("Business user"))

node_operator -->|"uses"| node_control_tower
node_control_tower -->|"calls API"| node_api
node_api -->|"returns results"| node_control_tower
node_api -->|"uses access checks"| node_authentication
node_authentication -->|"queries identity"| node_auth_records
node_api -->|"gets sessions"| node_database
node_auth_records -->|"uses database base"| node_database
node_erp_records -->|"uses database base"| node_database
node_api -->|"routes imports"| node_csv_import
node_csv_import -->|"triggers reevaluation"| node_rules
node_api -->|"calls"| node_kpis
node_api -->|"calls"| node_rules
node_api -->|"calls"| node_risk
node_api -->|"calls"| node_process_mining
node_kpis -->|"queries"| node_erp_records
node_rules -->|"evaluates records"| node_erp_records
node_risk -->|"scores records"| node_erp_records
node_process_mining -->|"analyzes records"| node_erp_records
node_csv_import -->|"upserts orders"| node_erp_records
node_api -->|"configures workflows"| node_workflow_config
node_starter_data -->|"seeds records"| node_erp_records

click node_control_tower "https://github.com/adwaidhnair/newproject1/blob/main/frontend/src/App.jsx"
click node_api "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/main.py"
click node_authentication "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/core/auth.py"
click node_auth_records "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/models/auth_models.py"
click node_database "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/core/database.py"
click node_erp_records "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/models/erp_models.py"
click node_csv_import "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/connectors/csv_connector.py"
click node_kpis "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/kpi_engine.py"
click node_rules "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/rules_engine.py"
click node_risk "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/intelligence_engine.py"
click node_process_mining "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/process_mining_engine.py"
click node_tenant_profiles "https://github.com/adwaidhnair/newproject1/tree/main/backend/app/profiles"
click node_workflow_config "https://github.com/adwaidhnair/newproject1/blob/main/backend/app/main.py"
click node_starter_data "https://github.com/adwaidhnair/newproject1/blob/main/backend/seed_data.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_control_tower,node_operator toneBlue
class node_api,node_authentication,node_auth_records toneAmber
class node_database,node_erp_records,node_csv_import toneMint
class node_kpis,node_rules,node_risk,node_process_mining toneRose
class node_tenant_profiles,node_workflow_config,node_starter_data toneIndigo
```

## Components

### User experience

- [Executive control tower](https://github.com/adwaidhnair/newproject1/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Access and API

- [API and request routing](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication and access](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/core/auth.py): `backend/app/core/auth.py`
- [Identity records](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/models/auth_models.py): `backend/app/models/auth_models.py`

### Operational data

- [SQL database sessions](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/core/database.py): `backend/app/core/database.py`
- [Canonical ERP records](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/models/erp_models.py): `backend/app/models/erp_models.py`
- [Purchase order import](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/connectors/csv_connector.py): `backend/app/connectors/csv_connector.py`

### Operations intelligence

- [Control tower KPIs](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/kpi_engine.py): `backend/app/engines/kpi_engine.py`
- [Business rule evaluation](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/rules_engine.py): `backend/app/engines/rules_engine.py`
- [Vendor and item risk](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/intelligence_engine.py): `backend/app/engines/intelligence_engine.py`
- [Process mining and simulation](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/engines/process_mining_engine.py): `backend/app/engines/process_mining_engine.py`

### Tenant configuration

- [Industry terminology profiles](https://github.com/adwaidhnair/newproject1/tree/main/backend/app/profiles): `backend/app/profiles`
- [Workflow configuration](https://github.com/adwaidhnair/newproject1/blob/main/backend/app/main.py): `backend/app/main.py`
- [Tenant seed scenarios](https://github.com/adwaidhnair/newproject1/blob/main/backend/seed_data.py): `backend/seed_data.py`

### Other components

- **Business user**

## Connections

- Business user → Executive control tower: uses (evidence: `README.md`)
- Executive control tower → API and request routing: calls API (evidence: `README.md`)
- API and request routing → Executive control tower: returns results (evidence: `README.md`)
- API and request routing → Authentication and access: uses access checks (evidence: `backend/app/main.py`)
- Authentication and access → Identity records: queries identity (evidence: `backend/app/core/auth.py`)
- API and request routing → SQL database sessions: gets sessions (evidence: `backend/app/main.py`)
- Identity records → SQL database sessions: uses database base (evidence: `backend/app/models/auth_models.py`)
- Canonical ERP records → SQL database sessions: uses database base (evidence: `backend/app/models/erp_models.py`)
- API and request routing → Purchase order import: routes imports (evidence: `backend/app/main.py`)
- Purchase order import → Business rule evaluation: triggers reevaluation (evidence: `README.md`)
- API and request routing → Control tower KPIs: calls (evidence: `backend/app/main.py`)
- API and request routing → Business rule evaluation: calls (evidence: `backend/app/main.py`)
- API and request routing → Vendor and item risk: calls (evidence: `backend/app/main.py`)
- API and request routing → Process mining and simulation: calls (evidence: `backend/app/main.py`)
- Control tower KPIs → Canonical ERP records: queries (evidence: `backend/app/engines/kpi_engine.py`)
- Business rule evaluation → Canonical ERP records: evaluates records (evidence: `backend/app/engines/rules_engine.py`)
- Vendor and item risk → Canonical ERP records: scores records (evidence: `backend/app/engines/intelligence_engine.py`)
- Process mining and simulation → Canonical ERP records: analyzes records (evidence: `backend/app/engines/process_mining_engine.py`)
- Purchase order import → Canonical ERP records: upserts orders (evidence: `backend/app/connectors/csv_connector.py`)
- API and request routing → Workflow configuration: configures workflows (evidence: `backend/app/main.py`)
- Tenant seed scenarios → Canonical ERP records: seeds records (evidence: `backend/seed_data.py`)
