{"id":21334161,"url":"https://github.com/rishabh-kumar01/airline-api-gateway","last_synced_at":"2025-03-16T01:24:50.443Z","repository":{"id":250204703,"uuid":"833518811","full_name":"Rishabh-Kumar01/Airline-API-Gateway","owner":"Rishabh-Kumar01","description":"\"Air Connect: A microservice-based airline booking backend with API Gateway. Features authentication, booking, flight search, and reminder services. Implements routing and rate-limiting for efficient, secure operations.\"","archived":false,"fork":false,"pushed_at":"2024-07-25T19:12:27.000Z","size":47,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T14:22:11.987Z","etag":null,"topics":["api","api-gateway","backend","microservices","restful-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/Rishabh-Kumar01.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}},"created_at":"2024-07-25T08:10:46.000Z","updated_at":"2024-10-15T21:43:16.000Z","dependencies_parsed_at":"2024-07-25T21:48:02.634Z","dependency_job_id":"98205ca8-4333-4c89-adfd-230f54b02c38","html_url":"https://github.com/Rishabh-Kumar01/Airline-API-Gateway","commit_stats":null,"previous_names":["rishabh-kumar01/airline-api-gateway"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishabh-Kumar01%2FAirline-API-Gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishabh-Kumar01%2FAirline-API-Gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishabh-Kumar01%2FAirline-API-Gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rishabh-Kumar01%2FAirline-API-Gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rishabh-Kumar01","download_url":"https://codeload.github.com/Rishabh-Kumar01/Airline-API-Gateway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243811878,"owners_count":20351783,"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":["api","api-gateway","backend","microservices","restful-api"],"created_at":"2024-11-21T23:17:38.143Z","updated_at":"2025-03-16T01:24:50.417Z","avatar_url":"https://github.com/Rishabh-Kumar01.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Welcome to Airline API Gateway\n\n## GitHub repository links for the four services in this microservice architecture:\n\n- Auth Service -\n  [GitHub Repository Link](https://github.com/Rishabh-Kumar01/Auth-Service)\n- Flight and Search Service -\n  [GitHub Repository Link](https://github.com/Rishabh-Kumar01/FlightsAndSerachService)\n- Reminder Service -\n  [GitHub Repository Link](https://github.com/Rishabh-Kumar01/Reminder-Service)\n- Booking Service -\n  [GitHub Repository Link](https://github.com/Rishabh-Kumar01/BookingService)\n\n## Project Setup\n\n- Clone the project on your local\n- Execute `npm install` on the same path as of your root directory of the\n  downlaoded project\n- Create a `.env` file in the root directory and add the following environment\n  variable\n\n```\nPORT=8004\nAUTH_SERVICE_URL=\"http://localhost:8001\"\nFLIGHT_AND_SEARCH_SERVICE_URL=\"http://localhost:8000\"\nREMINDER_SERVICE_URL=\"http://localhost:8003\"\nBOOKING_SERVICE_URL=\"http://localhost:8002\"\nAUTH_SERVICE_PATH=\"/authservice\"\nFLIGHT_AND_SEARCH_SERVICE_PATH=\"/flightandsearchservice\"\nREMINDER_SERVICE_PATH=\"/reminderservice\"\nBOOKING_SERVICE_PATH=\"/bookingservice\"\n```\n\n## Features\n\n### HTTP Proxy Middleware\n\n- The API Gateway uses the `http-proxy-middleware` library to create a reverse\n  proxy. This allows the gateway to forward incoming requests to various\n  microservices based on the request path.\n- Configured paths and their corresponding target URLs are:\n  - Auth Service: `${AUTH_SERVICE_PATH}` -\u003e `${AUTH_SERVICE_URL}`\n  - Booking Service: `${BOOKING_SERVICE_PATH}` -\u003e `${BOOKING_SERVICE_URL}`\n  - Reminder Service: `${REMINDER_SERVICE_PATH}` -\u003e `${REMINDER_SERVICE_URL}`\n  - Flight and Search Service: `${FLIGHT_AND_SEARCH_SERVICE_PATH}` -\u003e\n    `${FLIGHT_AND_SEARCH_SERVICE_URL}`\n\n### Rate Limiting\n\n- The API Gateway implements rate limiting using the `express-rate-limit`\n  library to prevent abuse and ensure fair usage of resources.\n- The rate limiter is configured to allow a maximum of 5 requests per minute\n  from a single IP address. Exceeding this limit will result in a\n  `429 Too Many Requests` response with a message indicating to try again after\n  15 minutes.\n\n### Additional Features\n\n- **IP Logging:** The gateway logs the IP address of each incoming request for\n  monitoring and security purposes.\n- **Compression:** Using `compression` middleware to gzip compress responses for\n  improved performance.\n- **Request Logging:** Using `morgan` to log HTTP requests for debugging and\n  monitoring.\n\n## Running the API Gateway\n\n- Start the API Gateway using the following command `npm start`\n\n## Running the pm2 server\n\n- \"pm2:start\": \"pm2 start src/server.js --name airline-api-gateway\",\n- \"pm2:stop\": \"pm2 stop airline-api-gateway\",\n- \"pm2:delete\": \"pm2 delete airline-api-gateway\"\n\n### Then the run the command `npm run pm2:start` to start the pm2 server and so on to stop and delete.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh-kumar01%2Fairline-api-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frishabh-kumar01%2Fairline-api-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frishabh-kumar01%2Fairline-api-gateway/lists"}