Skip to content

Conversation

100NikhilBro
Copy link
Contributor

Closes: #1210

πŸš€ Rate Limiter Setup

This project adds a new feature using rate-limiter-flexible to protect APIs against abuse and brute-force attacks.

πŸ“‚ Folder Structure

/src
β”œβ”€β”€ routes/
β”‚Β Β Β Β β”œβ”€β”€ api.js
│    └── index.js
β”œβ”€β”€ middlewares/
│    └── rateLimit/
β”‚Β Β Β Β Β Β Β Β β”œβ”€β”€ authLimiter.js
β”‚Β Β Β Β Β Β Β Β β”œβ”€β”€ generalLimiter.js
│        └── index.js
└── app.js

βš™οΈ Installation

npm install rate-limiter-flexible

βœ… PR Type

  • Bug fix
  • New feature
  • Code style update (formatting, local variables)
  • Documentation update
  • Database update

πŸ“„ Note to reviewers

This PR introduces rate limiting for both /auth (strict) and other routes (general). Please verify middleware placement in routes/index.js and confirm limits are appropriate.

@vercel
Copy link

vercel bot commented Sep 6, 2025

@100NikhilBro is attempting to deploy a commit to the avdheshvarshney's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link

github-actions bot commented Sep 6, 2025

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

@100NikhilBro
Copy link
Contributor Author

Hi @maintainers,

This PR is ready for review βœ….
However, merging is currently blocked because:

Vercel check is failing β†’ Authorization required to deploy (likely a deployment permission/configuration issue).

Branch protection β†’ Requires at least one approving review from a collaborator with write access.

The code changes themselves are passing the other checks.
Please review and approve when convenient πŸ™.

Thanks!

@vercel
Copy link

vercel bot commented Sep 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
code-a2z Ready Ready Preview Comment Sep 7, 2025 2:12pm

Copy link
Member

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

Copy link
Contributor Author

@100NikhilBro 100NikhilBro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback. I’ve removed all unrelated modifications from package.json (kept only "rate-limiter-flexible").
Also cleaned up backend/Routes/index.js β€” deleted commented code, kept only middleware-applied routes, and ensured a single export default router at the bottom.

@Avdhesh-Varshney Avdhesh-Varshney merged commit 5a2cf97 into Code-A2Z:main Sep 7, 2025
2 checks passed
@100NikhilBro
Copy link
Contributor Author

Hi @Avdhesh-Varshney,

Bro, I’m not very active on Discord. If you have any issues or queries, you can message me hereβ€”I’ll check and reply on Discord if needed, or I can reply directly here as well.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Implement Rate Limiting to Prevent Brute-Force Attacks

2 participants