Rate Limit feature #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an Edge middleware (middleware.ts) with per-route rate limits via Upstash:
Auth Sign-in (POST /api/auth/signin): 5 requests/min
Forgot-password (POST /api/auth/forgot-password): 5 requests/hr
Session (GET /api/auth/session): 30 requests/min
Deals Read (GET /api/deals):* 50 requests/min
Deals Create (POST /api/deals): 10 requests/min
Deals Update (PATCH /api/deals/:id): 20 requests/min
Deals Delete (DELETE /api/deals/:id): 5 requests/min
Status Toggle (POST /api/deals/:id/status): 30 requests/min
Search (GET /api/search): 50 requests/min
AI Analyze (POST /api/ai/analyze): 5 requests/min
File Upload (POST /api/upload): 10 requests/hr
Comments (POST /api/deals/:id/comment): 50 requests/min
Notifications (GET /api/notifications): 30 requests/min
Admin Actions (POST /api/admin/*): 5 requests/min
Global Fallback (any other route): 50 requests/min