# chiragjaju13/ncs-bot-project architecture

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

- Interactive diagram: https://gitdiagram.com/chiragjaju13/ncs-bot-project
- Repository: https://github.com/chiragjaju13/ncs-bot-project

## Overview

NCS Bot checks two Maharashtra tender sources, classifies matching tenders by region, detects new or changed deadlines, and sends alerts. Its main runtime and domain logic are concentrated in main.py; force_check.py provides a manual entry point, while the documented GitHub Actions workflow schedules runs. The excerpts show key MSEDCL, notification, and orchestration behavior; some MahaTenders and archive details are supported by the README, so those links cite the documentation.

Main entry points: [`main.py`](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py) (Check-and-send job), [`force_check.py`](https://github.com/chiragjaju13/ncs-bot-project/blob/main/force_check.py) (Manual check), [`.github/workflows/run_bot.yml`](https://github.com/chiragjaju13/ncs-bot-project/blob/main/.github/workflows/run_bot.yml) (GitHub Actions schedule), [`tender_archive.json`](https://github.com/chiragjaju13/ncs-bot-project/blob/main/tender_archive.json) (Tender archive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sources["Tender sources"]
  node_msedcl["MSEDCL scraper<br/>[main.py]"]
  node_mahatenders["MahaTenders scraper<br/>[main.py]"]
  node_msedcl_portal["MSEDCL tender API"]
  node_maha_portal["MahaTenders portal"]
end

subgraph group_processing["Tender processing"]
  node_region_match["District and taluka matching<br/>[main.py]"]
  node_dedupe["Change detection<br/>[main.py]"]
  node_archive[("Tender archive")]
end

subgraph group_delivery["Alert delivery"]
  node_message_format["Tender message formatting<br/>[main.py]"]
  node_telegram["Telegram"]
  node_whatsapp["WhatsApp"]
end

subgraph group_runtime["Run and state"]
  node_schedule["GitHub Actions schedule<br/>[run_bot.yml]"]
  node_manual["Manual check<br/>[force_check.py]"]
  node_runtime_entry["Runtime entry<br/>[main.py]"]
  node_orchestrator["Check-and-send job<br/>[main.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_manual
node_manual -->|"calls"| node_orchestrator
node_schedule -->|"runs"| node_runtime_entry
node_runtime_entry -->|"calls"| node_orchestrator
node_orchestrator -->|"checks"| node_msedcl
node_orchestrator -->|"checks"| node_mahatenders
node_msedcl -->|"requests data"| node_msedcl_portal
node_mahatenders -->|"searches and fetches"| node_maha_portal
node_msedcl -->|"matches region"| node_region_match
node_mahatenders -->|"classifies region"| node_region_match
node_orchestrator -->|"loads and updates"| node_archive
node_msedcl -->|"checks date changes"| node_dedupe
node_mahatenders -->|"checks date changes"| node_dedupe
node_orchestrator -->|"groups alerts"| node_message_format
node_orchestrator -->|"sends alerts"| node_telegram
node_orchestrator -->|"sends alerts"| node_whatsapp

click node_schedule "https://github.com/chiragjaju13/ncs-bot-project/blob/main/.github/workflows/run_bot.yml"
click node_manual "https://github.com/chiragjaju13/ncs-bot-project/blob/main/force_check.py"
click node_runtime_entry "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_orchestrator "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_msedcl "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_mahatenders "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_region_match "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_dedupe "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py"
click node_archive "https://github.com/chiragjaju13/ncs-bot-project/blob/main/tender_archive.json"
click node_message_format "https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.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_msedcl,node_mahatenders,node_msedcl_portal,node_maha_portal toneBlue
class node_region_match,node_dedupe,node_archive toneAmber
class node_message_format,node_telegram,node_whatsapp toneMint
class node_schedule,node_manual,node_runtime_entry,node_orchestrator toneRose
class node_operator toneIndigo
```

## Components

### Tender sources

- [MSEDCL scraper](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- [MahaTenders scraper](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- **MSEDCL tender API**
- **MahaTenders portal**

### Tender processing

- [District and taluka matching](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- [Change detection](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- [Tender archive](https://github.com/chiragjaju13/ncs-bot-project/blob/main/tender_archive.json): `tender_archive.json`

### Alert delivery

- [Tender message formatting](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- **Telegram**
- **WhatsApp**

### Run and state

- [GitHub Actions schedule](https://github.com/chiragjaju13/ncs-bot-project/blob/main/.github/workflows/run_bot.yml): `.github/workflows/run_bot.yml`
- [Manual check](https://github.com/chiragjaju13/ncs-bot-project/blob/main/force_check.py): `force_check.py`
- [Runtime entry](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`
- [Check-and-send job](https://github.com/chiragjaju13/ncs-bot-project/blob/main/main.py): `main.py`

### Other components

- **Operator**

## Connections

- Operator → Manual check: starts (evidence: `README.md`)
- Manual check → Check-and-send job: calls (evidence: `force_check.py`)
- GitHub Actions schedule → Runtime entry: runs (evidence: `README.md`)
- Runtime entry → Check-and-send job: calls (evidence: `main.py`)
- Check-and-send job → MSEDCL scraper: checks (evidence: `main.py`)
- Check-and-send job → MahaTenders scraper: checks (evidence: `README.md`)
- MSEDCL scraper → MSEDCL tender API: requests data (evidence: `main.py`)
- MahaTenders scraper → MahaTenders portal: searches and fetches (evidence: `README.md`)
- MSEDCL scraper → District and taluka matching: matches region (evidence: `main.py`)
- MahaTenders scraper → District and taluka matching: classifies region (evidence: `README.md`)
- Check-and-send job → Tender archive: loads and updates (evidence: `README.md`)
- MSEDCL scraper → Change detection: checks date changes (evidence: `main.py`)
- MahaTenders scraper → Change detection: checks date changes (evidence: `README.md`)
- Check-and-send job → Tender message formatting: groups alerts (evidence: `main.py`)
- Check-and-send job → Telegram: sends alerts (evidence: `main.py`)
- Check-and-send job → WhatsApp: sends alerts (evidence: `main.py`)
