# sahil-gith-pbpl/home-collection-new-main-project architecture

> Architecture diagram of the GitHub repository sahil-gith-pbpl/home-collection-new-main-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sahil-gith-pbpl/home-collection-new-main-project
- Repository: https://github.com/sahil-gith-pbpl/home-collection-new-main-project

## Overview

Arpra-neo is a Flask operations application spanning CRM leads and tickets, home-collection bookings and estimates, and laboratory, field, and WhatsApp workflows. The principal user flow is a staff member logging in, using registered route handlers to manage operational records, and persisting or retrieving data through the configured database connections. Home collection has a substantial booking core; WhatsApp messaging and audit are also distinct capabilities. The README provides no additional product description, and several route implementations were not sampled, so their internal relationships are not inferred.

Main entry points: [`app/db/connection.py`](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/db/connection.py) (Database connections), [`app/__init__.py`](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/__init__.py) (Flask app setup), [`app/routes/tickets.py`](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/tickets.py) (Ticket workflows), [`app/alerts.py`](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/alerts.py) (WhatsApp alerts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_flask_app["Flask app setup<br/>[__init__.py]"]
  node_auth["Login and access<br/>[auth.py]"]
  node_db[("Database connections<br/>[connection.py]")]
end

subgraph group_crm["CRM and Tickets"]
  node_leads["Lead management<br/>[leads_list.py]"]
  node_lead_routes["Lead routes"]
  node_ticket_routes["Ticket workflows<br/>[tickets.py]"]
  node_ticket_lists["Ticket lists and details<br/>[ticketlist.py]"]
  node_ticket_detail["Ticket detail<br/>[ticket_detail.py]"]
end

subgraph group_collection["Home Collection"]
  node_hc_routes["Home collection routes"]
  node_hc_core["Booking core"]
  node_estimate_core["Estimate core<br/>[hestimate_core.py]"]
end

subgraph group_operations["Lab and Field Operations"]
  node_hc_reports["Collection operations reports"]
  node_phlebo["Phlebo summary<br/>[phlebo_summary.py]"]
  node_labmate["Labmate API<br/>[labmate_api.py]"]
  node_venepunchre["Vene-punchre cases<br/>[venepunchre.py]"]
end

subgraph group_messaging["Messaging"]
  node_whatsapp_panel["WhatsApp panel<br/>[whatsapp_panel.py]"]
  node_alerts["WhatsApp alerts<br/>[alerts.py]"]
  node_wa_audit["WhatsApp audit<br/>[whatsapp_audit.py]"]
end

node_staff(("Staff user"))
node_wa_service["WhatsApp API"]

node_staff -->|"logs in"| node_auth
node_auth -->|"queries users"| node_db
node_flask_app -->|"registers routes"| node_auth
node_flask_app -->|"registers routes"| node_lead_routes
node_flask_app -->|"registers routes"| node_ticket_routes
node_flask_app -->|"registers routes"| node_ticket_lists
node_flask_app -->|"registers routes"| node_ticket_detail
node_flask_app -->|"registers routes"| node_hc_routes
node_flask_app -->|"registers routes"| node_phlebo
node_flask_app -->|"registers routes"| node_hc_reports
node_flask_app -->|"registers routes"| node_labmate
node_flask_app -->|"registers routes"| node_whatsapp_panel
node_leads -->|"reads and writes"| node_db
node_ticket_routes -->|"reads and writes"| node_db
node_ticket_lists -->|"reads and writes"| node_db
node_ticket_detail -->|"reads and writes"| node_db
node_hc_routes -->|"uses estimates"| node_estimate_core
node_hc_core -->|"reads and writes"| node_db
node_estimate_core -->|"reads and writes"| node_db
node_hc_reports -->|"reads and writes"| node_db
node_phlebo -->|"reads and writes"| node_db
node_venepunchre -->|"connects to case store"| node_db
node_whatsapp_panel -->|"reads and writes"| node_db
node_alerts -->|"sends messages"| node_wa_service
node_ticket_routes -->|"sends alerts"| node_alerts
node_ticket_routes -->|"logs sends"| node_wa_audit
node_hc_core -->|"sends alerts"| node_alerts
node_hc_core -->|"logs messages"| node_wa_audit
node_alerts -->|"logs sends"| node_wa_audit
node_wa_audit -->|"stores audit"| node_db

click node_flask_app "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/__init__.py"
click node_auth "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/auth.py"
click node_db "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/db/connection.py"
click node_leads "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/leads_list.py"
click node_lead_routes "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/tree/main/app/routes"
click node_ticket_routes "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/tickets.py"
click node_ticket_lists "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/ticketlist.py"
click node_ticket_detail "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/ticket_detail.py"
click node_hc_routes "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/hhome_collection.py"
click node_hc_core "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/home_collection_core/hhome_collection_core.py"
click node_estimate_core "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/home_collection_core/hestimate_core.py"
click node_hc_reports "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/hbatch_handover_ui.py"
click node_phlebo "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/phlebo_summary.py"
click node_labmate "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/labmate_api.py"
click node_venepunchre "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/venepunchre.py"
click node_whatsapp_panel "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/whatsapp_panel.py"
click node_alerts "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/alerts.py"
click node_wa_audit "https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/whatsapp_audit.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_flask_app,node_auth,node_db,node_staff toneBlue
class node_leads,node_lead_routes,node_ticket_routes,node_ticket_lists,node_ticket_detail toneAmber
class node_hc_routes,node_hc_core,node_estimate_core,node_wa_service toneMint
class node_hc_reports,node_phlebo,node_labmate,node_venepunchre toneRose
class node_whatsapp_panel,node_alerts,node_wa_audit toneIndigo
```

## Components

### Application

- [Flask app setup](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/__init__.py): `app/__init__.py`
- [Login and access](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [Database connections](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/db/connection.py): `app/db/connection.py`

### CRM and Tickets

- [Lead management](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/leads_list.py): `app/routes/leads_list.py`
- [Lead routes](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/tree/main/app/routes): `app/routes`
- [Ticket workflows](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/tickets.py): `app/routes/tickets.py`
- [Ticket lists and details](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/ticketlist.py): `app/routes/ticketlist.py`
- [Ticket detail](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/ticket_detail.py): `app/routes/ticket_detail.py`

### Home Collection

- [Home collection routes](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/hhome_collection.py): `app/routes/hhome_collection.py`
- [Booking core](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/home_collection_core/hhome_collection_core.py): `app/home_collection_core/hhome_collection_core.py`
- [Estimate core](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/home_collection_core/hestimate_core.py): `app/home_collection_core/hestimate_core.py`

### Lab and Field Operations

- [Collection operations reports](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/hbatch_handover_ui.py): `app/routes/hbatch_handover_ui.py`
- [Phlebo summary](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/phlebo_summary.py): `app/routes/phlebo_summary.py`
- [Labmate API](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/labmate_api.py): `app/routes/labmate_api.py`
- [Vene-punchre cases](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/venepunchre.py): `app/routes/venepunchre.py`

### Messaging

- [WhatsApp panel](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/routes/whatsapp_panel.py): `app/routes/whatsapp_panel.py`
- [WhatsApp alerts](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/alerts.py): `app/alerts.py`
- [WhatsApp audit](https://github.com/sahil-gith-pbpl/home-collection-new-main-project/blob/main/app/whatsapp_audit.py): `app/whatsapp_audit.py`

### Other components

- **Staff user**
- **WhatsApp API**

## Connections

- Staff user → Login and access: logs in (evidence: `app/routes/auth.py`)
- Login and access → Database connections: queries users (evidence: `app/routes/auth.py`)
- Flask app setup → Login and access: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Lead routes: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Ticket workflows: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Ticket lists and details: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Ticket detail: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Home collection routes: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Phlebo summary: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Collection operations reports: registers routes (evidence: `app/__init__.py`)
- Flask app setup → Labmate API: registers routes (evidence: `app/__init__.py`)
- Flask app setup → WhatsApp panel: registers routes (evidence: `app/__init__.py`)
- Lead management → Database connections: reads and writes (evidence: `app/routes/leads_list.py`)
- Ticket workflows → Database connections: reads and writes (evidence: `app/routes/tickets.py`)
- Ticket lists and details → Database connections: reads and writes (evidence: `app/routes/ticketlist.py`)
- Ticket detail → Database connections: reads and writes (evidence: `app/routes/ticket_detail.py`)
- Home collection routes → Estimate core: uses estimates (evidence: `app/routes/hhome_collection.py`)
- Booking core → Database connections: reads and writes (evidence: `app/home_collection_core/hhome_collection_core.py`)
- Estimate core → Database connections: reads and writes (evidence: `app/home_collection_core/hestimate_core.py`)
- Collection operations reports → Database connections: reads and writes (evidence: `app/routes/hbatch_handover_ui.py`)
- Phlebo summary → Database connections: reads and writes (evidence: `app/routes/phlebo_summary.py`)
- Vene-punchre cases → Database connections: connects to case store (evidence: `app/routes/venepunchre.py`)
- WhatsApp panel → Database connections: reads and writes (evidence: `app/routes/whatsapp_panel.py`)
- WhatsApp alerts → WhatsApp API: sends messages (evidence: `app/alerts.py`)
- Ticket workflows → WhatsApp alerts: sends alerts (evidence: `app/routes/tickets.py`)
- Ticket workflows → WhatsApp audit: logs sends (evidence: `app/routes/tickets.py`)
- Booking core → WhatsApp alerts: sends alerts (evidence: `app/home_collection_core/hhome_collection_core.py`)
- Booking core → WhatsApp audit: logs messages (evidence: `app/home_collection_core/hhome_collection_core.py`)
- WhatsApp alerts → WhatsApp audit: logs sends (evidence: `app/alerts.py`)
- WhatsApp audit → Database connections: stores audit (evidence: `app/whatsapp_audit.py`)
