Skip to content

feature/1043: Integrate and configure SlowAPI rate limiting in the application #43

@babakjahan

Description

@babakjahan

We need to integrate SlowAPI to enable request rate limiting across API endpoints.
This will help protect the application from abuse, prevent API flooding, and improve service reliability.


✅ Tasks

  • Install SlowAPI package
  • Initialize Limiter instance in FastAPI application startup
  • Configure key_func using get_remote_address
  • Set up default in-memory backend for development
  • Add Redis backend configuration for production environments
  • Apply rate limits on key API routes (e.g., /auth/login, /cart/*, /products)
  • Add error handler for RateLimitExceeded
  • Add integration test to verify rate-limiting works
  • Update API documentation with rate-limit information

💡 Notes

  • For local testing, the in-memory backend is sufficient.
  • In production, Redis must be shared across all instances for consistent limits.
  • Reference: SlowAPI GitHub

Metadata

Metadata

Assignees

Labels

featureAdd a new feature

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions