Gatekeeper is a custom-built API Gateway system implemented using Java 17 and Spring Boot.
It consists of two independent microservices:
- Gatekeeper Admin (Control Plane)
- Gatekeeper Gateway (Data Plane)
The system enables dynamic route management with runtime hot reloading, custom Netty-based traffic routing, and containerized deployment using Docker and Docker Compose.
Gatekeeper follows a two-service architecture.
The Admin service acts as the configuration and control layer.
- Admin signup and login
- Route creation, update, deletion
- Persistent route storage oon SQLite
- UI for managing gateway configuration
- Health endpoint exposure for orchestration
- Spring Boot
- Sqlite
- Spring Security
- Spring Data JPA
- Thymeleaf (Admin UI)
- Spring Actuator
The Admin service maintains the source of truth for all route configurations.
The Gateway service is the traffic routing engine.
- Fetch routes from Admin service at startup
- Build in-memory routing table using
ConcurrentHashMap - Handle runtime hot reloading of routes
- Perform request routing via embedded Netty server
| Port | Purpose |
|---|---|
| 8082 | Spring Boot application port (internal logic & route sync) |
| 8080 | Embedded Netty gateway port (actual traffic routing) |
Unlike Spring Cloud Gateway, this project embeds Netty directly to implement a custom routing layer.
- Admin service starts and becomes healthy.
- Gateway service starts after Admin health check passes.
- On startup, Gateway fetches all routes from Admin.
- Gateway builds an in-memory
ConcurrentHashMapfor fast lookups. - Netty server routes requests based on in-memory configuration.
- Routes can be added, removed, or updated dynamically (hot reloading supported).
- Admin handles configuration and persistence.
- Gateway handles runtime traffic routing.
This separation improves modularity and mirrors real-world API gateway designs.
Using ConcurrentHashMap ensures:
- Thread-safe access
- High-performance route lookup
- Minimal request latency
Instead of using Spring Cloud Gateway, this project embeds Netty directly to:
- Gain deeper control over the request lifecycle
- Improve performance
- Understand low-level HTTP routing mechanics
Docker Compose ensures:
- Admin service starts first
- Gateway waits until Admin health endpoint reports
UP - Gateway fetches routes only when Admin is ready
This prevents partial initialization failures.
- Java 17
- Spring Boot
- Spring Security
- Spring Data JPA
- SQLite
- Thymeleaf
- Embedded Netty
- Maven
- Docker
- Docker Compose
- Eclipse Temurin 17 (Alpine base image)
Gatekeeper can be started using Docker Compose without manually building individual services.
- Docker installed
- Docker Compose installed
Verify installation:
docker --version
docker compose version Clone the Repository:
git clone https://github.com/jagat-banera/Gatekeeper.git
cd gatekeeperStart the Containers:
docker compose up --buildOnce the application is running, you can access the following services:
| Service | URL | Description |
|---|---|---|
| Admin UI Signup | http://localhost:8081/admin-signup | For Admin Credentials Setup |
| Admin UI Login | http://localhost:8081/login | For Login Into UI Panel |
| Admin UI List API | http://localhost:8081/ui/list-api | For Listing all APis ( Active and Inactive ) |
| Admin UI Manage API | http://localhost:8081/ui/manage-api | For Activating , Deactivating and Deleting Endpoints |
| Admin UI Register APi | http://localhost:8081/ui/list-api | For Regstering new Routes ( By Default , New Routes are Inactive |
Once a route is created and activated successfully in the Admin service, the configured target URL becomes accessible through the Gateway endpoint.
The Gateway listens on:
http://localhost:8080All incoming requests to this port are evaluated against the in-memory routing table and forwarded to the configured target service.
Assume the following route configuration is created in the Admin UI:
- Route Path:
/users - Target URL:
http://example-service:9000 - Status: Active
After saving and activating the route, you can access the target service through the Gateway as follows:
http://localhost:8080/usersThe architecture is intentionally designed to be extensible. Potential enhancements include:
- Observability integration (Prometheus, Grafana)
- Circuit breaker and resilience patterns
- Rate limiting and traffic shaping
Feedback, discussions, and contributions are welcome.