How titiksha1102/microservice-ride-booking-app works
Project type and purpose
• TezzRides is a full-stack, real-time ride-booking application built on a modular microservices architecture.
• It consists of multiple standalone Node.js/Express services (User, Captain, Ride), a React frontend, MongoDB databases, RabbitMQ for saga workflow, and Socket.IO for live updates.
File structure
• Top-level directories:
• CaptainService, RideService, UserService, SubscriberService (microservices)
• Frontend/uber-clone-frontend (React frontend)
• Root docker-compose.yaml orchestrates all services together.
• Each service includes controllers, routes, models, middleware, a RabbitMQ integration module, and its own Dockerfile.
• A socket-server.js in CaptainService indicates real-time WebSocket handling.
README for additional insights
• Confirms use of the Saga pattern via RabbitMQ for distributed transaction management.
• Mentions an API Gateway (not explicitly in code but implied) for routing and security.
• Highlights Socket.IO for sub-second communication and responsive React UI.
a. Main components:
• React Frontend (User and Captain interfaces)
• API Gateway / Load Balancer
• User Service (Express + MongoDB)
• Captain Service (Express + MongoDB + Socket.IO)
• Ride Service (Express + MongoDB)
• Subscriber Service (event listener)
• RabbitMQ Broker (message queues for Saga pattern)
• MongoDB instances for each service
• External dependencies (e.g., geolocation API, payment gateway – if applicable)
b. Relationships and interactions:
• Frontend → API Gateway → respective microservice endpoints
• Services communicate state changes via RabbitMQ exchanges/queues (e.g., ride-requested, ride-accepted)
• Subscriber Service listens to events for analytics or notifications
• Captain Service pushes real-time updates to connected clients over WebSockets
• Each service performs CRUD operations against its own MongoDB database
c. Architectural patterns and design principles:
• Microservices: independently deployable services, each with its own data store
• Saga pattern: asynchronous, event-driven workflow management via RabbitMQ
• API Gateway: unified entry point, security (authentication middleware), request routing
• Separation of concerns: controllers, services, models, middleware layers clearly defined
d. Relevant technologies and frameworks:
• Node.js + Express.js for all backend services
• React.js + Vite for frontend
• MongoDB for data persistence
• RabbitMQ as the message broker
• Socket.IO for real-time messaging
• Docker & Docker Compose for containerization and orchestration