https://github.com/x-sushant-x/rate-shield
A configurable rate limiter that can apply rate limiting on individual APIs with individual rules.
https://github.com/x-sushant-x/rate-shield
golang hacktoberfest hacktoberfest-accepted javascript typescript
Last synced: 5 months ago
JSON representation
A configurable rate limiter that can apply rate limiting on individual APIs with individual rules.
- Host: GitHub
- URL: https://github.com/x-sushant-x/rate-shield
- Owner: x-sushant-x
- License: mit
- Created: 2024-08-05T03:15:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-11-13T05:43:50.000Z (7 months ago)
- Last Synced: 2025-11-13T06:18:28.243Z (7 months ago)
- Topics: golang, hacktoberfest, hacktoberfest-accepted, javascript, typescript
- Language: Go
- Homepage: https://beyondthesyntax.substack.com/p/i-made-a-configurable-rate-limiter
- Size: 724 KB
- Stars: 174
- Watchers: 1
- Forks: 17
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## 🚀 **RateShield**
A fully customizable rate limiter designed to apply rate limiting on individual APIs with specific rules.
#### 📊 **Dashboard Overview**


___
#### 🎯 **Why RateShield?**
Why not? With some free time on hand, RateShield was created to explore the potential of building a versatile rate-limiting solution. What started as a side project is evolving into a powerful tool for developers.
---
#### 🌟 **Key Features**
- **Customizable Limiting:**
Tailor rate limiting rules to each API endpoint according to your needs.
- **Intuitive Dashboard:**
A user-friendly interface to monitor and manage all your rate limits effectively.
- **Easy Integration:**
Plug-and-play middleware that seamlessly integrates into your existing infrastructure.
---
#### ⚙️ **Use Cases**
- **Preventing Abuse:**
Control the number of requests your APIs can handle to prevent misuse and malicious activities.
- **Cost Management:**
Manage third-party API calls efficiently to avoid unexpected overages.
---
#### 🚀 **Supported Rate Limiting Algorithms**
- **Token Bucket**
- **Fixed Window Counter**
- **Sliding Window**
---
#### 🪧 Usage Guide
Check out this [document](https://github.com/x-sushant-x/Rate-Shield/tree/main/rate_shield/documentation).
---
### A detailed blog post about its working.
[Read Here](https://beyondthesyntax.substack.com/p/i-made-a-configurable-rate-limiter)
---
#### How it works?

---
#### 📋 **Prerequisites**
Before setting up RateShield, ensure you have the following:
- **Docker & Docker Compose** - Required for running the application and Redis infrastructure
- **Redis Stack** (included in docker-compose):
- Single Redis instance for storing rate limit rules (port 6379)
- Redis Cluster with 6 nodes (3 masters + 3 replicas) for distributed rate limiting (ports 7000-7005)
- ReJSON module enabled (automatically included with redis/redis-stack image)
- **Slack Integration** (for error notifications):
- Slack Bot Token
- Slack Channel ID
**Quick Start with Docker Compose:**
The provided `docker-compose.yml` includes everything you need - no separate Redis setup required!
```bash
cd rate_shield
cp .env.example .env
# Edit .env with your Slack credentials
docker-compose up -d
```
For detailed setup instructions, see [SETUP.md](SETUP.md).
---
#### 🤝 **Contributing**
Interested in contributing? We'd love your help! Check out our [Contribution Guidelines](https://github.com/x-sushant-x/Rate-Shield/blob/main/CONTRIBUTION.md) to get started.
---