# indra2215/mihira-odoo architecture

> Architecture diagram of the GitHub repository indra2215/mihira-odoo, 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/indra2215/mihira-odoo
- Repository: https://github.com/indra2215/mihira-odoo

## Overview

Mihira Solar ERP is a lead-intake and operations application. Staff enter call details in the web UI, while Google Forms submissions arrive through a webhook; the backend validates each intake, links or creates a customer, records a lead, and persists the data in PostgreSQL. The UI also presents dashboard metrics and lead lists, alongside customer, technician, and assignment views. The README documents the main intake flows; some page-to-endpoint wiring and internal routes are not shown in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`backend/apps/leads/views.py`](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py) (API handlers), [`backend/apps/leads/models.py`](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/models.py) (Domain records), [`frontend/app/page.tsx`](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/page.tsx) (Dashboard), [`frontend/app/leads/new/page.tsx`](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/leads/new/page.tsx) (Manual intake)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_manual["Manual intake<br/>[page.tsx]"]
  node_leadspage["Leads page<br/>[page.tsx]"]
  node_customerspage["Customers page<br/>[page.tsx]"]
  node_googlepage["Webhook simulator<br/>[page.tsx]"]
  node_technicianpage["Technicians page<br/>[page.tsx]"]
  node_sidebar["Navigation<br/>[Sidebar.tsx]"]
  node_statcard["Metric card<br/>[StatCard.tsx]"]
end

subgraph group_api["API and intake"]
  node_wsgi["Django entry<br/>[wsgi.py]"]
  node_routes["API routes<br/>[urls.py]"]
  node_views["API handlers<br/>[views.py]"]
  node_serializers["Validation and mapping<br/>[serializers.py]"]
end

subgraph group_operations["Field operations"]
  node_technicians["Technician management<br/>[views.py]"]
  node_assignments["Task assignments<br/>[views.py]"]
end

subgraph group_storage["Persistence"]
  node_models["Domain records<br/>[models.py]"]
  node_postgres[("PostgreSQL<br/>[schema.sql]")]
  node_inbound["Submission audit<br/>[models.py]"]
end

node_staff(("Staff"))
node_google(("Google Forms"))

node_staff -->|"enters details"| node_manual
node_manual -.->|"submits intake"| node_views
node_google -->|"posts webhook"| node_views
node_googlepage -.->|"simulates submission"| node_views
node_views -->|"validates payload"| node_serializers
node_serializers -->|"creates records"| node_models
node_views -->|"queries records"| node_models
node_models -->|"persists data"| node_postgres
node_dashboard -->|"fetches dashboard data"| node_views
node_leadspage -->|"displays leads"| node_views
node_views -->|"logs submissions"| node_inbound
node_views -->|"serves technician API"| node_technicians
node_views -->|"serves assignment API"| node_assignments
node_technicians -->|"queries technicians"| node_models
node_assignments -->|"queries assignments"| node_models
node_wsgi -.->|"accepts requests"| node_routes
node_routes -->|"routes requests"| node_views
node_dashboard -->|"renders metrics"| node_statcard
node_sidebar -.->|"links navigation"| node_technicianpage

click node_dashboard "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/page.tsx"
click node_manual "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/leads/new/page.tsx"
click node_leadspage "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/leads/page.tsx"
click node_customerspage "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/customers/page.tsx"
click node_googlepage "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/google-form/page.tsx"
click node_technicianpage "https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/technicians/page.tsx"
click node_sidebar "https://github.com/indra2215/mihira-odoo/blob/main/frontend/components/Sidebar.tsx"
click node_statcard "https://github.com/indra2215/mihira-odoo/blob/main/frontend/components/StatCard.tsx"
click node_wsgi "https://github.com/indra2215/mihira-odoo/blob/main/backend/config/wsgi.py"
click node_routes "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/urls.py"
click node_views "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py"
click node_serializers "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/serializers.py"
click node_models "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/models.py"
click node_postgres "https://github.com/indra2215/mihira-odoo/blob/main/database/schema.sql"
click node_technicians "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py"
click node_assignments "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py"
click node_inbound "https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/models.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_dashboard,node_manual,node_leadspage,node_customerspage,node_googlepage,node_technicianpage,node_sidebar,node_statcard toneBlue
class node_wsgi,node_routes,node_views,node_serializers toneAmber
class node_technicians,node_assignments toneMint
class node_models,node_postgres,node_inbound toneRose
class node_staff,node_google toneIndigo
```

## Components

### Web interface

- [Dashboard](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Manual intake](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/leads/new/page.tsx): `frontend/app/leads/new/page.tsx`
- [Leads page](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/leads/page.tsx): `frontend/app/leads/page.tsx`
- [Customers page](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/customers/page.tsx): `frontend/app/customers/page.tsx`
- [Webhook simulator](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/google-form/page.tsx): `frontend/app/google-form/page.tsx`
- [Technicians page](https://github.com/indra2215/mihira-odoo/blob/main/frontend/app/technicians/page.tsx): `frontend/app/technicians/page.tsx`
- [Navigation](https://github.com/indra2215/mihira-odoo/blob/main/frontend/components/Sidebar.tsx): `frontend/components/Sidebar.tsx`
- [Metric card](https://github.com/indra2215/mihira-odoo/blob/main/frontend/components/StatCard.tsx): `frontend/components/StatCard.tsx`

### API and intake

- [Django entry](https://github.com/indra2215/mihira-odoo/blob/main/backend/config/wsgi.py): `backend/config/wsgi.py`
- [API routes](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/urls.py): `backend/apps/leads/urls.py`
- [API handlers](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py): `backend/apps/leads/views.py`
- [Validation and mapping](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/serializers.py): `backend/apps/leads/serializers.py`

### Field operations

- [Technician management](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py): `backend/apps/leads/views.py`
- [Task assignments](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/views.py): `backend/apps/leads/views.py`

### Persistence

- [Domain records](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/models.py): `backend/apps/leads/models.py`
- [PostgreSQL](https://github.com/indra2215/mihira-odoo/blob/main/database/schema.sql): `database/schema.sql`
- [Submission audit](https://github.com/indra2215/mihira-odoo/blob/main/backend/apps/leads/models.py): `backend/apps/leads/models.py`

### Other components

- **Staff**
- **Google Forms**

## Connections

- Staff → Manual intake: enters details (evidence: `README.md`)
- Manual intake → API handlers: submits intake
- Google Forms → API handlers: posts webhook (evidence: `README.md`)
- Webhook simulator → API handlers: simulates submission
- API handlers → Validation and mapping: validates payload (evidence: `backend/apps/leads/views.py`)
- Validation and mapping → Domain records: creates records (evidence: `backend/apps/leads/serializers.py`)
- API handlers → Domain records: queries records (evidence: `backend/apps/leads/views.py`)
- Domain records → PostgreSQL: persists data (evidence: `README.md`)
- Dashboard → API handlers: fetches dashboard data (evidence: `README.md`)
- Leads page → API handlers: displays leads (evidence: `README.md`)
- API handlers → Submission audit: logs submissions (evidence: `backend/apps/leads/views.py`)
- API handlers → Technician management: serves technician API (evidence: `backend/apps/leads/views.py`)
- API handlers → Task assignments: serves assignment API (evidence: `backend/apps/leads/views.py`)
- Technician management → Domain records: queries technicians (evidence: `backend/apps/leads/views.py`)
- Task assignments → Domain records: queries assignments (evidence: `backend/apps/leads/views.py`)
- Django entry → API routes: accepts requests
- API routes → API handlers: routes requests (evidence: `backend/apps/leads/urls.py`)
- Dashboard → Metric card: renders metrics (evidence: `frontend/app/page.tsx`)
- Navigation → Technicians page: links navigation
