# ayyamrevanth/cooperative-gig-platform architecture

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

- Interactive diagram: https://gitdiagram.com/ayyamrevanth/cooperative-gig-platform
- Repository: https://github.com/ayyamrevanth/cooperative-gig-platform

## Overview

This is a cooperative services marketplace: customers discover services, match verified and available workers, book and track work, then pay and review. Workers manage profiles, credentials, availability and jobs; cooperative administrators oversee verification, operations, welfare and demand forecasting. The README documents the end-to-end capabilities and client/API workflow. The graph combines those documented flows with source-index references and excerpts; unsampled implementation details are represented at subsystem level rather than inferred as specific calls.

Main entry points: [`backend/app/main.py`](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/main.py) (REST API), [`backend/app/routers/matching.py`](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/matching.py) (Worker matching), [`backend/app/routers/bookings.py`](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/bookings.py) (Booking lifecycle), [`backend/app/models/transactions.py`](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/transactions.py) (Booking and transaction models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client"]
  node_frontend["Multilingual application<br/>[App.tsx]"]
  node_client_api["API client<br/>[api.ts]"]
end

subgraph group_api["API and security"]
  node_api_entry["REST API<br/>[main.py]"]
  node_authentication["Authentication<br/>[auth.py]"]
end

subgraph group_market["Marketplace workflow"]
  node_service_catalog["Service catalog<br/>[services.py]"]
  node_worker_profiles["Worker profiles<br/>[workers.py]"]
  node_locations["Locations<br/>[locations.py]"]
  node_availability["Availability<br/>[availability.py]"]
  node_matching["Worker matching<br/>[matching.py]"]
  node_bookings["Booking lifecycle<br/>[bookings.py]"]
  node_emergency["Emergency dispatch<br/>[emergency.py]"]
  node_payments["Mock payments<br/>[payments.py]"]
  node_ratings["Ratings<br/>[ratings.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

subgraph group_operations["Cooperative operations"]
  node_administration["Federation administration<br/>[admin.py]"]
  node_forecasting["Demand forecasting<br/>[forecasting.py]"]
  node_welfare["Worker welfare<br/>[workers.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Database sessions<br/>[database.py]")]
  node_catalog_models["Catalog and availability models<br/>[catalog.py]"]
  node_identity_models["Identity and worker models<br/>[identity.py]"]
  node_transaction_models["Booking and transaction models<br/>[transactions.py]"]
end

node_customer(("Customer"))
node_worker(("Worker"))
node_admin(("Cooperative admin"))

node_customer -->|"uses"| node_frontend
node_worker -->|"uses"| node_frontend
node_admin -->|"uses"| node_frontend
node_frontend -.->|"requests through"| node_client_api
node_client_api -->|"calls"| node_api_entry
node_api_entry -.->|"routes protected requests"| node_authentication
node_api_entry -->|"registers"| node_service_catalog
node_api_entry -->|"registers"| node_worker_profiles
node_api_entry -->|"registers"| node_locations
node_api_entry -->|"registers"| node_availability
node_api_entry -->|"registers"| node_matching
node_api_entry -->|"registers"| node_bookings
node_api_entry -->|"registers"| node_emergency
node_api_entry -->|"registers"| node_payments
node_api_entry -->|"registers"| node_ratings
node_api_entry -->|"registers"| node_notifications
node_api_entry -->|"registers"| node_administration
node_service_catalog -->|"supplies service criteria"| node_matching
node_worker_profiles -->|"supplies worker eligibility"| node_matching
node_locations -->|"supplies location"| node_matching
node_availability -->|"checks active slots"| node_matching
node_matching -->|"selects worker for"| node_bookings
node_bookings -->|"triggers alerts"| node_notifications
node_emergency -->|"triggers alerts"| node_notifications
node_bookings -->|"enables payment"| node_payments
node_bookings -->|"enables review"| node_ratings
node_administration -->|"requests forecasts"| node_forecasting
node_administration -.->|"manages claims"| node_welfare
node_service_catalog -->|"queries"| node_catalog_models
node_matching -->|"queries"| node_catalog_models
node_availability -->|"uses availability records"| node_catalog_models
node_worker_profiles -->|"queries worker records"| node_identity_models
node_matching -->|"checks worker identity"| node_identity_models
node_bookings -->|"reads and writes bookings"| node_transaction_models
node_payments -->|"reads and writes payments"| node_transaction_models
node_ratings -->|"reads and writes ratings"| node_transaction_models
node_notifications -->|"reads and writes notifications"| node_transaction_models
node_emergency -->|"reads and writes requests"| node_transaction_models
node_database -->|"provides ORM base"| node_catalog_models
node_database -->|"provides ORM base"| node_identity_models
node_database -->|"provides ORM base"| node_transaction_models

click node_frontend "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/frontend/src/App.tsx"
click node_client_api "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/frontend/src/api.ts"
click node_api_entry "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/main.py"
click node_authentication "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/auth.py"
click node_service_catalog "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/services.py"
click node_worker_profiles "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/workers.py"
click node_locations "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/locations.py"
click node_availability "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/availability.py"
click node_matching "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/matching.py"
click node_bookings "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/bookings.py"
click node_emergency "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/emergency.py"
click node_payments "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/payments.py"
click node_ratings "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/ratings.py"
click node_notifications "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/notifications.py"
click node_administration "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/admin.py"
click node_forecasting "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/services/forecasting.py"
click node_welfare "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/workers.py"
click node_database "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/database.py"
click node_catalog_models "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/catalog.py"
click node_identity_models "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/identity.py"
click node_transaction_models "https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/transactions.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_client_api toneBlue
class node_api_entry,node_authentication toneAmber
class node_service_catalog,node_worker_profiles,node_locations,node_availability,node_matching,node_bookings,node_emergency,node_payments,node_ratings,node_notifications toneMint
class node_administration,node_forecasting,node_welfare,node_worker toneRose
class node_database,node_catalog_models,node_identity_models,node_transaction_models,node_customer,node_admin toneIndigo
```

## Components

### Client

- [Multilingual application](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/frontend/src/api.ts): `frontend/src/api.ts`

### API and security

- [REST API](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/auth.py): `backend/app/auth.py`

### Marketplace workflow

- [Service catalog](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/services.py): `backend/app/routers/services.py`
- [Worker profiles](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/workers.py): `backend/app/routers/workers.py`
- [Locations](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/locations.py): `backend/app/routers/locations.py`
- [Availability](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/availability.py): `backend/app/routers/availability.py`
- [Worker matching](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/matching.py): `backend/app/routers/matching.py`
- [Booking lifecycle](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/bookings.py): `backend/app/routers/bookings.py`
- [Emergency dispatch](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/emergency.py): `backend/app/routers/emergency.py`
- [Mock payments](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`
- [Ratings](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/ratings.py): `backend/app/routers/ratings.py`
- [Notifications](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/notifications.py): `backend/app/routers/notifications.py`

### Cooperative operations

- [Federation administration](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Demand forecasting](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/services/forecasting.py): `backend/app/services/forecasting.py`
- [Worker welfare](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/routers/workers.py): `backend/app/routers/workers.py`

### Persistence

- [Database sessions](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/database.py): `backend/app/database.py`
- [Catalog and availability models](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/catalog.py): `backend/app/models/catalog.py`
- [Identity and worker models](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/identity.py): `backend/app/models/identity.py`
- [Booking and transaction models](https://github.com/ayyamrevanth/cooperative-gig-platform/blob/main/backend/app/models/transactions.py): `backend/app/models/transactions.py`

### Other components

- **Customer**
- **Worker**
- **Cooperative admin**

## Connections

- Customer → Multilingual application: uses (evidence: `README.md`)
- Worker → Multilingual application: uses (evidence: `README.md`)
- Cooperative admin → Multilingual application: uses (evidence: `README.md`)
- Multilingual application → API client: requests through
- API client → REST API: calls (evidence: `README.md`)
- REST API → Authentication: routes protected requests
- REST API → Service catalog: registers (evidence: `backend/app/main.py`)
- REST API → Worker profiles: registers (evidence: `backend/app/main.py`)
- REST API → Locations: registers (evidence: `backend/app/main.py`)
- REST API → Availability: registers (evidence: `backend/app/main.py`)
- REST API → Worker matching: registers (evidence: `backend/app/main.py`)
- REST API → Booking lifecycle: registers (evidence: `backend/app/main.py`)
- REST API → Emergency dispatch: registers (evidence: `backend/app/main.py`)
- REST API → Mock payments: registers (evidence: `backend/app/main.py`)
- REST API → Ratings: registers (evidence: `backend/app/main.py`)
- REST API → Notifications: registers (evidence: `backend/app/main.py`)
- REST API → Federation administration: registers (evidence: `backend/app/main.py`)
- Service catalog → Worker matching: supplies service criteria (evidence: `README.md`)
- Worker profiles → Worker matching: supplies worker eligibility (evidence: `README.md`)
- Locations → Worker matching: supplies location (evidence: `README.md`)
- Availability → Worker matching: checks active slots (evidence: `README.md`)
- Worker matching → Booking lifecycle: selects worker for (evidence: `README.md`)
- Booking lifecycle → Notifications: triggers alerts (evidence: `README.md`)
- Emergency dispatch → Notifications: triggers alerts (evidence: `README.md`)
- Booking lifecycle → Mock payments: enables payment (evidence: `README.md`)
- Booking lifecycle → Ratings: enables review (evidence: `README.md`)
- Federation administration → Demand forecasting: requests forecasts (evidence: `backend/app/routers/admin.py`)
- Federation administration → Worker welfare: manages claims (evidence: `README.md`)
- Service catalog → Catalog and availability models: queries (evidence: `backend/app/routers/services.py`)
- Worker matching → Catalog and availability models: queries (evidence: `backend/app/routers/matching.py`)
- Availability → Catalog and availability models: uses availability records (evidence: `backend/app/routers/availability.py`)
- Worker profiles → Identity and worker models: queries worker records (evidence: `backend/app/routers/workers.py`)
- Worker matching → Identity and worker models: checks worker identity (evidence: `backend/app/routers/matching.py`)
- Booking lifecycle → Booking and transaction models: reads and writes bookings (evidence: `backend/app/routers/bookings.py`)
- Mock payments → Booking and transaction models: reads and writes payments (evidence: `backend/app/routers/payments.py`)
- Ratings → Booking and transaction models: reads and writes ratings (evidence: `backend/app/routers/ratings.py`)
- Notifications → Booking and transaction models: reads and writes notifications (evidence: `backend/app/routers/notifications.py`)
- Emergency dispatch → Booking and transaction models: reads and writes requests (evidence: `backend/app/routers/emergency.py`)
- Database sessions → Catalog and availability models: provides ORM base (evidence: `backend/app/models/catalog.py`)
- Database sessions → Identity and worker models: provides ORM base (evidence: `backend/app/models/identity.py`)
- Database sessions → Booking and transaction models: provides ORM base (evidence: `backend/app/models/transactions.py`)
