code100x / algorithmic-arena

157 stars 154 forks source link

ratelimting using redis, on user submiting a solution #8

Closed Ankur1493 closed 3 months ago

Ankur1493 commented 3 months ago

used ioredis, to add rateLimiting, now user will be able to only submit 1 req per 10seconds, you can change that frequency if you want from api/submissions/route.ts

fixes #2

hkirat commented 3 months ago

Merging this as is but ideally we should make the ratelimitter more generic Should take a key as an input and not the userId there might be a different route we might have to protect in the future. Both of these will start to override each other

hkirat commented 3 months ago

/bounty $15