# alokkumar-gh/ecosetu architecture

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

- Interactive diagram: https://gitdiagram.com/alokkumar-gh/ecosetu
- Repository: https://github.com/alokkumar-gh/ecosetu

## Overview

EcoSetu is a multilingual e-waste circular-economy platform connecting citizens and informal collectors with recyclers, with sourcing, pricing, verified handovers, traceability and EPR-oriented administration. The principal workflow is collector material capture and lot creation, recycler sourcing/quotation, and a recorded handover with receipt. Mobile screens call backend APIs; voice and AI capabilities supplement that flow. Paths and links for backend voice, marketplace and persistence are based on the documented capabilities and tree; sampled excerpts do not establish every internal connection.

Main entry points: [`backend/src/app.js`](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/app.js) (REST API), [`mobile/src/App.tsx`](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/App.tsx) (Mobile app), [`backend/src/config/database.js`](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/config/database.js) (Platform database), [`mobile/src/navigation/RootNavigator.tsx`](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/navigation/RootNavigator.tsx) (Role navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile experience"]
  node_mobile_app["Mobile app<br/>[App.tsx]"]
  node_role_navigation["Role navigation<br/>[RootNavigator.tsx]"]
  node_collector_ui["Collector workflows"]
  node_recycler_ui["Recycler workflows"]
  node_mobile_api["API services<br/>[apiClient.js]"]
  node_mobile_voice["Voice interface<br/>[VoiceInput.tsx]"]
end

subgraph group_backend["Platform services"]
  node_backend_api["REST API<br/>[app.js]"]
  node_auth["Authentication<br/>[authService.js]"]
  node_lots_sourcing["Lots and sourcing"]
  node_quotes_matching["Quotes and matching<br/>[quoteService.js]"]
  node_price_board["Market pricing<br/>[priceService.js]"]
  node_database[("Platform database<br/>[database.js]")]
end

subgraph group_voice["Voice and intelligence"]
  node_eco_assistant["EcoSaathi assistant"]
  node_bhashini["BHASHINI services<br/>[index.js]"]
  node_ai_inference["Image classification<br/>[main.py]"]
end

subgraph group_governance["Governance and traceability"]
  node_handover["Digital handover<br/>[handoverService.js]"]
  node_traceability["Chain of custody<br/>[EcoTraceService.js]"]
  node_admin["Admin control center<br/>[adminController.js]"]
end

node_collector(("Collector"))
node_recycler(("Recycler"))
node_citizen(("Citizen"))
node_bhashini_service{{"BHASHINI API"}}

node_collector -->|"uses"| node_mobile_app
node_recycler -->|"uses"| node_mobile_app
node_citizen -->|"uses"| node_mobile_app
node_mobile_app -->|"opens"| node_role_navigation
node_role_navigation -->|"routes"| node_collector_ui
node_role_navigation -->|"routes"| node_recycler_ui
node_collector_ui -->|"requests"| node_mobile_api
node_recycler_ui -->|"requests"| node_mobile_api
node_mobile_api -->|"REST requests"| node_backend_api
node_backend_api -->|"dispatches auth"| node_auth
node_backend_api -->|"dispatches sourcing"| node_lots_sourcing
node_backend_api -->|"dispatches quotes"| node_quotes_matching
node_backend_api -->|"dispatches prices"| node_price_board
node_backend_api -->|"dispatches handover"| node_handover
node_backend_api -->|"dispatches admin"| node_admin
node_collector_ui -->|"captures speech"| node_mobile_voice
node_mobile_voice -->|"sends voice"| node_backend_api
node_mobile_app -->|"offers assistant"| node_eco_assistant
node_eco_assistant -->|"assistant requests"| node_backend_api
node_backend_api -->|"uses language services"| node_bhashini
node_bhashini -->|"speech and translation"| node_bhashini_service
node_backend_api -.->|"requests classification"| node_ai_inference
node_lots_sourcing -->|"persists records"| node_database
node_quotes_matching -->|"persists offers"| node_database
node_price_board -->|"reads rates"| node_database
node_handover -->|"records transfer"| node_database
node_handover -->|"records custody"| node_traceability
node_admin -->|"administers records"| node_database

click node_mobile_app "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/App.tsx"
click node_role_navigation "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/navigation/RootNavigator.tsx"
click node_collector_ui "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/screens/collector/CollectorMaterialCaptureScreen.tsx"
click node_recycler_ui "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/screens/recycler/RecyclerMarketplaceScreen.tsx"
click node_mobile_api "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/services/apiClient.js"
click node_mobile_voice "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/components/voice/VoiceInput.tsx"
click node_eco_assistant "https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/components/eco/EcoSaathiChatModal.tsx"
click node_backend_api "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/app.js"
click node_auth "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/authService.js"
click node_lots_sourcing "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/materialLotService.js"
click node_quotes_matching "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/quoteService.js"
click node_price_board "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/priceService.js"
click node_handover "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/handoverService.js"
click node_traceability "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/traceability/EcoTraceService.js"
click node_admin "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/controllers/adminController.js"
click node_database "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/config/database.js"
click node_bhashini "https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/bhashini/index.js"
click node_ai_inference "https://github.com/alokkumar-gh/ecosetu/blob/main/ai/src/main.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_mobile_app,node_role_navigation,node_collector_ui,node_recycler_ui,node_mobile_api,node_mobile_voice toneBlue
class node_backend_api,node_auth,node_lots_sourcing,node_quotes_matching,node_price_board,node_database toneAmber
class node_eco_assistant,node_bhashini,node_ai_inference,node_bhashini_service toneMint
class node_handover,node_traceability,node_admin toneRose
class node_collector,node_recycler,node_citizen toneIndigo
```

## Components

### Mobile experience

- [Mobile app](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/App.tsx): `mobile/src/App.tsx`
- [Role navigation](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/navigation/RootNavigator.tsx): `mobile/src/navigation/RootNavigator.tsx`
- [Collector workflows](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/screens/collector/CollectorMaterialCaptureScreen.tsx): `mobile/src/screens/collector/CollectorMaterialCaptureScreen.tsx`
- [Recycler workflows](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/screens/recycler/RecyclerMarketplaceScreen.tsx): `mobile/src/screens/recycler/RecyclerMarketplaceScreen.tsx`
- [API services](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/services/apiClient.js): `mobile/src/services/apiClient.js`
- [Voice interface](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/components/voice/VoiceInput.tsx): `mobile/src/components/voice/VoiceInput.tsx`

### Platform services

- [REST API](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/app.js): `backend/src/app.js`
- [Authentication](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/authService.js): `backend/src/services/authService.js`
- [Lots and sourcing](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/materialLotService.js): `backend/src/services/materialLotService.js`
- [Quotes and matching](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/quoteService.js): `backend/src/services/quoteService.js`
- [Market pricing](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/priceService.js): `backend/src/services/priceService.js`
- [Platform database](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/config/database.js): `backend/src/config/database.js`

### Voice and intelligence

- [EcoSaathi assistant](https://github.com/alokkumar-gh/ecosetu/blob/main/mobile/src/components/eco/EcoSaathiChatModal.tsx): `mobile/src/components/eco/EcoSaathiChatModal.tsx`
- [BHASHINI services](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/bhashini/index.js): `backend/src/services/bhashini/index.js`
- [Image classification](https://github.com/alokkumar-gh/ecosetu/blob/main/ai/src/main.py): `ai/src/main.py`

### Governance and traceability

- [Digital handover](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/handoverService.js): `backend/src/services/handoverService.js`
- [Chain of custody](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/services/traceability/EcoTraceService.js): `backend/src/services/traceability/EcoTraceService.js`
- [Admin control center](https://github.com/alokkumar-gh/ecosetu/blob/main/backend/src/controllers/adminController.js): `backend/src/controllers/adminController.js`

### Other components

- **Collector**
- **Recycler**
- **Citizen**
- **BHASHINI API**

## Connections

- Collector → Mobile app: uses
- Recycler → Mobile app: uses
- Citizen → Mobile app: uses
- Mobile app → Role navigation: opens
- Role navigation → Collector workflows: routes
- Role navigation → Recycler workflows: routes
- Collector workflows → API services: requests
- Recycler workflows → API services: requests
- API services → REST API: REST requests
- REST API → Authentication: dispatches auth
- REST API → Lots and sourcing: dispatches sourcing
- REST API → Quotes and matching: dispatches quotes
- REST API → Market pricing: dispatches prices
- REST API → Digital handover: dispatches handover
- REST API → Admin control center: dispatches admin
- Collector workflows → Voice interface: captures speech
- Voice interface → REST API: sends voice
- Mobile app → EcoSaathi assistant: offers assistant
- EcoSaathi assistant → REST API: assistant requests
- REST API → BHASHINI services: uses language services
- BHASHINI services → BHASHINI API: speech and translation
- REST API → Image classification: requests classification
- Lots and sourcing → Platform database: persists records
- Quotes and matching → Platform database: persists offers
- Market pricing → Platform database: reads rates
- Digital handover → Platform database: records transfer
- Digital handover → Chain of custody: records custody
- Admin control center → Platform database: administers records
