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)
- 🔑 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
- FastAPI
- PostgreSQL
- Redis
- SQLAlchemy
app/
core/
db/
models/
routes/
services/
git clone https://github.com/your-username/saas-api-platform.git
cd saas-api-platform
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create .env from .env.example
uvicorn app.main:app --reload --port 8001
curl -H "X-API-Key: YOUR_API_KEY" \
http://127.0.0.1:8001/api/v1/api-keys/test-api-key
- Free → 10 requests/min
- Pro → 100 requests/min
- Enterprise → 1000 requests/min
- Protect your API from abuse
- Add API key authentication to your SaaS
- Track usage per client
- Build paid API services
- Dashboard UI
- Billing integration
- Analytics
- Multi-project support
Pull requests welcome.
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)
- 🔑 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
- FastAPI
- PostgreSQL
- Redis
- SQLAlchemy
app/
core/
db/
models/
routes/
services/
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