TokenGate is a secure and high-performance Spring Boot API that demonstrates a dual-algorithm rate limiting strategy using Token Bucket and Fixed Window Counter algorithms. It leverages Redis for efficient caching and distributed rate limiting, and is fully containerized with Docker.
- JWT Authentication: Secure endpoints using JSON Web Tokens.
- Redis Caching: Reduces database latency by over 95%.
- Dual Rate Limiting: Protects the API from overuse and abuse.
- Fully Containerized: Includes
docker-composefor the Spring Boot App, PostgreSQL, and Redis. - Unit & Integration Tested: High code coverage using JUnit and Mockito.
- Java & Spring Boot
- PostgreSQL
- Redis
- Docker & Docker Compose
- Maven
- JUnit & Mockito
The entire backend stack (Spring Application, PostgreSQL database, and Redis) is containerized.
- Clone the repository:
git clone https://github.com/bagwanmisbah/tokengate.git cd tokengate - Start the application using Docker Compose:
docker-compose up
- Navigate to the frontend directory:
# From the project's root directory cd frontend
- Install dependencies and start the development server:
npm install npm run dev
The React application will now be running and accessible at http://localhost:5173.
This command will build the images and start all the containers. The Spring Boot application will be running and connected to the database and Redis cache automatically. The API will be available at http://localhost:8080.