# rishiraj5495/mobile_repair architecture

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

- Interactive diagram: https://gitdiagram.com/rishiraj5495/mobile_repair
- Repository: https://github.com/rishiraj5495/mobile_repair

## Overview

RepairNow is a doorstep mobile-repair marketplace. Customers submit repair videos, receive AI validation and an assessment, book a nearby technician, pay, and follow booking progress; technicians handle requests and status updates. The graph preserves the documented discovery, reviews, notifications, payment, tracking, caching, and asynchronous-event capabilities. Some backend route wiring and integrations are documented but not shown in sampled source, so those relationships cite the README rather than implying that unsampled code was inspected.

Main entry points: [`routes/orders.js`](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/orders.js) (Order APIs), [`AI-Service/app.py`](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/app.py) (AI service API), [`app.js`](https://github.com/rishiraj5495/mobile_repair/blob/main/app.js) (Express application), [`Models/orders.js`](https://github.com/rishiraj5495/mobile_repair/blob/main/Models/orders.js) (Order records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Marketplace Backend"]
  node_express["Express application<br/>[app.js]"]
  node_booking["Booking APIs<br/>[booking.js]"]
  node_orders_api["Order APIs<br/>[orders.js]"]
  node_discovery["Technician discovery"]
  node_eta["Route and ETA<br/>[eta.js]"]
  node_reviews["Service reviews<br/>[ratings.js]"]
  node_ai_route["Video validation API<br/>[AI-flow.js]"]
end

subgraph group_ai["Video Assessment"]
  node_ai_service["AI service API<br/>[app.py]"]
  node_frames["Frame extraction<br/>[video_processor.py]"]
  node_vision["Visual analysis<br/>[visual_analyzer.py]"]
  node_audio["Audio extraction<br/>[audio_processor.py]"]
  node_speech["Speech recognition"]
  node_semantics["Transcript analysis"]
  node_decision["Video validation<br/>[decision_engine.py]"]
  node_assessment["Repair assessment<br/>[nebius_service.py]"]
end

subgraph group_data["Application State"]
  node_orders[("Order records<br/>[orders.js]")]
  node_shops[("Technician records<br/>[mobileShops.js]")]
  node_users[("Customer accounts<br/>[users.js]")]
  node_redis[("Redis cache<br/>[redis.js]")]
end

subgraph group_events["Dispatch and Updates"]
  node_payment["Razorpay webhook<br/>[razorpayWebhook.js]"]
  node_kafka["Booking event producer<br/>[kafka.js]"]
  node_consumer["Booking event consumer<br/>[kafkaConsumer.js]"]
  node_sockets["Live status and location<br/>[sockets.js]"]
  node_push["Push notifications<br/>[fcm.js]"]
end

node_customer(("Customer"))
node_technician(("Technician"))
node_razorpay_service["Razorpay"]
node_firebase["Firebase Cloud Messaging"]
node_maps["Google Maps APIs"]
node_mongo[("MongoDB")]

node_customer -->|"uses marketplace"| node_express
node_express -->|"routes bookings"| node_booking
node_express -->|"routes orders"| node_orders_api
node_express -->|"routes video validation"| node_ai_route
node_booking -->|"creates bookings"| node_orders
node_orders_api -->|"reads and updates"| node_orders
node_booking -->|"uses technician data"| node_shops
node_discovery -->|"searches nearby"| node_shops
node_customer -->|"finds technicians"| node_discovery
node_customer -->|"requests ETA"| node_eta
node_eta -->|"gets routes and distance"| node_maps
node_customer -->|"uploads repair video"| node_ai_route
node_ai_route -->|"submits video"| node_ai_service
node_ai_service -->|"extracts frames"| node_frames
node_ai_service -->|"extracts audio"| node_audio
node_ai_service -->|"analyzes frames"| node_vision
node_ai_service -->|"transcribes speech"| node_speech
node_ai_service -->|"analyzes transcript"| node_semantics
node_ai_service -->|"combines evidence"| node_decision
node_ai_service -->|"generates assessment"| node_assessment
node_ai_route -->|"stores assessment with order"| node_orders
node_customer -->|"pays and tracks booking"| node_orders_api
node_orders_api -->|"initiates payment"| node_razorpay_service
node_razorpay_service -->|"sends payment event"| node_payment
node_payment -->|"updates paid status"| node_orders
node_technician -->|"updates booking status"| node_orders_api
node_orders_api -->|"broadcasts status and location"| node_sockets
node_technician -->|"shares live location"| node_sockets
node_sockets -->|"sends live updates"| node_customer
node_orders_api -->|"publishes booking events"| node_kafka
node_kafka -->|"delivers events"| node_consumer
node_consumer -->|"loads booking"| node_orders
node_consumer -->|"triggers notification"| node_push
node_orders_api -->|"notifies on transitions"| node_push
node_push -->|"sends push message"| node_firebase
node_customer -->|"rates completed service"| node_reviews
node_express -->|"connects cache"| node_redis
node_orders_api -->|"caches order reads"| node_redis
node_express -->|"connects application data"| node_mongo
node_orders -->|"persists orders"| node_mongo
node_shops -->|"persists technician data"| node_mongo
node_users -->|"persists accounts"| node_mongo

click node_express "https://github.com/rishiraj5495/mobile_repair/blob/main/app.js"
click node_booking "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/booking.js"
click node_orders_api "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/orders.js"
click node_discovery "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/allNearbyTechnician.js"
click node_eta "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/eta.js"
click node_reviews "https://github.com/rishiraj5495/mobile_repair/blob/main/Models/ratings.js"
click node_ai_route "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/AI-flow.js"
click node_ai_service "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/app.py"
click node_frames "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/video_processor.py"
click node_vision "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/visual_analyzer.py"
click node_audio "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/audio_processor.py"
click node_speech "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/speech_processor.py"
click node_semantics "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/semantic_analyzer.py"
click node_decision "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/decision_engine.py"
click node_assessment "https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/nebius_service.py"
click node_orders "https://github.com/rishiraj5495/mobile_repair/blob/main/Models/orders.js"
click node_shops "https://github.com/rishiraj5495/mobile_repair/blob/main/Models/mobileShops.js"
click node_users "https://github.com/rishiraj5495/mobile_repair/blob/main/Models/users.js"
click node_redis "https://github.com/rishiraj5495/mobile_repair/blob/main/config/redis.js"
click node_payment "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/razorpayWebhook.js"
click node_kafka "https://github.com/rishiraj5495/mobile_repair/blob/main/config/kafka.js"
click node_consumer "https://github.com/rishiraj5495/mobile_repair/blob/main/config/kafkaConsumer.js"
click node_sockets "https://github.com/rishiraj5495/mobile_repair/blob/main/sockets.js"
click node_push "https://github.com/rishiraj5495/mobile_repair/blob/main/routes/fcm.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_express,node_booking,node_orders_api,node_discovery,node_eta,node_reviews,node_ai_route toneBlue
class node_ai_service,node_frames,node_vision,node_audio,node_speech,node_semantics,node_decision,node_assessment,node_mongo toneAmber
class node_orders,node_shops,node_users,node_redis,node_maps toneMint
class node_payment,node_kafka,node_consumer,node_sockets,node_push toneRose
class node_customer,node_technician,node_razorpay_service,node_firebase toneIndigo
```

## Components

### Marketplace Backend

- [Express application](https://github.com/rishiraj5495/mobile_repair/blob/main/app.js): `app.js`
- [Booking APIs](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/booking.js): `routes/booking.js`
- [Order APIs](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/orders.js): `routes/orders.js`
- [Technician discovery](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/allNearbyTechnician.js): `routes/allNearbyTechnician.js`
- [Route and ETA](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/eta.js): `routes/eta.js`
- [Service reviews](https://github.com/rishiraj5495/mobile_repair/blob/main/Models/ratings.js): `Models/ratings.js`
- [Video validation API](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/AI-flow.js): `routes/AI-flow.js`

### Video Assessment

- [AI service API](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/app.py): `AI-Service/app.py`
- [Frame extraction](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/video_processor.py): `AI-Service/services/video_processor.py`
- [Visual analysis](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/visual_analyzer.py): `AI-Service/services/visual_analyzer.py`
- [Audio extraction](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/audio_processor.py): `AI-Service/services/audio_processor.py`
- [Speech recognition](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/speech_processor.py): `AI-Service/services/speech_processor.py`
- [Transcript analysis](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/semantic_analyzer.py): `AI-Service/services/semantic_analyzer.py`
- [Video validation](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/decision_engine.py): `AI-Service/services/decision_engine.py`
- [Repair assessment](https://github.com/rishiraj5495/mobile_repair/blob/main/AI-Service/services/nebius_service.py): `AI-Service/services/nebius_service.py`

### Application State

- [Order records](https://github.com/rishiraj5495/mobile_repair/blob/main/Models/orders.js): `Models/orders.js`
- [Technician records](https://github.com/rishiraj5495/mobile_repair/blob/main/Models/mobileShops.js): `Models/mobileShops.js`
- [Customer accounts](https://github.com/rishiraj5495/mobile_repair/blob/main/Models/users.js): `Models/users.js`
- [Redis cache](https://github.com/rishiraj5495/mobile_repair/blob/main/config/redis.js): `config/redis.js`

### Dispatch and Updates

- [Razorpay webhook](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/razorpayWebhook.js): `routes/razorpayWebhook.js`
- [Booking event producer](https://github.com/rishiraj5495/mobile_repair/blob/main/config/kafka.js): `config/kafka.js`
- [Booking event consumer](https://github.com/rishiraj5495/mobile_repair/blob/main/config/kafkaConsumer.js): `config/kafkaConsumer.js`
- [Live status and location](https://github.com/rishiraj5495/mobile_repair/blob/main/sockets.js): `sockets.js`
- [Push notifications](https://github.com/rishiraj5495/mobile_repair/blob/main/routes/fcm.js): `routes/fcm.js`

### Other components

- **Customer**
- **Technician**
- **Razorpay**
- **Firebase Cloud Messaging**
- **Google Maps APIs**
- **MongoDB**

## Connections

- Customer → Express application: uses marketplace
- Express application → Booking APIs: routes bookings (evidence: `app.js`)
- Express application → Order APIs: routes orders (evidence: `app.js`)
- Express application → Video validation API: routes video validation (evidence: `app.js`)
- Booking APIs → Order records: creates bookings (evidence: `routes/booking.js`)
- Order APIs → Order records: reads and updates (evidence: `routes/orders.js`)
- Booking APIs → Technician records: uses technician data (evidence: `routes/booking.js`)
- Technician discovery → Technician records: searches nearby (evidence: `routes/allNearbyTechnician.js`)
- Customer → Technician discovery: finds technicians
- Customer → Route and ETA: requests ETA
- Route and ETA → Google Maps APIs: gets routes and distance
- Customer → Video validation API: uploads repair video
- Video validation API → AI service API: submits video
- AI service API → Frame extraction: extracts frames (evidence: `AI-Service/app.py`)
- AI service API → Audio extraction: extracts audio (evidence: `AI-Service/app.py`)
- AI service API → Visual analysis: analyzes frames (evidence: `AI-Service/app.py`)
- AI service API → Speech recognition: transcribes speech (evidence: `AI-Service/app.py`)
- AI service API → Transcript analysis: analyzes transcript (evidence: `AI-Service/app.py`)
- AI service API → Video validation: combines evidence (evidence: `AI-Service/app.py`)
- AI service API → Repair assessment: generates assessment (evidence: `AI-Service/app.py`)
- Video validation API → Order records: stores assessment with order
- Customer → Order APIs: pays and tracks booking
- Order APIs → Razorpay: initiates payment
- Razorpay → Razorpay webhook: sends payment event
- Razorpay webhook → Order records: updates paid status (evidence: `routes/razorpayWebhook.js`)
- Technician → Order APIs: updates booking status
- Order APIs → Live status and location: broadcasts status and location
- Technician → Live status and location: shares live location
- Live status and location → Customer: sends live updates
- Order APIs → Booking event producer: publishes booking events (evidence: `routes/orders.js`)
- Booking event producer → Booking event consumer: delivers events (evidence: `config/kafkaConsumer.js`)
- Booking event consumer → Order records: loads booking (evidence: `config/kafkaConsumer.js`)
- Booking event consumer → Push notifications: triggers notification (evidence: `config/kafkaConsumer.js`)
- Order APIs → Push notifications: notifies on transitions
- Push notifications → Firebase Cloud Messaging: sends push message
- Customer → Service reviews: rates completed service
- Express application → Redis cache: connects cache (evidence: `app.js`)
- Order APIs → Redis cache: caches order reads (evidence: `routes/orders.js`)
- Express application → MongoDB: connects application data (evidence: `app.js`)
- Order records → MongoDB: persists orders
- Technician records → MongoDB: persists technician data
- Customer accounts → MongoDB: persists accounts
