Skip to content

rohitahari/api-control-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” SaaS API Key & Rate Limiting Platform

πŸŽ₯ Demo

Click below to watch the demo:

πŸ‘‰ https://www.loom.com/share/7006b1576cb74833b8628bb0db300c5a

πŸ“Œ What This Demo Shows

  • User authentication
  • API key generation
  • Rate limiting (prevents abuse)
  • Usage tracking

This system adds a control layer to APIs to keep them secure and stable.

A production-style backend system built with FastAPI that provides:

  • API key authentication
  • Redis-based rate limiting
  • Usage tracking
  • Plan-based access control (Free / Pro / Enterprise)

πŸš€ Features

  • πŸ”‘ API Key Generation & Validation
  • ⚑ Rate Limiting using Redis
  • πŸ“Š Usage Tracking (requests count, last used)
  • 🧠 Plan-based limits (Free / Pro / Enterprise)
  • πŸ” JWT Authentication system
  • 🧩 Plug-and-play dependency for any API

πŸ›  Tech Stack

  • FastAPI
  • PostgreSQL
  • Redis
  • SQLAlchemy

πŸ“¦ Project Structure

app/
  core/
  db/
  models/
  routes/
  services/

βš™οΈ Setup

1. Clone repo

git clone https://github.com/your-username/saas-api-platform.git
cd saas-api-platform

2. Create virtual environment

python -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Setup environment variables

Create .env from .env.example

5. Run server

uvicorn app.main:app --reload --port 8001

πŸ”‘ Example Usage

Generate API Key (after login)

Test API Key

curl -H "X-API-Key: YOUR_API_KEY" \
http://127.0.0.1:8001/api/v1/api-keys/test-api-key

πŸ“Š Rate Limiting

  • Free β†’ 10 requests/min
  • Pro β†’ 100 requests/min
  • Enterprise β†’ 1000 requests/min

🧠 Use Cases

  • Protect your API from abuse
  • Add API key authentication to your SaaS
  • Track usage per client
  • Build paid API services

πŸš€ Future Improvements

  • Dashboard UI
  • Billing integration
  • Analytics
  • Multi-project support

🀝 Contributing

Pull requests welcome.


πŸ” SaaS API Key & Rate Limiting Platform

A production-style backend system built with FastAPI that provides:

  • API key authentication
  • Redis-based rate limiting
  • Usage tracking
  • Plan-based access control (Free / Pro / Enterprise)

πŸš€ Features

  • πŸ”‘ API Key Generation & Validation
  • ⚑ Rate Limiting using Redis
  • πŸ“Š Usage Tracking (requests count, last used)
  • 🧠 Plan-based limits (Free / Pro / Enterprise)
  • πŸ” JWT Authentication system
  • 🧩 Plug-and-play dependency for any API

πŸ›  Tech Stack

  • FastAPI
  • PostgreSQL
  • Redis
  • SQLAlchemy

πŸ“¦ Project Structure

app/
  core/
  db/
  models/
  routes/
  services/

πŸš€ Setup

git clone <repo>
cd api-control-platform

python -m venv venv
source venv/bin/activate

pip install -r requirements.txt

cp .env.example .env
# fill values

uvicorn app.main:app --reload

---

## πŸ”‘ Example Usage

### Generate API Key (after login)

### Test API Key

curl -H "X-API-Key: YOUR_API_KEY"
http://127.0.0.1:8001/api/v1/api-keys/test-api-key


---

## πŸ“Š Rate Limiting

* Free β†’ 10 requests/min
* Pro β†’ 100 requests/min
* Enterprise β†’ 1000 requests/min

---

## 🧠 Use Cases

* Protect your API from abuse
* Add API key authentication to your SaaS
* Track usage per client
* Build paid API services

---

## πŸš€ Future Improvements

* Dashboard UI
* Billing integration
* Analytics
* Multi-project support

---

## 🀝 Contributing

Pull requests welcome.

---

## πŸ“œ License

MIT

About

API key authentication, rate limiting, and usage tracking system built with FastAPI, PostgreSQL, and Redis

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages