Skip to content

feat: rate-limiting endpoints and migration to Upstash#486

Merged
YOGESH-08 merged 5 commits intoCodeChefVIT:stagingfrom
YOGESH-08:staging
Apr 2, 2026
Merged

feat: rate-limiting endpoints and migration to Upstash#486
YOGESH-08 merged 5 commits intoCodeChefVIT:stagingfrom
YOGESH-08:staging

Conversation

@YOGESH-08
Copy link
Copy Markdown
Collaborator

feat: rate-limiting endpoints and migration to Upstash

📌 Purpose

This PR improves the security and scalability of the application by implementing rate limiting for public endpoints and migrating from Vercel KV to Upstash Redis. It also addresses critical Next.js deprecations and React rendering issues.


Corresponding issue: closes #460 #458 #465 #455


🔧 Changes

  • Rate-limited /request, /subscribe, and /upload:
    • Implemented a sliding window rate limiter (5 requests/15 mins for papers; 3 requests/hour for newsletter) to prevent API abuse.
  • Migrated KV dependency to Upstash:
    • Refactored the core storage logic to remove Vercel KV and integrate Upstash Redis for better persistence and cost management.
  • Fixed images.domains deprecation:
    • Updated next.config.js to use remotePatterns, ensuring compatibility with the latest Next.js versions.
  • Fixed useEffect double-render:
    • Optimized the Card.tsx component logic to prevent the double-rendering issue, ensuring state only updates once on mount.

➕ Additional Notes

  • Action Required: Add UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN to your .env file (see .env.example).
  • All tests were run locally with pnpm build to ensure no regression in the build process.

@YOGESH-08 YOGESH-08 merged commit 91a5f3b into CodeChefVIT:staging Apr 2, 2026
1 check passed
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.

unnecessary useEffect causes double render

1 participant