# aysarali88/warehouse-project architecture

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

- Interactive diagram: https://gitdiagram.com/aysarali88/warehouse-project
- Repository: https://github.com/aysarali88/warehouse-project

## Overview

FTTH Rollout is a FastAPI application for tracking field rollout progress and managing warehouse and site inventory. Users enter daily rollout records in the browser dashboard; the app exposes APIs and persists application data in SQLite or PostgreSQL. Its documented capabilities also include warehouse stock operations, while the repository contains dedicated site-inventory and approval-based site-transfer subsystems. The graph reflects README statements and shown excerpts; several routes and UI areas are represented by their source paths without asserting unsampled call relationships.

Main entry points: [`site_transfer_service.py`](https://github.com/aysarali88/warehouse-project/blob/main/site_transfer_service.py) (Transfer workflow), [`site_inventory_service.py`](https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_service.py) (Inventory ledger), [`database.py`](https://github.com/aysarali88/warehouse-project/blob/main/database.py) (Database setup), [`site_inventory_api.py`](https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_api.py) (Site inventory API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rollout["Rollout tracking"]
  node_dashboard["Rollout dashboard<br/>[ftth_rollout.html]"]
  node_app["FastAPI application<br/>[main.py]"]
  node_rollout_records["Rollout records<br/>[main.py]"]
  node_apps_script_dashboard["Rollout dashboard<br/>[Code.gs]"]
end

subgraph group_storage["Persistence"]
  node_db_config["Database setup<br/>[database.py]"]
  node_data_models["Application models<br/>[models.py]"]
end

subgraph group_inventory["Site inventory"]
  node_inventory_ui["Materials inventory UI"]
  node_inventory_api["Site inventory API"]
  node_inventory_rules["Inventory configuration"]
  node_inventory_ledger["Inventory ledger"]
end

subgraph group_transfers["Site transfers"]
  node_transfer_ui["Transfer interface"]
  node_transfer_api["Transfer API"]
  node_transfer_flow["Transfer workflow"]
end

subgraph group_integrations["External data"]
  node_survey_reader["Survey reader"]
end

node_user(("Staff user"))
node_survey_db[("Site Survey database")]

node_user -->|"enters progress"| node_dashboard
node_dashboard -->|"loads dashboard"| node_app
node_user -->|"submits records"| node_app
node_app -->|"handles records"| node_rollout_records
node_rollout_records -->|"stores records"| node_db_config
node_data_models -->|"uses base"| node_db_config
node_inventory_ui -.->|"uses inventory"| node_inventory_api
node_inventory_api -->|"calls services"| node_inventory_ledger
node_inventory_api -->|"checks gates"| node_inventory_rules
node_inventory_ledger -->|"uses sessions"| node_db_config
node_inventory_ledger -->|"queries models"| node_data_models
node_transfer_ui -->|"sends requests"| node_transfer_api
node_transfer_api -->|"calls workflow"| node_transfer_flow
node_transfer_api -->|"checks gates"| node_inventory_rules
node_transfer_flow -->|"uses inventory logic"| node_inventory_ledger
node_transfer_flow -->|"uses sessions"| node_db_config
node_transfer_flow -->|"queries models"| node_data_models
node_survey_reader -->|"reads pole counts"| node_survey_db

click node_dashboard "https://github.com/aysarali88/warehouse-project/blob/main/static/ftth_rollout.html"
click node_app "https://github.com/aysarali88/warehouse-project/blob/main/main.py"
click node_rollout_records "https://github.com/aysarali88/warehouse-project/blob/main/main.py"
click node_db_config "https://github.com/aysarali88/warehouse-project/blob/main/database.py"
click node_data_models "https://github.com/aysarali88/warehouse-project/blob/main/models.py"
click node_inventory_ui "https://github.com/aysarali88/warehouse-project/blob/main/static/materials_inventory.html"
click node_inventory_api "https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_api.py"
click node_inventory_rules "https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_config.py"
click node_inventory_ledger "https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_service.py"
click node_transfer_ui "https://github.com/aysarali88/warehouse-project/blob/main/static/site_transfer_ui.js"
click node_transfer_api "https://github.com/aysarali88/warehouse-project/blob/main/site_transfer_api.py"
click node_transfer_flow "https://github.com/aysarali88/warehouse-project/blob/main/site_transfer_service.py"
click node_survey_reader "https://github.com/aysarali88/warehouse-project/blob/main/site_survey_readonly.py"
click node_apps_script_dashboard "https://github.com/aysarali88/warehouse-project/blob/main/apps-script-rollout-dashboard/Code.gs"

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_dashboard,node_app,node_rollout_records,node_apps_script_dashboard,node_user toneBlue
class node_db_config,node_data_models,node_survey_db toneAmber
class node_inventory_ui,node_inventory_api,node_inventory_rules,node_inventory_ledger toneMint
class node_transfer_ui,node_transfer_api,node_transfer_flow toneRose
class node_survey_reader toneIndigo
```

## Components

### Rollout tracking

- [Rollout dashboard](https://github.com/aysarali88/warehouse-project/blob/main/static/ftth_rollout.html): `static/ftth_rollout.html`
- [FastAPI application](https://github.com/aysarali88/warehouse-project/blob/main/main.py): `main.py`
- [Rollout records](https://github.com/aysarali88/warehouse-project/blob/main/main.py): `main.py`
- [Rollout dashboard](https://github.com/aysarali88/warehouse-project/blob/main/apps-script-rollout-dashboard/Code.gs): `apps-script-rollout-dashboard/Code.gs`

### Persistence

- [Database setup](https://github.com/aysarali88/warehouse-project/blob/main/database.py): `database.py`
- [Application models](https://github.com/aysarali88/warehouse-project/blob/main/models.py): `models.py`

### Site inventory

- [Materials inventory UI](https://github.com/aysarali88/warehouse-project/blob/main/static/materials_inventory.html): `static/materials_inventory.html`
- [Site inventory API](https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_api.py): `site_inventory_api.py`
- [Inventory configuration](https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_config.py): `site_inventory_config.py`
- [Inventory ledger](https://github.com/aysarali88/warehouse-project/blob/main/site_inventory_service.py): `site_inventory_service.py`

### Site transfers

- [Transfer interface](https://github.com/aysarali88/warehouse-project/blob/main/static/site_transfer_ui.js): `static/site_transfer_ui.js`
- [Transfer API](https://github.com/aysarali88/warehouse-project/blob/main/site_transfer_api.py): `site_transfer_api.py`
- [Transfer workflow](https://github.com/aysarali88/warehouse-project/blob/main/site_transfer_service.py): `site_transfer_service.py`

### External data

- [Survey reader](https://github.com/aysarali88/warehouse-project/blob/main/site_survey_readonly.py): `site_survey_readonly.py`

### Other components

- **Staff user**
- **Site Survey database**

## Connections

- Staff user → Rollout dashboard: enters progress (evidence: `README.md`)
- Rollout dashboard → FastAPI application: loads dashboard (evidence: `README.md`)
- Staff user → FastAPI application: submits records (evidence: `README.md`)
- FastAPI application → Rollout records: handles records (evidence: `README.md`)
- Rollout records → Database setup: stores records (evidence: `README.md`)
- Application models → Database setup: uses base (evidence: `models.py`)
- Materials inventory UI → Site inventory API: uses inventory
- Site inventory API → Inventory ledger: calls services (evidence: `site_inventory_api.py`)
- Site inventory API → Inventory configuration: checks gates (evidence: `site_inventory_api.py`)
- Inventory ledger → Database setup: uses sessions (evidence: `site_inventory_service.py`)
- Inventory ledger → Application models: queries models (evidence: `site_inventory_service.py`)
- Transfer interface → Transfer API: sends requests (evidence: `static/site_transfer_ui.js`)
- Transfer API → Transfer workflow: calls workflow (evidence: `site_transfer_api.py`)
- Transfer API → Inventory configuration: checks gates (evidence: `site_transfer_api.py`)
- Transfer workflow → Inventory ledger: uses inventory logic (evidence: `site_transfer_service.py`)
- Transfer workflow → Database setup: uses sessions (evidence: `site_transfer_service.py`)
- Transfer workflow → Application models: queries models (evidence: `site_transfer_service.py`)
- Survey reader → Site Survey database: reads pole counts (evidence: `site_survey_readonly.py`)
