This project is a cloud-native API Gateway designed to serve as a central point for routing, securing, and monitoring API traffic in a microservices architecture. It provides seamless integration with multiple backend services, real-time analytics, and scalability features. The gateway routes requests to microservices like customer-service
, order-service
, and product-service
while ensuring security, rate limiting, and centralized monitoring.
- API Management:
- Authentication and Authorization using OAuth 2.0 and JWT.
- Rate limiting to manage client quotas.
- Auto-generated API documentation using Swagger/OpenAPI.
- Real-Time Monitoring:
- Traffic metrics such as request count, response time, and error rates.
- User-friendly dashboard built with React.
- Alerts for unusual traffic spikes or high error rates.
- Scalability:
- Containerized services using Docker.
- Kubernetes orchestration for horizontal scaling.
- Dynamic service discovery with Consul/Eureka.
- Logging & Tracing:
- Centralized logging using ELK Stack (Elasticsearch, Logstash, Kibana).
- Distributed tracing with Jaeger/Zipkin.
- Install Docker and Docker Compose.
- Install Java JDK (11 or higher).
- Install Node.js.
- Install Kubernetes CLI (kubectl).
- Clone the repository:
git clone https://github.com/Chamod07/API-Gateway.git
cd API-Gateway
- Build the services:
./mvnw clean install
- Start the services using Docker Compose:
docker-compose up --build
- Access the API Gateway at
http://localhost:8080
.
The gateway routes requests to the following microservices:
customer-service
:http://localhost:8081/api/customers/**
order-service
:http://localhost:8082/api/orders/**
product-service
:http://localhost:8083/api/products/**
Example request via Postman or curl:
curl http://localhost:8080/api/customers/1
- Prometheus metrics are available at
/actuator/prometheus
. - Access logs in Kibana by connecting to Elasticsearch.
- Customer Service: Manages customer data.
- Order Service: Handles order processing.
- Product Service: Manages product catalog.
- Centralized routing and security.
- Real-time traffic monitoring.
- Visualizes system health and traffic metrics.
I welcome contributions! To contribute:
- Fork this repository.
- Create a new branch for your feature or bug fix:
git checkout -b feature-name
- Commit your changes and push them to your forked repository.
- Submit a pull request with a detailed description of your changes.
This project is licensed under the Apache License. See the LICENSE file for details.
Screenshots of the dashboard or API usage examples here.
For detailed documentation on API endpoints, refer to the Swagger/OpenAPI documentation available at /swagger-ui.html
.
Version | Date | Changes |
---|---|---|
v1.0 | Dec 2024 | Initial release with core features |