{"id":21625972,"url":"https://github.com/muhammadmp97/rate-limiter","last_synced_at":"2025-04-11T12:44:28.335Z","repository":{"id":204946363,"uuid":"713031038","full_name":"muhammadmp97/rate-limiter","owner":"muhammadmp97","description":"Simple Rate Limiter 🚦","archived":false,"fork":false,"pushed_at":"2023-11-19T22:08:28.000Z","size":19,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T09:02:59.742Z","etag":null,"topics":["docker","javascript","nodejs","rate-limiter","rate-limiting","redis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadmp97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-01T17:40:53.000Z","updated_at":"2023-12-17T22:00:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"69031197-8a98-4022-bc0c-f01924cb431e","html_url":"https://github.com/muhammadmp97/rate-limiter","commit_stats":null,"previous_names":["muhammadmp97/rate-limiter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmp97%2Frate-limiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmp97%2Frate-limiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmp97%2Frate-limiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadmp97%2Frate-limiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadmp97","download_url":"https://codeload.github.com/muhammadmp97/rate-limiter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248402541,"owners_count":21097331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","javascript","nodejs","rate-limiter","rate-limiting","redis"],"created_at":"2024-11-25T01:11:30.675Z","updated_at":"2025-04-11T12:44:28.213Z","avatar_url":"https://github.com/muhammadmp97.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rate-limiter\n\n## How to run  \n1. Install and run [Redis](https://hub.docker.com/_/redis)\n2. Run `npm install`\n3. Run `npm run dev --port=3000`\n4. Open http://127.0.0.1:3000 in your browser.\n\n**ALTERNATIVE:** `docker-compose up -d`\n\n## How does it work?  \nRedis provides a set of flexible commands that can be really helpful in solving our real-world problems. For instancce, the `SET` command has options such as NX (only set the key if it does not already exist), hence we do not need to check if it already exists and this means running fewer commands. Here I set a key with an expire time, if it does not exist, and use the `INCR` command to increase its value by one. This command returns the new value and the incomming request gets blocked if it exceeded the defined limitation.\n\n## Features\n- Blocks the user after exceeding limitations\n- Each endpoint has a specified limitation\n- Users are known by their IP addresses\n\n## Further learning\n- https://blog.bytebytego.com/p/rate-limiting-fundamentals\n- https://www.youtube.com/watch?v=CRGPbCbRTHA\n- https://redis.io/commands\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadmp97%2Frate-limiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadmp97%2Frate-limiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadmp97%2Frate-limiter/lists"}