# souptikkarar/kaveri-assignment-three architecture

> Architecture diagram of the GitHub repository souptikkarar/kaveri-assignment-three, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/souptikkarar/kaveri-assignment-three
- Repository: https://github.com/souptikkarar/kaveri-assignment-three

## Overview

Kaveri Infrasystems’ programs support a project-to-cash workflow: import a Primavera schedule into ClickUp, route purchase approvals, calculate and publish RA billing, forecast cash flow, then report project status and extract site-log delays with local AI. ClickUp is the shared operational data store; the bill engine is also reused by the forecast and PDF generator. The graph reflects documented program relationships and sampled API/model calls; some internal details of the unsampled programs are therefore shown only at their documented subsystem level.

Main entry points: [`bill_engine.py`](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/bill_engine.py) (RA Bill Engine), [`cashflow_forecaster.py`](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/cashflow_forecaster.py) (Cash Forecast), [`ollama_extraction.py`](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/ollama_extraction.py) (Delay Extraction), [`weekly_report.py`](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/weekly_report.py) (Weekly Report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_schedule["Schedule Management"]
  node_schedule_import["Schedule Import"]
end

subgraph group_commercial["Billing and Forecasting"]
  node_bill["RA Bill Engine<br/>[bill_engine.py]"]
  node_cashflow["Cash Forecast"]
  node_pdf["Bill PDF"]
end

subgraph group_approvals["Purchase Approvals"]
  node_approval["Approval Router<br/>[approval_router.py]"]
end

subgraph group_insights["AI and Reporting"]
  node_extraction["Delay Extraction"]
  node_weekly["Weekly Report<br/>[weekly_report.py]"]
end

node_operator(("Project Operator"))
node_xer["P6 Schedule"]
node_clickup[("ClickUp Workspace")]
node_ollama{{"Local Ollama"}}

node_operator -->|"runs import"| node_schedule_import
node_xer -->|"provides schedule"| node_schedule_import
node_schedule_import -->|"creates schedule"| node_clickup
node_operator -->|"runs router"| node_approval
node_approval -->|"routes requests"| node_clickup
node_operator -->|"runs billing"| node_bill
node_bill -->|"reads and writes"| node_clickup
node_operator -->|"runs forecast"| node_cashflow
node_cashflow -->|"reuses calculations"| node_bill
node_cashflow -->|"reads and writes"| node_clickup
node_operator -->|"runs generator"| node_pdf
node_pdf -->|"reuses bill calculation"| node_bill
node_operator -->|"runs extraction"| node_extraction
node_extraction -->|"reads logs and writes results"| node_clickup
node_extraction -->|"requests classification"| node_ollama
node_operator -->|"runs report"| node_weekly
node_weekly -->|"reads figures and publishes report"| node_clickup
node_weekly -->|"requests narrative"| node_ollama

click node_schedule_import "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/schedule_importer.py"
click node_bill "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/bill_engine.py"
click node_cashflow "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/cashflow_forecaster.py"
click node_pdf "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/generate_bill_pdf.py"
click node_approval "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/approval_router.py"
click node_extraction "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/ollama_extraction.py"
click node_weekly "https://github.com/souptikkarar/kaveri-assignment-three/blob/main/weekly_report.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_schedule_import toneBlue
class node_bill,node_cashflow,node_pdf,node_clickup toneAmber
class node_approval toneMint
class node_extraction,node_weekly toneRose
class node_operator,node_xer,node_ollama toneIndigo
```

## Components

### Schedule Management

- [Schedule Import](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/schedule_importer.py): `schedule_importer.py`

### Billing and Forecasting

- [RA Bill Engine](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/bill_engine.py): `bill_engine.py`
- [Cash Forecast](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/cashflow_forecaster.py): `cashflow_forecaster.py`
- [Bill PDF](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/generate_bill_pdf.py): `generate_bill_pdf.py`

### Purchase Approvals

- [Approval Router](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/approval_router.py): `approval_router.py`

### AI and Reporting

- [Delay Extraction](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/ollama_extraction.py): `ollama_extraction.py`
- [Weekly Report](https://github.com/souptikkarar/kaveri-assignment-three/blob/main/weekly_report.py): `weekly_report.py`

### Other components

- **Project Operator**
- **P6 Schedule**
- **ClickUp Workspace**
- **Local Ollama**

## Connections

- Project Operator → Schedule Import: runs import (evidence: `README.md`)
- P6 Schedule → Schedule Import: provides schedule (evidence: `README.md`)
- Schedule Import → ClickUp Workspace: creates schedule (evidence: `schedule_importer.py`)
- Project Operator → Approval Router: runs router (evidence: `README.md`)
- Approval Router → ClickUp Workspace: routes requests (evidence: `approval_router.py`)
- Project Operator → RA Bill Engine: runs billing (evidence: `README.md`)
- RA Bill Engine → ClickUp Workspace: reads and writes (evidence: `README.md`)
- Project Operator → Cash Forecast: runs forecast (evidence: `README.md`)
- Cash Forecast → RA Bill Engine: reuses calculations (evidence: `cashflow_forecaster.py`)
- Cash Forecast → ClickUp Workspace: reads and writes (evidence: `README.md`)
- Project Operator → Bill PDF: runs generator (evidence: `README.md`)
- Bill PDF → RA Bill Engine: reuses bill calculation (evidence: `generate_bill_pdf.py`)
- Project Operator → Delay Extraction: runs extraction (evidence: `README.md`)
- Delay Extraction → ClickUp Workspace: reads logs and writes results (evidence: `ollama_extraction.py`)
- Delay Extraction → Local Ollama: requests classification (evidence: `ollama_extraction.py`)
- Project Operator → Weekly Report: runs report (evidence: `README.md`)
- Weekly Report → ClickUp Workspace: reads figures and publishes report (evidence: `weekly_report.py`)
- Weekly Report → Local Ollama: requests narrative (evidence: `weekly_report.py`)
