Skip to content

[Feat] Issue-1063 Add Upstash-backed rate limiting - #1064

Open
Dhirenderchoudhary wants to merge 1 commit into
TeamShiksha:stagefrom
Dhirenderchoudhary:feat/issue-1063-rate-limiting
Open

[Feat] Issue-1063 Add Upstash-backed rate limiting#1064
Dhirenderchoudhary wants to merge 1 commit into
TeamShiksha:stagefrom
Dhirenderchoudhary:feat/issue-1063-rate-limiting

Conversation

@Dhirenderchoudhary

@Dhirenderchoudhary Dhirenderchoudhary commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #1063

This PR improves rate limiting for the Vercel/serverless deployment by replacing in-memory rate limit counters with Upstash Redis-backed IP rate limiting.

Changes included:

  • Centralized reusable rate limit policies.
  • Added Upstash-backed store for express-rate-limit.
  • Kept existing limits:
    • /api/logo/* → 100 req/min
    • other main API routes → 60 req/min
  • Added dedicated auth and upload/signed-url limiters.
  • Added consistent JSON 429 responses.
  • Added proxy trust config for Vercel client IP handling.
  • Added env validation for required Upstash config.
  • Added tests for rate limit behavior and env validation.

Closes #1063

What type of PR is this? (Check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📄 Documentation Update
  • 👨‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🛠️ CI/CD

Screenshots (if applicable)

Not applicable.

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@Dhirenderchoudhary
Dhirenderchoudhary marked this pull request as ready for review July 3, 2026 08:31
@Dhirenderchoudhary Dhirenderchoudhary changed the title feat: add Upstash-backed rate limiting (#1063) [Feat] Issue-1063 Add Upstash-backed rate limiting Jul 3, 2026
@Dhirenderchoudhary
Dhirenderchoudhary marked this pull request as draft July 3, 2026 08:41
@Dhirenderchoudhary
Dhirenderchoudhary force-pushed the feat/issue-1063-rate-limiting branch 2 times, most recently from f2e3c03 to b743a2c Compare July 3, 2026 15:27
@Dhirenderchoudhary
Dhirenderchoudhary force-pushed the feat/issue-1063-rate-limiting branch from ad22165 to 0eaea82 Compare July 6, 2026 13:01
@Dhirenderchoudhary
Dhirenderchoudhary marked this pull request as ready for review July 6, 2026 13:03
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve rate limiting for deployment using Upstash Redis

1 participant