# privex-chat/naukrisaathi architecture

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

- Interactive diagram: https://gitdiagram.com/privex-chat/naukrisaathi
- Repository: https://github.com/privex-chat/naukrisaathi

## Overview

NaukriSaathi is a WhatsApp-native hyperlocal labour marketplace. Workers register through conversational text or voice; employers describe a staffing need, and the bot returns nearby workers ranked with trust and profile signals. The graph also preserves verification, ratings, retention messaging, and the admin dashboard as distinct product capabilities. Relationships are based on README statements and SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`naukrisaathi/bot/worker_flow.py`](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/worker_flow.py) (Worker registration), [`naukrisaathi/integrations/whatsapp.py`](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/whatsapp.py) (WhatsApp gateway), [`naukrisaathi/integrations/supabase_client.py`](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/supabase_client.py) (Marketplace data), [`naukrisaathi/bot/employer_flow.py`](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/employer_flow.py) (Employer search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["WhatsApp entry"]
  node_backend["API backend<br/>[main.py]"]
  node_router["Message router<br/>[router.py]"]
  node_messages["Localized messages<br/>[messages.py]"]
end

subgraph group_workflows["Marketplace workflows"]
  node_worker_flow["Worker registration<br/>[worker_flow.py]"]
  node_employer_flow["Employer search<br/>[employer_flow.py]"]
  node_voice["Voice processing<br/>[voice_pipeline.py]"]
end

subgraph group_intelligence["Matching intelligence"]
  node_matching["Worker matching<br/>[engine.py]"]
  node_entities["Entity extraction"]
  node_taxonomy["Skill taxonomy<br/>[skills_taxonomy.py]"]
  node_embeddings["Semantic embeddings"]
  node_geography["Geo-distance<br/>[geo_service.py]"]
end

subgraph group_platform["Data and integrations"]
  node_database[("Marketplace data<br/>[supabase_client.py]")]
  node_wa_gateway["WhatsApp gateway<br/>[whatsapp.py]"]
  node_evolution["Evolution API"]
  node_meta["Meta Cloud API<br/>[meta_client.py]"]
end

subgraph group_operations["Trust and operations"]
  node_admin["Admin dashboard<br/>[routes.py]"]
  node_payments["Payment integration<br/>[razorpay_client.py]"]
  node_retention["Retention automation"]
  node_analytics["Analytics utilities<br/>[analytics.py]"]
end

node_worker(("Worker"))
node_employer(("Employer"))
node_whatsapp_user["WhatsApp"]
node_llm["Language model APIs"]
node_supabase[("Supabase")]
node_nominatim["Nominatim"]

node_worker -->|"messages"| node_whatsapp_user
node_employer -->|"searches"| node_whatsapp_user
node_whatsapp_user -->|"sends webhook"| node_backend
node_backend -->|"dispatches"| node_router
node_router -->|"routes registration"| node_worker_flow
node_router -->|"routes search"| node_employer_flow
node_router -->|"uses templates"| node_messages
node_worker_flow -->|"formats replies"| node_messages
node_employer_flow -->|"formats replies"| node_messages
node_worker_flow -->|"extracts profile"| node_entities
node_employer_flow -->|"extracts query"| node_entities
node_entities -->|"requests extraction"| node_llm
node_worker_flow -->|"normalizes skills"| node_taxonomy
node_entities -->|"maps skills"| node_taxonomy
node_worker_flow -->|"handles voice notes"| node_voice
node_voice -->|"transcribes audio"| node_llm
node_worker_flow -->|"saves profiles"| node_database
node_worker_flow -->|"embeds profiles"| node_embeddings
node_employer_flow -->|"requests candidates"| node_matching
node_matching -->|"canonicalizes query"| node_taxonomy
node_matching -->|"embeds query"| node_embeddings
node_matching -->|"filters distance"| node_geography
node_matching -->|"queries workers"| node_database
node_geography -->|"geocodes locations"| node_nominatim
node_database -->|"reads and writes"| node_supabase
node_backend -->|"initializes messaging"| node_wa_gateway
node_router -->|"sends replies"| node_wa_gateway
node_wa_gateway -->|"delegates by mode"| node_evolution
node_wa_gateway -->|"delegates by mode"| node_meta
node_backend -->|"mounts dashboard"| node_admin
node_admin -->|"loads dashboard data"| node_database
node_admin -->|"onboards workers"| node_wa_gateway
node_employer_flow -->|"offers paid search"| node_payments
node_employer_flow -.->|"records ratings follow-up"| node_database
node_retention -->|"selects follow-ups"| node_database
node_retention -->|"sends notifications"| node_wa_gateway
node_retention -->|"sends reminders"| node_wa_gateway
node_admin -->|"computes analytics"| node_analytics
node_analytics -->|"reads event data"| node_database

click node_backend "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/main.py"
click node_router "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/router.py"
click node_messages "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/messages.py"
click node_worker_flow "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/worker_flow.py"
click node_employer_flow "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/employer_flow.py"
click node_voice "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/voice_pipeline.py"
click node_matching "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/matching/engine.py"
click node_entities "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/entity_extractor.py"
click node_taxonomy "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/skills_taxonomy.py"
click node_embeddings "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/embedding_service.py"
click node_geography "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/geo_service.py"
click node_database "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/supabase_client.py"
click node_wa_gateway "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/whatsapp.py"
click node_evolution "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/evolution_client.py"
click node_meta "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/meta_client.py"
click node_admin "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/admin/routes.py"
click node_payments "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/razorpay_client.py"
click node_retention "https://github.com/privex-chat/naukrisaathi/tree/main/naukrisaathi/scripts"
click node_analytics "https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/utils/analytics.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_backend,node_router,node_messages toneBlue
class node_worker_flow,node_employer_flow,node_voice,node_supabase toneAmber
class node_matching,node_entities,node_taxonomy,node_embeddings,node_geography,node_llm toneMint
class node_database,node_wa_gateway,node_evolution,node_meta,node_worker toneRose
class node_admin,node_payments,node_retention,node_analytics,node_employer,node_whatsapp_user,node_nominatim toneIndigo
```

## Components

### WhatsApp entry

- [API backend](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/main.py): `naukrisaathi/main.py`
- [Message router](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/router.py): `naukrisaathi/bot/router.py`
- [Localized messages](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/messages.py): `naukrisaathi/bot/messages.py`

### Marketplace workflows

- [Worker registration](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/worker_flow.py): `naukrisaathi/bot/worker_flow.py`
- [Employer search](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/bot/employer_flow.py): `naukrisaathi/bot/employer_flow.py`
- [Voice processing](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/voice_pipeline.py): `naukrisaathi/intelligence/voice_pipeline.py`

### Matching intelligence

- [Worker matching](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/matching/engine.py): `naukrisaathi/matching/engine.py`
- [Entity extraction](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/entity_extractor.py): `naukrisaathi/intelligence/entity_extractor.py`
- [Skill taxonomy](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/skills_taxonomy.py): `naukrisaathi/intelligence/skills_taxonomy.py`
- [Semantic embeddings](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/embedding_service.py): `naukrisaathi/intelligence/embedding_service.py`
- [Geo-distance](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/intelligence/geo_service.py): `naukrisaathi/intelligence/geo_service.py`

### Data and integrations

- [Marketplace data](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/supabase_client.py): `naukrisaathi/integrations/supabase_client.py`
- [WhatsApp gateway](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/whatsapp.py): `naukrisaathi/integrations/whatsapp.py`
- [Evolution API](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/evolution_client.py): `naukrisaathi/integrations/evolution_client.py`
- [Meta Cloud API](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/meta_client.py): `naukrisaathi/integrations/meta_client.py`

### Trust and operations

- [Admin dashboard](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/admin/routes.py): `naukrisaathi/admin/routes.py`
- [Payment integration](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/integrations/razorpay_client.py): `naukrisaathi/integrations/razorpay_client.py`
- [Retention automation](https://github.com/privex-chat/naukrisaathi/tree/main/naukrisaathi/scripts): `naukrisaathi/scripts`
- [Analytics utilities](https://github.com/privex-chat/naukrisaathi/blob/main/naukrisaathi/utils/analytics.py): `naukrisaathi/utils/analytics.py`

### Other components

- **Worker**
- **Employer**
- **WhatsApp**
- **Language model APIs**
- **Supabase**
- **Nominatim**

## Connections

- Worker → WhatsApp: messages (evidence: `README.md`)
- Employer → WhatsApp: searches (evidence: `README.md`)
- WhatsApp → API backend: sends webhook (evidence: `README.md`)
- API backend → Message router: dispatches (evidence: `naukrisaathi/main.py`)
- Message router → Worker registration: routes registration (evidence: `naukrisaathi/bot/router.py`)
- Message router → Employer search: routes search (evidence: `naukrisaathi/bot/router.py`)
- Message router → Localized messages: uses templates (evidence: `naukrisaathi/bot/router.py`)
- Worker registration → Localized messages: formats replies (evidence: `naukrisaathi/bot/worker_flow.py`)
- Employer search → Localized messages: formats replies (evidence: `naukrisaathi/bot/employer_flow.py`)
- Worker registration → Entity extraction: extracts profile (evidence: `naukrisaathi/bot/worker_flow.py`)
- Employer search → Entity extraction: extracts query (evidence: `naukrisaathi/bot/employer_flow.py`)
- Entity extraction → Language model APIs: requests extraction (evidence: `naukrisaathi/intelligence/entity_extractor.py`)
- Worker registration → Skill taxonomy: normalizes skills (evidence: `naukrisaathi/bot/worker_flow.py`)
- Entity extraction → Skill taxonomy: maps skills (evidence: `naukrisaathi/intelligence/entity_extractor.py`)
- Worker registration → Voice processing: handles voice notes
- Voice processing → Language model APIs: transcribes audio (evidence: `naukrisaathi/intelligence/voice_pipeline.py`)
- Worker registration → Marketplace data: saves profiles (evidence: `naukrisaathi/bot/worker_flow.py`)
- Worker registration → Semantic embeddings: embeds profiles (evidence: `naukrisaathi/bot/worker_flow.py`)
- Employer search → Worker matching: requests candidates (evidence: `naukrisaathi/bot/employer_flow.py`)
- Worker matching → Skill taxonomy: canonicalizes query (evidence: `naukrisaathi/matching/engine.py`)
- Worker matching → Semantic embeddings: embeds query (evidence: `naukrisaathi/matching/engine.py`)
- Worker matching → Geo-distance: filters distance (evidence: `naukrisaathi/matching/engine.py`)
- Worker matching → Marketplace data: queries workers (evidence: `naukrisaathi/matching/engine.py`)
- Geo-distance → Nominatim: geocodes locations (evidence: `naukrisaathi/intelligence/geo_service.py`)
- Marketplace data → Supabase: reads and writes (evidence: `naukrisaathi/integrations/supabase_client.py`)
- API backend → WhatsApp gateway: initializes messaging (evidence: `naukrisaathi/main.py`)
- Message router → WhatsApp gateway: sends replies (evidence: `naukrisaathi/bot/router.py`)
- WhatsApp gateway → Evolution API: delegates by mode (evidence: `naukrisaathi/integrations/whatsapp.py`)
- WhatsApp gateway → Meta Cloud API: delegates by mode (evidence: `naukrisaathi/integrations/whatsapp.py`)
- API backend → Admin dashboard: mounts dashboard (evidence: `naukrisaathi/main.py`)
- Admin dashboard → Marketplace data: loads dashboard data (evidence: `naukrisaathi/admin/routes.py`)
- Admin dashboard → WhatsApp gateway: onboards workers (evidence: `naukrisaathi/admin/routes.py`)
- Employer search → Payment integration: offers paid search (evidence: `naukrisaathi/bot/employer_flow.py`)
- Employer search → Marketplace data: records ratings follow-up (evidence: `naukrisaathi/bot/employer_flow.py`)
- Retention automation → Marketplace data: selects follow-ups (evidence: `naukrisaathi/scripts/send_followups.py`)
- Retention automation → WhatsApp gateway: sends notifications (evidence: `naukrisaathi/scripts/notify_workers.py`)
- Retention automation → WhatsApp gateway: sends reminders (evidence: `naukrisaathi/scripts/ping_workers.py`)
- Admin dashboard → Analytics utilities: computes analytics (evidence: `naukrisaathi/admin/routes.py`)
- Analytics utilities → Marketplace data: reads event data (evidence: `naukrisaathi/utils/analytics.py`)
