- eMotion is a scalable, event-driven ride-hailing platform built with Node.js, Express.js, MongoDB, WebSockets, and RabbitMQ.
- It supports real time ride management with WebSocket notifications and microservice communication for a smooth user experience.
eMotion uses a microservices architecture featuring:
- Nginx as a reverse proxy and load balancer.
- Docker Compose to containerize and decouple services.
- RabbitMQ for reliable message queuing and asynchronous communication.
- WebSocket server for real-time ride event notifications.
- MongoDB to store user, captain, and ride data.
- Multiple microservices for User, Captain, Ride, and Central Websocket based Notification handling.
- Users and captains authenticate via JWT-secured REST endpoints.
- Ride requests are created and managed via REST APIs.
- Ride status updates (accept, start, end) are propagated via RabbitMQ events.
- WebSocket server pushes real-time notifications to users and captains.
- Nginx routes incoming requests to appropriate microservices.
| Technology | Purpose |
|---|---|
| Node.js | Backend runtime |
| Express.js | REST API framework |
| MongoDB | Persistent data storage |
| RabbitMQ | Message queue for microservice communication |
| WebSocket | Real-time notifications |
| Nginx | Reverse proxy & load balancing |
| Docker Compose | Container orchestration |
| Azure VM | Hosting backend infrastructure |
| Vercel | Frontend deployment |
- ✅ User & Captain registration and JWT authentication
- ✅ REST APIs for ride creation, acceptance, start, and completion
- ✅ Real-time ride event notifications via WebSocket with sub-10ms latency
- ✅ Reliable, decoupled microservices communication using RabbitMQ
- ✅ Scalable multi-instance backend containerized with Docker Compose
- ✅ Nginx reverse proxy managing load balancing between services
- Successfully handled 306+ concurrent WebSocket sessions with average connection latency under 10ms
- Supported over 393 ride event checks with 74% success rate at peak load (15 VUs, 8 mins)
- Average HTTP request duration: ~11.5 seconds, median: 1.78 seconds under stress
- Maintained 100% successful user and captain logins during tests
- RabbitMQ ensured reliable asynchronous messaging with minimal overhead and zero message loss
- Dockerized microservices maintained clear separation and easy scaling in Azure VM environment
- Frontend is currently hosted on
https://e-motion-eight.vercel.app - Backend is currently hosted on
https://distros.tech
- Docker & Docker Compose installed
- Azure Virtual Machine for backend deployment
- Nginx installed on VM as reverse proxy
- MongoDB instance (can be hosted or containerized)
- RabbitMQ instance running (can be containerized)
- Vercel account for frontend hosting
git clone https://github.com/alucard017/eMotion-Backend.git
cd eMotion-Backend
git clone https://github.com/alucard017/eMotion-frontend.git
cd eMotion-frontend- Create a
.envfile inside each user, ride, captain services following.env.samplewith values like: - Creating
.envis optional if you want to directly provideenvironmentsviadocker-compose. - If not using docker-compose you need to run the
gateway serveror else if using docker-compose you need to runnginxand configurenginx.confas given as sample. docker-compose file sampleis also provided to follow the structure strictly.
- For frontend it will be running on
localhost:3000if3000port is not available it will run in port3001alterntaively. - Make sure to add
.envvariable in frontend too and make sure to use theAPI_BASE_URL of backend to make API calls. Currently frontend assumes the request comes from hosted frontend and backend soAPI_BASE_URLis ignored. - For backend if not using docker-compose simply go to
each service foldersand run.
npm run build
npm run start- Service will start successfuly.
- Make sure that all services will be connected via
gateway server. - If using docker-compose then just run the below command
docker-compose up --build -d- You can see the logs by
docker compose logs -f- Make sure when using
docker-compose, placenginx.confas in thesame filewhere docker-compose lies.