API Key Management & Rate Limiting Service by Umme HaniAPI Key Management & Rate Limiting Service by Umme Hani

API Key Management & Rate Limiting Service

Umme Hani

Umme Hani

๐Ÿ” API Key Management & Rate Limiting Service

A production-style backend service built with Java & Spring Boot that enables developers to generate API keys and securely access protected APIs with rate limiting, usage quotas, and authentication.
This project demonstrates real-world backend engineering practices including API security, request throttling, concurrency handling, containerization, CI/CD, and cloud deployment.

๐Ÿš€ Key Features

๐Ÿ”‘ User Authentication โ€“ Secure user registration and login using JWT
๐Ÿ” API Key Management โ€“ Generate and revoke API keys for controlled access
โฑ Rate Limiting โ€“ Fixed-window algorithm to prevent API abuse
๐Ÿ“Š Usage Tracking โ€“ Monitor API usage with request logging
๐Ÿ“… Monthly Quotas โ€“ Limit total requests per API key
โšก Concurrency Protection โ€“ Optimistic locking prevents race conditions
๐Ÿ“ฆ Containerized Deployment โ€“ Docker & Docker Compose setup
โ˜๏ธ Cloud Deployment โ€“ Hosted on AWS EC2
๐Ÿ“‘ Structured API Responses โ€“ Standardized response and error format
๐Ÿ›  CI/CD Automation โ€“ Deployment pipeline using GitHub Actions
๐Ÿ“˜ API Documentation โ€“ Swagger / OpenAPI integration

๐Ÿ— System Architecture

Client โ”‚ โ–ผ Spring Boot API โ”‚ โ”œโ”€โ”€ JWT Authentication โ”œโ”€โ”€ API Key Validation โ”œโ”€โ”€ Rate Limiting Engine โ”œโ”€โ”€ Usage Logging โ”‚ โ–ผ PostgreSQL Database

๐Ÿงฐ Tech Stack

Backend

Java 17
Spring Boot
Spring Security
Spring Data JPA (Hibernate)

Authentication & Security

JWT (JSON Web Tokens)
BCrypt Password Hashing
API Key Hashing (SHA-256)

Database

PostgreSQL

DevOps & Deployment

Docker
Docker Compose
GitHub Actions CI/CD
AWS EC2

๐Ÿ“‚ Project Structure

src/main/java/com/hdev/apikeymanager โ”œโ”€โ”€ controller โ”œโ”€โ”€ service โ”œโ”€โ”€ repository โ”œโ”€โ”€ entity โ”œโ”€โ”€ dto โ”œโ”€โ”€ security โ”œโ”€โ”€ exception โ”œโ”€โ”€ config

โš™๏ธ Running the Project Locally

1๏ธโƒฃ Clone Repository

git clone https://github.com/<your-username>/apikeymanager.git cd apikeymanager

2๏ธโƒฃ Build Project

mvn clean package

3๏ธโƒฃ Run with Docker

docker-compose up --build
Application runs at:
Swagger API docs:

โ˜๏ธ Cloud Deployment (AWS EC2)

Deployment steps used:
Launch EC2 instance (Ubuntu 22.04)
Install Docker & Docker Compose
Clone repository
Start containers
docker-compose up --build -d
API accessible at:
http://<EC2_PUBLIC_IP>:8081

๐Ÿ”‘ Example API Flow

Register User

POST /api/auth/register

Login

POST /api/auth/login

Create API Key

POST /api/keys

Access Protected API

GET /api/data Header: X-API-KEY: <your-api-key>

๐Ÿ“Š Backend Concepts Demonstrated

Fixed-window rate limiting
API key hashing (SHA-256)
Optimistic locking for concurrency control
Centralized exception handling
Structured API responses
Containerized backend deployment
CI/CD automation

๐Ÿ‘จโ€๐Ÿ’ป Author

Umme Hani
Backend Developer | Java | Spring Boot

๐Ÿ“œ License

MIT License

About

No description, website, or topics provided.

Resources

Readme

Stars

1 star

Watchers

0 watching

Forks

Releases 1 (1)

API Key Manager v1.0Latest
Mar 11, 2026

Languages

Like this project

Posted Aug 10, 2026

Production-style Java/Spring Boot backend to generate and manage API keys with authentication, rate limiting, quotas, logging, and containerized deployment.