# thesyedammar/sahkarsetu architecture

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

- Interactive diagram: https://gitdiagram.com/thesyedammar/sahkarsetu
- Repository: https://github.com/thesyedammar/sahkarsetu

## Overview

SahkarSetu is a cooperative marketplace for household and community services. Customers browse verified workers, request scheduled or emergency jobs, track booking progress, pay a simulated charge, and leave feedback; cooperatives and federation administrators manage verification, welfare, payouts, and demand planning. Workers manage jobs, profiles, certificates, and welfare through a multilingual PWA. The backend is a FastAPI application backed by SQLite, with a separate explainable forecast module. Several backend route details were not sampled, so capability links rely on the README where noted.

Main entry points: [`main.py`](https://github.com/thesyedammar/sahkarsetu/blob/main/main.py) (FastAPI routes), [`static/js/app.js`](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/app.js) (App router and auth), [`static/js/views_admin.js`](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_admin.js) (Federation dashboard), [`forecast.py`](https://github.com/thesyedammar/sahkarsetu/blob/main/forecast.py) (Demand forecasting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer marketplace"]
  node_browse["Worker discovery<br/>[views_browse.js]"]
  node_bookings["Booking flow<br/>[views_browse.js]"]
  node_payment_feedback["Payment and feedback<br/>[views_worker.js]"]
end

subgraph group_worker["Worker services"]
  node_booking_hub["Booking and job hub<br/>[views_worker.js]"]
  node_worker_welfare["Worker profile and welfare<br/>[views_worker.js]"]
end

subgraph group_governance["Cooperative governance"]
  node_society["Society dashboard<br/>[views_society.js]"]
  node_federation["Federation dashboard<br/>[views_admin.js]"]
end

subgraph group_platform["Platform core"]
  node_router["App router and auth<br/>[app.js]"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_forecast["Demand forecasting<br/>[forecast.py]"]
  node_database[("SQLite data layer<br/>[db.py]")]
  node_pwa["PWA offline support<br/>[sw.js]"]
  node_languages["Hindi English Urdu<br/>[i18n.js]"]
end

node_customer(("Customer"))
node_worker(("Worker"))
node_admins(("Co-op admins"))

node_customer -->|"signs in"| node_router
node_worker -->|"signs in"| node_router
node_admins -->|"signs in"| node_router
node_router -->|"routes to"| node_browse
node_router -->|"routes to"| node_booking_hub
node_router -->|"routes to"| node_federation
node_router -->|"routes to"| node_society
node_browse -->|"requests workers"| node_api
node_bookings -->|"creates booking"| node_api
node_booking_hub -->|"manages bookings"| node_api
node_payment_feedback -->|"pays and reviews"| node_api
node_worker_welfare -->|"submits welfare"| node_api
node_society -->|"decides requests"| node_api
node_federation -->|"manages operations"| node_api
node_api -->|"reads and writes"| node_database
node_api -->|"requests forecasts"| node_forecast
node_forecast -->|"queries history"| node_database
node_federation -->|"views forecasts"| node_forecast
node_router -.->|"applies language"| node_languages
node_customer -.->|"uses offline app"| node_pwa

click node_router "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/app.js"
click node_browse "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_browse.js"
click node_bookings "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_browse.js"
click node_booking_hub "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js"
click node_payment_feedback "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js"
click node_worker_welfare "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js"
click node_society "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_society.js"
click node_federation "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_admin.js"
click node_api "https://github.com/thesyedammar/sahkarsetu/blob/main/main.py"
click node_forecast "https://github.com/thesyedammar/sahkarsetu/blob/main/forecast.py"
click node_database "https://github.com/thesyedammar/sahkarsetu/blob/main/db.py"
click node_pwa "https://github.com/thesyedammar/sahkarsetu/blob/main/static/sw.js"
click node_languages "https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/i18n.js"

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_browse,node_bookings,node_payment_feedback toneBlue
class node_booking_hub,node_worker_welfare toneAmber
class node_society,node_federation toneMint
class node_router,node_api,node_forecast,node_database,node_pwa,node_languages,node_worker toneRose
class node_customer,node_admins toneIndigo
```

## Components

### Customer marketplace

- [Worker discovery](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_browse.js): `static/js/views_browse.js`
- [Booking flow](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_browse.js): `static/js/views_browse.js`
- [Payment and feedback](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js): `static/js/views_worker.js`

### Worker services

- [Booking and job hub](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js): `static/js/views_worker.js`
- [Worker profile and welfare](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_worker.js): `static/js/views_worker.js`

### Cooperative governance

- [Society dashboard](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_society.js): `static/js/views_society.js`
- [Federation dashboard](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/views_admin.js): `static/js/views_admin.js`

### Platform core

- [App router and auth](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/app.js): `static/js/app.js`
- [FastAPI routes](https://github.com/thesyedammar/sahkarsetu/blob/main/main.py): `main.py`
- [Demand forecasting](https://github.com/thesyedammar/sahkarsetu/blob/main/forecast.py): `forecast.py`
- [SQLite data layer](https://github.com/thesyedammar/sahkarsetu/blob/main/db.py): `db.py`
- [PWA offline support](https://github.com/thesyedammar/sahkarsetu/blob/main/static/sw.js): `static/sw.js`
- [Hindi English Urdu](https://github.com/thesyedammar/sahkarsetu/blob/main/static/js/i18n.js): `static/js/i18n.js`

### Other components

- **Customer**
- **Worker**
- **Co-op admins**

## Connections

- Customer → App router and auth: signs in (evidence: `static/js/app.js`)
- Worker → App router and auth: signs in (evidence: `static/js/app.js`)
- Co-op admins → App router and auth: signs in (evidence: `static/js/app.js`)
- App router and auth → Worker discovery: routes to (evidence: `static/js/app.js`)
- App router and auth → Booking and job hub: routes to (evidence: `static/js/app.js`)
- App router and auth → Federation dashboard: routes to (evidence: `static/js/app.js`)
- App router and auth → Society dashboard: routes to (evidence: `static/js/app.js`)
- Worker discovery → FastAPI routes: requests workers (evidence: `static/js/views_browse.js`)
- Booking flow → FastAPI routes: creates booking (evidence: `static/js/views_browse.js`)
- Booking and job hub → FastAPI routes: manages bookings (evidence: `static/js/views_worker.js`)
- Payment and feedback → FastAPI routes: pays and reviews (evidence: `static/js/views_worker.js`)
- Worker profile and welfare → FastAPI routes: submits welfare (evidence: `static/js/views_worker.js`)
- Society dashboard → FastAPI routes: decides requests (evidence: `static/js/views_society.js`)
- Federation dashboard → FastAPI routes: manages operations (evidence: `static/js/views_admin.js`)
- FastAPI routes → SQLite data layer: reads and writes (evidence: `main.py`)
- FastAPI routes → Demand forecasting: requests forecasts (evidence: `main.py`)
- Demand forecasting → SQLite data layer: queries history (evidence: `forecast.py`)
- Federation dashboard → Demand forecasting: views forecasts (evidence: `static/js/views_admin.js`)
- App router and auth → Hindi English Urdu: applies language
- Customer → PWA offline support: uses offline app
