# parthaher22/partahera0604 architecture

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

- Interactive diagram: https://gitdiagram.com/parthaher22/partahera0604
- Repository: https://github.com/parthaher22/partahera0604

## Overview

E-GramPanchayat is a village-governance portal with citizen and Panchayat workflows for accounts, complaints, notices, taxes and payments, finance, staff, and audit. The FastAPI application registers the domain routers; those handlers enforce access rules and use a shared Supabase client for persistent operations. Some routes also write audit events or maintain Excel exports. The frontend files indicate a browser application, but no frontend source excerpt or README was provided to establish its runtime connections, so those links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/parthaher22/partahera0604/blob/main/backend/app/main.py) (FastAPI entry), [`backend/app/supabase_client.py`](https://github.com/parthaher22/partahera0604/blob/main/backend/app/supabase_client.py) (Supabase client), [`backend/app/security.py`](https://github.com/parthaher22/partahera0604/blob/main/backend/app/security.py) (Token and roles), [`backend/app/audit_util.py`](https://github.com/parthaher22/partahera0604/blob/main/backend/app/audit_util.py) (Audit writer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_frontend["Web application<br/>[app.js]"]
  node_i18n["Translations<br/>[i18n.js]"]
  node_webconfig["Web configuration<br/>[config.js]"]
end

subgraph group_entry["API and identity"]
  node_api["FastAPI entry<br/>[main.py]"]
  node_auth["Account and login<br/>[auth.py]"]
end

subgraph group_citizen["Citizen services"]
  node_complaints["Complaints<br/>[complaints.py]"]
  node_announcements["Announcements<br/>[announcements.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
  node_tax["Tax assessment<br/>[tax.py]"]
  node_payments["Fee payments<br/>[payments.py]"]
  node_pay["Pay endpoint<br/>[pay.py]"]
end

subgraph group_governance["Panchayat operations"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_finance["Financial ledger<br/>[finance.py]"]
  node_staff["Staff management<br/>[staff.py]"]
  node_audit["Audit records<br/>[audit.py]"]
  node_reference["Reference data<br/>[reference.py]"]
end

subgraph group_platform["Shared platform"]
  node_security["Token and roles<br/>[security.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
  node_auditutil["Audit writer<br/>[audit_util.py]"]
  node_export["Villager Excel export<br/>[villager_export.py]"]
  node_supabase["Supabase client<br/>[supabase_client.py]"]
  node_database[("Supabase data store")]
end

node_api -->|"registers"| node_auth
node_api -->|"registers"| node_complaints
node_api -->|"registers"| node_announcements
node_api -->|"registers"| node_dashboard
node_api -->|"registers"| node_reference
node_api -->|"registers"| node_audit
node_api -->|"registers"| node_staff
node_api -->|"registers"| node_pay
node_api -->|"registers"| node_tax
node_api -->|"registers"| node_notifications
node_api -->|"registers"| node_finance
node_api -->|"registers"| node_payments
node_auth -->|"uses"| node_security
node_complaints -->|"uses"| node_security
node_announcements -->|"uses"| node_security
node_dashboard -->|"uses"| node_security
node_finance -->|"uses"| node_security
node_payments -->|"uses"| node_security
node_staff -->|"uses"| node_security
node_tax -->|"uses"| node_security
node_audit -->|"uses"| node_security
node_notifications -->|"uses"| node_security
node_auth -->|"uses"| node_schemas
node_complaints -->|"uses"| node_schemas
node_auth -->|"reads and writes"| node_supabase
node_complaints -->|"reads and writes"| node_supabase
node_announcements -->|"reads and writes"| node_supabase
node_dashboard -->|"queries"| node_supabase
node_reference -->|"queries"| node_supabase
node_audit -->|"queries"| node_supabase
node_staff -->|"reads and writes"| node_supabase
node_tax -->|"reads and writes"| node_supabase
node_notifications -->|"reads and writes"| node_supabase
node_finance -->|"reads and writes"| node_supabase
node_payments -->|"reads and writes"| node_supabase
node_supabase -->|"connects"| node_database
node_auth -->|"logs events"| node_auditutil
node_complaints -->|"logs events"| node_auditutil
node_announcements -->|"logs events"| node_auditutil
node_finance -->|"logs events"| node_auditutil
node_payments -->|"logs events"| node_auditutil
node_staff -->|"logs events"| node_auditutil
node_tax -->|"logs events"| node_auditutil
node_auditutil -->|"writes audit"| node_supabase
node_auth -->|"syncs accounts"| node_export
node_export -->|"reads profiles"| node_supabase
node_announcements -->|"broadcasts notices"| node_notifications

click node_frontend "https://github.com/parthaher22/partahera0604/blob/main/frontend/app.js"
click node_i18n "https://github.com/parthaher22/partahera0604/blob/main/frontend/i18n.js"
click node_webconfig "https://github.com/parthaher22/partahera0604/blob/main/frontend/config.js"
click node_api "https://github.com/parthaher22/partahera0604/blob/main/backend/app/main.py"
click node_auth "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/auth.py"
click node_security "https://github.com/parthaher22/partahera0604/blob/main/backend/app/security.py"
click node_schemas "https://github.com/parthaher22/partahera0604/blob/main/backend/app/schemas.py"
click node_complaints "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/complaints.py"
click node_announcements "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/announcements.py"
click node_notifications "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/notifications.py"
click node_tax "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/tax.py"
click node_payments "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/payments.py"
click node_dashboard "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/dashboard.py"
click node_finance "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/finance.py"
click node_staff "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/staff.py"
click node_audit "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/audit.py"
click node_reference "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/reference.py"
click node_pay "https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/pay.py"
click node_auditutil "https://github.com/parthaher22/partahera0604/blob/main/backend/app/audit_util.py"
click node_export "https://github.com/parthaher22/partahera0604/blob/main/backend/app/villager_export.py"
click node_supabase "https://github.com/parthaher22/partahera0604/blob/main/backend/app/supabase_client.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_frontend,node_i18n,node_webconfig toneBlue
class node_api,node_auth toneAmber
class node_complaints,node_announcements,node_notifications,node_tax,node_payments,node_pay toneMint
class node_dashboard,node_finance,node_staff,node_audit,node_reference toneRose
class node_security,node_schemas,node_auditutil,node_export,node_supabase,node_database toneIndigo
```

## Components

### Web interface

- [Web application](https://github.com/parthaher22/partahera0604/blob/main/frontend/app.js): `frontend/app.js`
- [Translations](https://github.com/parthaher22/partahera0604/blob/main/frontend/i18n.js): `frontend/i18n.js`
- [Web configuration](https://github.com/parthaher22/partahera0604/blob/main/frontend/config.js): `frontend/config.js`

### API and identity

- [FastAPI entry](https://github.com/parthaher22/partahera0604/blob/main/backend/app/main.py): `backend/app/main.py`
- [Account and login](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`

### Citizen services

- [Complaints](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/complaints.py): `backend/app/routers/complaints.py`
- [Announcements](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/announcements.py): `backend/app/routers/announcements.py`
- [Notifications](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/notifications.py): `backend/app/routers/notifications.py`
- [Tax assessment](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/tax.py): `backend/app/routers/tax.py`
- [Fee payments](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`
- [Pay endpoint](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/pay.py): `backend/app/routers/pay.py`

### Panchayat operations

- [Dashboard](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/dashboard.py): `backend/app/routers/dashboard.py`
- [Financial ledger](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/finance.py): `backend/app/routers/finance.py`
- [Staff management](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/staff.py): `backend/app/routers/staff.py`
- [Audit records](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/audit.py): `backend/app/routers/audit.py`
- [Reference data](https://github.com/parthaher22/partahera0604/blob/main/backend/app/routers/reference.py): `backend/app/routers/reference.py`

### Shared platform

- [Token and roles](https://github.com/parthaher22/partahera0604/blob/main/backend/app/security.py): `backend/app/security.py`
- [Request schemas](https://github.com/parthaher22/partahera0604/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Audit writer](https://github.com/parthaher22/partahera0604/blob/main/backend/app/audit_util.py): `backend/app/audit_util.py`
- [Villager Excel export](https://github.com/parthaher22/partahera0604/blob/main/backend/app/villager_export.py): `backend/app/villager_export.py`
- [Supabase client](https://github.com/parthaher22/partahera0604/blob/main/backend/app/supabase_client.py): `backend/app/supabase_client.py`
- **Supabase data store**

## Connections

- FastAPI entry → Account and login: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Complaints: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Announcements: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Dashboard: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Reference data: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Audit records: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Staff management: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Pay endpoint: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Tax assessment: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Notifications: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Financial ledger: registers (evidence: `backend/app/main.py`)
- FastAPI entry → Fee payments: registers (evidence: `backend/app/main.py`)
- Account and login → Token and roles: uses (evidence: `backend/app/routers/auth.py`)
- Complaints → Token and roles: uses (evidence: `backend/app/routers/complaints.py`)
- Announcements → Token and roles: uses (evidence: `backend/app/routers/announcements.py`)
- Dashboard → Token and roles: uses (evidence: `backend/app/routers/dashboard.py`)
- Financial ledger → Token and roles: uses (evidence: `backend/app/routers/finance.py`)
- Fee payments → Token and roles: uses (evidence: `backend/app/routers/payments.py`)
- Staff management → Token and roles: uses (evidence: `backend/app/routers/staff.py`)
- Tax assessment → Token and roles: uses (evidence: `backend/app/routers/tax.py`)
- Audit records → Token and roles: uses (evidence: `backend/app/routers/audit.py`)
- Notifications → Token and roles: uses (evidence: `backend/app/routers/notifications.py`)
- Account and login → Request schemas: uses (evidence: `backend/app/routers/auth.py`)
- Complaints → Request schemas: uses (evidence: `backend/app/routers/complaints.py`)
- Account and login → Supabase client: reads and writes (evidence: `backend/app/routers/auth.py`)
- Complaints → Supabase client: reads and writes (evidence: `backend/app/routers/complaints.py`)
- Announcements → Supabase client: reads and writes (evidence: `backend/app/routers/announcements.py`)
- Dashboard → Supabase client: queries (evidence: `backend/app/routers/dashboard.py`)
- Reference data → Supabase client: queries (evidence: `backend/app/routers/reference.py`)
- Audit records → Supabase client: queries (evidence: `backend/app/routers/audit.py`)
- Staff management → Supabase client: reads and writes (evidence: `backend/app/routers/staff.py`)
- Tax assessment → Supabase client: reads and writes (evidence: `backend/app/routers/tax.py`)
- Notifications → Supabase client: reads and writes (evidence: `backend/app/routers/notifications.py`)
- Financial ledger → Supabase client: reads and writes (evidence: `backend/app/routers/finance.py`)
- Fee payments → Supabase client: reads and writes (evidence: `backend/app/routers/payments.py`)
- Supabase client → Supabase data store: connects (evidence: `backend/app/supabase_client.py`)
- Account and login → Audit writer: logs events (evidence: `backend/app/routers/auth.py`)
- Complaints → Audit writer: logs events (evidence: `backend/app/routers/complaints.py`)
- Announcements → Audit writer: logs events (evidence: `backend/app/routers/announcements.py`)
- Financial ledger → Audit writer: logs events (evidence: `backend/app/routers/finance.py`)
- Fee payments → Audit writer: logs events (evidence: `backend/app/routers/payments.py`)
- Staff management → Audit writer: logs events (evidence: `backend/app/routers/staff.py`)
- Tax assessment → Audit writer: logs events (evidence: `backend/app/routers/tax.py`)
- Audit writer → Supabase client: writes audit (evidence: `backend/app/audit_util.py`)
- Account and login → Villager Excel export: syncs accounts (evidence: `backend/app/routers/auth.py`)
- Villager Excel export → Supabase client: reads profiles (evidence: `backend/app/villager_export.py`)
- Announcements → Notifications: broadcasts notices (evidence: `backend/app/routers/announcements.py`)
