# anshika-75/ride-booking-system- architecture

> Architecture diagram of the GitHub repository anshika-75/ride-booking-system-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anshika-75/ride-booking-system-
- Repository: https://github.com/anshika-75/ride-booking-system-

## Overview

##### Project type and purpose
- This “Ride-Booking-System” is a microservices-based backend application written in Node.js/Express.
- Its purpose is to handle all aspects of a ride-booking workflow: user management, captain (driver) management, ride requests, and an API gateway for external clients.

##### File structure
- Top-level directories:
- captain/ – the driver (“captain”) microservice
- ride/ – the main ride orchestration microservice
- user/ – the user account microservice
- gateway/ – the API gateway that fronts all services
- Common subfolders in each service:
- controllers/ – HTTP handler functions
- routes/ – Express routing definitions
- db/ – database connection setup
- models/ – data schemas (e.g. Mongoose models)
- middleware/ – e.g. auth middleware, token blacklisting
- service/rabbit.js – integration with RabbitMQ for pub/sub messaging
- Each microservice has its own package.json and server.js (entrypoint), indicating each runs independently.

##### README
- Minimal content, but the name “Ride-Booking-System” confirms domain.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "External Clients"
        Mobile["Mobile App"]:::clients
        Web["Web App"]:::clients
    end

    Mobile -->|"HTTP API"| Gateway["API Gateway"]:::gateway
    Web -->|"HTTP API"| Gateway

    Gateway -->|"REST"| UserSvc["User Service"]:::service
    Gateway -->|"REST"| CaptainSvc["Captain Service"]:::service
    Gateway -->|"REST"| RideSvc["Ride Service"]:::service

    UserSvc -->|"Read/Write"| UserDB["User DB"]:::db
    CaptainSvc -->|"Read/Write"| CaptainDB["Captain DB"]:::db
    RideSvc -->|"Read/Write"| RideDB["Ride DB"]:::db

    RideSvc -->|"publish events"| Rabbit["RabbitMQ"]:::broker
    Rabbit -->|"consume events"| UserSvc
    Rabbit -->|"consume events"| CaptainSvc

    click Gateway "https://github.com/anshika-75/ride-booking-system-/tree/main/gateway/"
    click UserSvc "https://github.com/anshika-75/ride-booking-system-/tree/main/user/"
    click CaptainSvc "https://github.com/anshika-75/ride-booking-system-/tree/main/captain/"
    click RideSvc "https://github.com/anshika-75/ride-booking-system-/tree/main/ride/"

    classDef gateway fill:#a2f5a2,stroke:#000
    classDef service fill:#a2dfff,stroke:#000
    classDef db fill:#ffddb3,stroke:#000
    classDef broker fill:#f5a2a2,stroke:#000
    classDef clients fill:#d5a2f5,stroke:#000
```
