MicroGate is a custom-built API Gateway platform that demonstrates how modern distributed systems manage:
- Service Discovery
- Dynamic Routing
- Load Balancing
- JWT Authentication
- Rate Limiting
- Circuit Breaking
- Distributed Monitoring
- Request Tracing
- Observability
The project is designed to showcase infrastructure engineering concepts commonly found in production microservice environments.
MicroGate was built to understand and implement the core infrastructure components used in large-scale microservice architectures. In organizations where applications are composed of dozens of independent services, an API Gateway acts as the central entry point responsible for traffic management, service communication, security enforcement, fault tolerance, and system observability. This project recreates those responsibilities from scratch to demonstrate how production systems handle request routing, service discovery, load balancing, monitoring, and reliability at scale.
┌─────────────┐
│ Client │
└──────┬──────┘
│
▼
┌─────────────────────┐
│ API Gateway │
│ │
│ JWT Authentication │
│ Rate Limiting │
│ Service Registry │
│ Load Balancer │
│ Circuit Breaker │
│ Request Tracing │
└─────────┬───────────┘
│
┌────────────────┼────────────────┐
▼ ▼ ▼
User Service Mock Service 1 Mock Service 2
8083 8081 / 8082 8091
│
▼
MySQL
Redis
│
▼
Prometheus → Grafana → Zipkin
- Dynamic Service Registration
- Service Heartbeats
- Service Health Monitoring
- Automatic Status Updates
- Instance Management
- Dynamic Route Lookup
- Path-Based Routing
- Request Forwarding
- Healthy Instance Selection
- Custom Round Robin Algorithm
- Multiple Service Instances
- Traffic Distribution
- Instance Selection Logging
- JWT Authentication
- Protected APIs
- Request Validation
- Security Filters
- Redis-Based Token Bucket
- IP-Level Rate Limiting
- Abuse Prevention
- Circuit Breaker
- Downstream Failure Protection
- Graceful Degradation
- Distributed Tracing
- Request Logs
- Service Logs
- Gateway Metrics
- Prometheus Metrics
- Grafana Dashboards
- Zipkin Traces
| Category | Technologies |
|---|---|
| Backend | Java 21, Spring Boot 3, Spring WebFlux, Spring Security, Spring Data JPA, Hibernate |
| Database | MySQL 8 |
| Cache | Redis 7 |
| Monitoring & Observability | Prometheus, Grafana, Zipkin |
| Containerization | Docker, Docker Compose |
The entire platform can be started using Docker Compose.
| Service | Port |
|---|---|
| Gateway | 8080 |
| User Service | 8083 |
| Mock Service 1 Instance A | 8081 |
| Mock Service 1 Instance B | 8082 |
| Mock Service 2 | 8091 |
| MySQL | 3307 |
| Redis | 6379 |
| Zipkin | 9411 |
| Prometheus | 9090 |
| Grafana | 3001 |
git clone https://github.com/your-username/microgate.git
cd microgatedocker compose up -dVerify:
docker psExpected Containers:
gateway
userservice
mock1a
mock1b
mock2
mysql
redis
zipkin
prometheus
grafana
Services register themselves inside the Gateway Registry.
Example:
SERVICE-1
├── service1-8081
└── service1-8082
SERVICE-2
├── service2-8091
Each service sends heartbeat requests every 15 seconds.
Two instances of SERVICE-1 run simultaneously:
mock1a → 8081
mock1b → 8082
Gateway Routing:
Request 1 → 8081
Request 2 → 8082
Request 3 → 8081
Request 4 → 8082
Round Robin selection is implemented manually inside the Gateway.
http://localhost:9090
Tracks:
- Request Count
- Error Count
- Response Time
- JVM Metrics
- Service Health
http://localhost:3001
Default Login:
admin
admin
Dashboard includes:
- Gateway Health
- Service Availability
- Request Volume
- JVM Metrics
- Load Balancer Metrics
http://localhost:9411
Visualizes:
- Distributed Traces
- Request Flow
- Service Dependencies
- Request Latency
Swagger UI:
http://localhost:8080/swagger-ui.html
Example:
POST /user/auth/loginGateway validates JWT before forwarding requests.
- Weighted Round Robin
- Least Connections
- Distributed Registry
- Kubernetes Deployment
- Gateway Clustering
- Service Mesh
- API Analytics Dashboard
- Multi Region Routing
Backend Engineering • Distributed Systems • Microservices • System Design





