This demo project demonstrates the usage of Kong API Gateway with multiple microservices.
- Postgres (Kong): Database used by Kong in DB mode.
- Kong: API Gateway managing requests to the microservices.
- Reports Service: FastAPI-based microservice for reporting.
- Results Service: FastAPI-based microservice for results and requires auth
- Accounts Service: Django-based microservice for user registration and JWT management.
- Postgres (Accounts): Database used by the Accounts service
- Docker
- Docker Compose
- Kong Deck CLI
brew tap kong/deck
brew install deck
- config/: Kong configuration files.
- reports/: FastAPI-based report microservice.
- results/: FastAPI-based result microservice.
- accounts_service/: Django-based accounts service.
Each project contains its own Dockerfile for building the respective service containers. The project also contains a Docker Compose file for orchestrating the services.
To use this demo, follow these steps:
Start Kong in DB mode with PostgreSQL:
make kong-postgres
Import the configurations:
make kong-import
Go to http://localhost:8002/
curl -X POST -H "Content-Type: application/json" -d '{"email":"[email protected]", "password":"mysecretpassword"}' http://localhost:8000/api/auth/users/
curl -X POST -H "Content-Type: application/json" -d '{"email":"[email protected]", "password":"mysecretpassword"}' http://localhost:8000/api/auth/jwt/create/
curl -H "Authorization: Bearer <your-token-goes-here>" http://localhost:8000/results/
curl -X GET http://localhost:8000/reports/
- JWT
- Proxy caching
- Request transformer
- Response transformer
- Request log
- Cors
- Ip restriction
- Rate limiting
- Request size limiting
- Lambda functions
- Log to file/http/Tcp
- Deck CLI