Skip to content

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.

License

Notifications You must be signed in to change notification settings

bagwanmisbah/TokenGate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

TokenGate - Dual API Rate Limiter

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.

image image

Features

  • 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-compose for the Spring Boot App, PostgreSQL, and Redis.
  • Unit & Integration Tested: High code coverage using JUnit and Mockito.

Tech Stack

  • Java & Spring Boot
  • PostgreSQL
  • Redis
  • Docker & Docker Compose
  • Maven
  • JUnit & Mockito

How to Run

The entire backend stack (Spring Application, PostgreSQL database, and Redis) is containerized.

  1. Clone the repository:
    git clone https://github.com/bagwanmisbah/tokengate.git
    cd tokengate
  2. Start the application using Docker Compose:
    docker-compose up

2. Run the Frontend

  1. Navigate to the frontend directory:
    # From the project's root directory
    cd frontend
  2. Install dependencies and start the development server:
    npm install
    npm run dev
image image

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.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages