{"id":28533281,"url":"https://github.com/kibeno7/eMotion","last_synced_at":"2025-12-30T21:07:13.290Z","repository":{"id":298131062,"uuid":"998977425","full_name":"alucard017/eMotion","owner":"alucard017","description":"eMotion is a scalable, microservices-based ride-hailing platform featuring real-time ride notifications via WebSocket, robust service communication through RabbitMQ, and efficient request routing using Nginx as a reverse proxy. The backend is containerized with Docker Compose and deployed on Azure VM, while the frontend is hosted on Vercel.","archived":false,"fork":false,"pushed_at":"2025-06-26T05:21:16.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-07T19:45:41.081Z","etag":null,"topics":["docker","docker-compose","express","microservices","mongodb","nginx-proxy","nodejs","rabbitmq","typescript","websockets"],"latest_commit_sha":null,"homepage":"https://e-motion-eight.vercel.app","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alucard017.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-09T14:49:33.000Z","updated_at":"2025-06-26T05:21:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"01ad2cd7-3718-4d8c-b56a-de67672f4af2","html_url":"https://github.com/alucard017/eMotion","commit_stats":null,"previous_names":["alucard017/emotion"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alucard017/eMotion","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alucard017%2FeMotion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alucard017%2FeMotion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alucard017%2FeMotion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alucard017%2FeMotion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alucard017","download_url":"https://codeload.github.com/alucard017/eMotion/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alucard017%2FeMotion/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266127213,"owners_count":23880421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","express","microservices","mongodb","nginx-proxy","nodejs","rabbitmq","typescript","websockets"],"created_at":"2025-06-09T17:06:30.012Z","updated_at":"2025-12-30T21:07:13.245Z","avatar_url":"https://github.com/alucard017.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚡eMotion\r\n\r\n- **eMotion** is a scalable, event-driven ride-hailing platform built with Node.js, Express.js, MongoDB, WebSockets, and RabbitMQ.\r\n- It supports real time ride management with WebSocket notifications and microservice communication for a smooth user experience.\r\n\r\n---\r\n\r\n## 🔗 Architecture Overview\r\n\r\neMotion uses a microservices architecture featuring:\r\n\r\n- **Nginx** as a reverse proxy and load balancer.\r\n- **Docker Compose** to containerize and decouple services.\r\n- **RabbitMQ** for reliable message queuing and asynchronous communication.\r\n- **WebSocket server** for real-time ride event notifications.\r\n- **MongoDB** to store user, captain, and ride data.\r\n- **Multiple microservices** for User, Captain, Ride, and Central Websocket based Notification handling.\r\n\r\n### 🔗 Communication Flow\r\n\r\n1. Users and captains authenticate via JWT-secured REST endpoints.\r\n2. Ride requests are created and managed via REST APIs.\r\n3. Ride status updates (accept, start, end) are propagated via RabbitMQ events.\r\n4. WebSocket server pushes real-time notifications to users and captains.\r\n5. Nginx routes incoming requests to appropriate microservices.\r\n\r\n---\r\n\r\n## ⚙️ Tech Stack\r\n\r\n| Technology     | Purpose                                      |\r\n| -------------- | -------------------------------------------- |\r\n| Node.js        | Backend runtime                              |\r\n| Express.js     | REST API framework                           |\r\n| MongoDB        | Persistent data storage                      |\r\n| RabbitMQ       | Message queue for microservice communication |\r\n| WebSocket      | Real-time notifications                      |\r\n| Nginx          | Reverse proxy \u0026 load balancing               |\r\n| Docker Compose | Container orchestration                      |\r\n| Azure VM       | Hosting backend infrastructure               |\r\n| Vercel         | Frontend deployment                          |\r\n\r\n---\r\n\r\n## 🔗 Features\r\n\r\n- ✅ User \u0026 Captain registration and JWT authentication\r\n- ✅ REST APIs for ride creation, acceptance, start, and completion\r\n- ✅ Real-time ride event notifications via WebSocket with sub-10ms latency\r\n- ✅ Reliable, decoupled microservices communication using RabbitMQ\r\n- ✅ Scalable multi-instance backend containerized with Docker Compose\r\n- ✅ Nginx reverse proxy managing load balancing between services\r\n\r\n---\r\n\r\n## 🔗 Performance Metrics from Load Testing\r\n\r\n- Successfully handled **306+ concurrent WebSocket sessions** with average connection latency under **10ms**\r\n- Supported over **393 ride event checks** with **74% success rate** at peak load (15 VUs, 8 mins)\r\n- Average HTTP request duration: **~11.5 seconds**, median: **1.78 seconds** under stress\r\n- Maintained **100% successful user and captain logins** during tests\r\n- RabbitMQ ensured reliable asynchronous messaging with minimal overhead and zero message loss\r\n- Dockerized microservices maintained clear separation and easy scaling in Azure VM environment\r\n\r\n---\r\n\r\n## 🛠️ Deployment \u0026 Setup\r\n\r\n- Frontend is currently hosted on `https://e-motion-eight.vercel.app`\r\n- Backend is currently hosted on `https://distros.tech`\r\n\r\n### 1. Prerequisites\r\n\r\n- Docker \u0026 Docker Compose installed\r\n- Azure Virtual Machine for backend deployment\r\n- Nginx installed on VM as reverse proxy\r\n- MongoDB instance (can be hosted or containerized)\r\n- RabbitMQ instance running (can be containerized)\r\n- Vercel account for frontend hosting\r\n\r\n### 2. Clone the repository\r\n\r\n```bash\r\ngit clone https://github.com/alucard017/eMotion-Backend.git\r\ncd eMotion-Backend\r\n\r\ngit clone https://github.com/alucard017/eMotion-frontend.git\r\ncd eMotion-frontend\r\n```\r\n\r\n### 3. Configure environment variables\r\n\r\n- Create a `.env` file inside each user, ride, captain services following `.env.sample` with values like:\r\n- Creating `.env` is optional if you want to directly provide `environments` via `docker-compose`.\r\n- If not using docker-compose you need to run the` gateway server` or else if using docker-compose you need to run `nginx` and configure `nginx.conf `as given as sample.\r\n- `docker-compose file sample` is also provided to follow the structure strictly.\r\n\r\n### 4. Running services\r\n\r\n- For frontend it will be running on `localhost:3000` if `3000` port is not available it will run in port `3001` alterntaively.\r\n- Make sure to add `.env `variable in frontend too and make sure to use the `API_BASE_UR`L of backend to make API calls. Currently frontend assumes the request comes from hosted frontend and backend so `API_BASE_URL` is ignored.\r\n- For backend if not using docker-compose simply go to `each service folders` and run.\r\n\r\n```bash\r\nnpm run build\r\nnpm run start\r\n```\r\n\r\n- Service will start successfuly.\r\n- Make sure that all services will be connected via `gateway server`.\r\n- If using docker-compose then just run the below command\r\n\r\n```bash\r\ndocker-compose up --build -d\r\n```\r\n\r\n- You can see the logs by\r\n\r\n```bash\r\ndocker compose logs -f\r\n```\r\n\r\n- Make sure when using `docker-compose`, place `nginx.conf` as in the `same file` where docker-compose lies.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibeno7%2FeMotion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkibeno7%2FeMotion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkibeno7%2FeMotion/lists"}