{"id":26399353,"url":"https://github.com/tajwarsaiyeed/node-mongo-microservices-architecture","last_synced_at":"2026-04-07T08:01:35.717Z","repository":{"id":278028133,"uuid":"921760360","full_name":"TajwarSaiyeed/node-mongo-microservices-architecture","owner":"TajwarSaiyeed","description":"This project is a Node.js microservices-based application that consists of multiple services: User, Captain, Ride, and Gateway. Each service is responsible for a specific domain and communicates with others using RabbitMQ for messaging.","archived":false,"fork":false,"pushed_at":"2025-02-17T15:24:59.000Z","size":86,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-21T08:00:04.019Z","etag":null,"topics":["amqplib","bcrypt","cookie-parser","dotenv","expressjs","jsonwebtoken","mongoose","nodejs","rabbitmq"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TajwarSaiyeed.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-01-24T15:08:04.000Z","updated_at":"2025-02-17T15:25:03.000Z","dependencies_parsed_at":"2025-02-17T16:45:26.399Z","dependency_job_id":null,"html_url":"https://github.com/TajwarSaiyeed/node-mongo-microservices-architecture","commit_stats":null,"previous_names":["tajwarsaiyeed/node-mongo-microservices-architecture"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TajwarSaiyeed/node-mongo-microservices-architecture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TajwarSaiyeed%2Fnode-mongo-microservices-architecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TajwarSaiyeed%2Fnode-mongo-microservices-architecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TajwarSaiyeed%2Fnode-mongo-microservices-architecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TajwarSaiyeed%2Fnode-mongo-microservices-architecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TajwarSaiyeed","download_url":"https://codeload.github.com/TajwarSaiyeed/node-mongo-microservices-architecture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TajwarSaiyeed%2Fnode-mongo-microservices-architecture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31504897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["amqplib","bcrypt","cookie-parser","dotenv","expressjs","jsonwebtoken","mongoose","nodejs","rabbitmq"],"created_at":"2025-03-17T13:19:35.420Z","updated_at":"2026-04-07T08:01:35.693Z","avatar_url":"https://github.com/TajwarSaiyeed.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js Microservices Project\n\nThis project is a Node.js microservices-based application that consists of multiple services: User, Captain, Ride, and Gateway. Each service is responsible for a specific domain and communicates with others using RabbitMQ for messaging.\n\n## Services\n\n1. **User Service**: Manages user registration, login, profile, and ride acceptance.\n2. **Captain Service**: Manages captain registration, login, profile, availability, and ride acceptance.\n3. **Ride Service**: Manages ride creation and acceptance.\n4. **Gateway Service**: Acts as an API gateway to route requests to the appropriate services.\n\n## Prerequisites\n\n- Docker\n- Docker Compose\n- Node.js (if running locally)\n- MongoDB (if running locally)\n\n## Setup\n\n### Environment Variables\n\nEach service requires specific environment variables. Create a `.env` file in each service directory with the following variables:\n\n- **User Service**:\n  ```\n  PORT=3001\n  MONGO_URI=\"mongodb://mongo:27017/user-db\"\n  JWT_SECRET=\"your_jwt_secret\"\n  RABBIT_MQ_URI=\"your_rabbitmq_uri\"\n  ```\n\n- **Captain Service**:\n  ```\n  PORT=3002\n  MONGO_URI=\"mongodb://mongo:27017/captain-db\"\n  JWT_SECRET=\"your_jwt_secret\"\n  RABBIT_MQ_URI=\"your_rabbitmq_uri\"\n  ```\n\n- **Ride Service**:\n  ```\n  PORT=3003\n  MONGO_URI=\"mongodb://mongo:27017/ride-db\"\n  JWT_SECRET=\"your_jwt_secret\"\n  BASE_URL=\"http://localhost:3000/api\"\n  RABBIT_MQ_URI=\"your_rabbitmq_uri\"\n  ```\n\n- **Gateway Service**:\n  ```\n  PORT=3000\n  USER_SERVICE_URL=\"http://user-service:3001\"\n  CAPTAIN_SERVICE_URL=\"http://captain-service:3002\"\n  RIDE_SERVICE_URL=\"http://ride-service:3003\"\n  ```\n\n### Running with Docker Compose\n\n1. Navigate to the project root directory.\n2. Run the following command to start all services:\n   ```sh\n   docker-compose up --build\n   ```\n\n### Running Locally\n\n1. Start MongoDB and RabbitMQ services.\n2. Navigate to each service directory and install dependencies:\n   ```sh\n   npm install\n   ```\n3. Start each service:\n   ```sh\n   npm start\n   ```\n\n## Usage\n\n### User Service\n\n- **Register**: `POST /api/user/register`\n- **Login**: `POST /api/user/login`\n- **Logout**: `GET /api/user/logout`\n- **Profile**: `GET /api/user/profile`\n- **Accepted Ride**: `GET /api/user/accepted-ride`\n\n### Captain Service\n\n- **Register**: `POST /api/captain/register`\n- **Login**: `POST /api/captain/login`\n- **Logout**: `GET /api/captain/logout`\n- **Profile**: `GET /api/captain/profile`\n- **Toggle Availability**: `PATCH /api/captain/toggle-availability`\n- **New Ride**: `GET /api/captain/new-ride`\n\n### Ride Service\n\n- **Create Ride**: `POST /api/ride/create-ride`\n- **Accept Ride**: `PUT /api/ride/accept-ride`\n\n### Gateway Service\n\nThe gateway service routes requests to the appropriate services:\n\n- **User Service**: `/api/user`\n- **Captain Service**: `/api/captain`\n- **Ride Service**: `/api/ride`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftajwarsaiyeed%2Fnode-mongo-microservices-architecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftajwarsaiyeed%2Fnode-mongo-microservices-architecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftajwarsaiyeed%2Fnode-mongo-microservices-architecture/lists"}