{"id":19032653,"url":"https://github.com/jaxxreal/redis-proxy-pro","last_synced_at":"2026-04-14T04:31:00.259Z","repository":{"id":39759223,"uuid":"217110037","full_name":"jaxxreal/redis-proxy-pro","owner":"jaxxreal","description":"Web-wrapper for Redis | a showcase for SegmentStream","archived":false,"fork":false,"pushed_at":"2023-01-10T22:01:37.000Z","size":648,"stargazers_count":0,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T20:36:40.761Z","etag":null,"topics":["docker","docker-compose","docker-container","koa2","pm2","proxy","redis","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jaxxreal.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}},"created_at":"2019-10-23T17:01:29.000Z","updated_at":"2021-04-06T20:35:08.000Z","dependencies_parsed_at":"2023-02-08T20:15:32.310Z","dependency_job_id":null,"html_url":"https://github.com/jaxxreal/redis-proxy-pro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaxxreal/redis-proxy-pro","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxxreal%2Fredis-proxy-pro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxxreal%2Fredis-proxy-pro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxxreal%2Fredis-proxy-pro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxxreal%2Fredis-proxy-pro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaxxreal","download_url":"https://codeload.github.com/jaxxreal/redis-proxy-pro/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaxxreal%2Fredis-proxy-pro/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31782736,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","docker-compose","docker-container","koa2","pm2","proxy","redis","typescript"],"created_at":"2024-11-08T21:29:56.004Z","updated_at":"2026-04-14T04:31:00.200Z","avatar_url":"https://github.com/jaxxreal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## High-level architecture overview\n\nWhat we have?\n\nNodeJS server using Koa web framework (named as web server below) running that's bypassing requests to a Redis instance, each running in their own container.\nWeb server is running using [pm2](https://github.com/Unitech/pm2) within a docker container.\nRedis is running using [redis:alpine](https://hub.docker.com/_/redis) image.\nAlso we use [docker-compose](https://docs.docker.com/compose/) to run them at once.\n\nTests is also being built into a docker image, designed to be run within a docker container.\n\n## What the code does\n\n### web directory\nWe have a [light-weight wrapper](./web/redisClient.ts) for [node_redis](https://github.com/NodeRedis/node_redis) to provide promise-based API and encapsulate some business logic such as max capacity based on keys stored in Redis.\n\nPer each redis read or write it keeps track of recency that keys accessed, to evict keys when max capacity being hit.\n\nA [web server](./web/index.ts) is just one file b/c of its size. It provides really small API like:\n\nWrite data to Redis:\n```\ncurl --request POST \\\n  --url http://localhost:8081/ \\\n  --header 'content-type: application/json' \\\n  --data '{\n\t\"key\": \"1\",\n\t\"value\": \"some data input\"\n}'\n```\n\nRead the data from Redis:\n```\ncurl --request GET \\\n  --url http://localhost:8081/1\n```\n\nThat's bascially it.\n\n### tests directory\n\nHere we have end to end tests. It designed a way to hit a cache server endpoint, then verify writes via direct connection to baked Redis instance.\n\n### config directory\n\nHere we have a configuration files designed to be shared between web and tests images.\n\n## Algorithmic complexity of the cache operations\n\nFor writes: O(N+1), where N is the number of keys in Redis\n\nFor reads: O(N+1), where N is the number of keys in Redis\n\n## Instructions for how to run the proxy and tests\n\nFor running the proxy and tests we use [make](https://www.gnu.org/software/make/).\n\nFor running tests, run the following command under project root:\n```\nmake test // build and run a web server, then build and run tests.\n```\n\nFor building and running the proxy, run the following command under project root:\n```\nmake run\n```\n\n## How much time was spent on each part of the project\n\n_Note: I'm completely newbie in docker._\n\nRoughly, it's about 10 hours.\n\nPure coding, I mean write typescript code, took around 3-4 hours, including figuring out configs for compiling \u0026 bootstrapping typescript project for the web app \u0026 tests.\n\nThe rest of the time, 6-7 hours, was spend purely on figuring out docker, docker compose, how it works, and also project refactoring. Yes, I took a wrong path from the beginning, without taking into account docker specificity. \n\n## A list of the requirements that was not implemented and the reasons for omitting them\n\n* System tests. Basic requirements was implemented, but it's still not about 100% code coverage. This is controversial question, but I leave it here.\n* Sequential concurrent processing. AFAIK NodeJS support concurrent requests out of the box. So, I have a feeling that I didn't get this point clearly.\n* Cached GET. Being unsure about interpretation of the previous point, omitted it b/c of possible hidden caveats.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxxreal%2Fredis-proxy-pro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaxxreal%2Fredis-proxy-pro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaxxreal%2Fredis-proxy-pro/lists"}