{"id":16017170,"url":"https://github.com/gawsoftpl/cache-grpc-server","last_synced_at":"2026-01-24T16:46:18.837Z","repository":{"id":200162261,"uuid":"704953315","full_name":"gawsoftpl/cache-grpc-server","owner":"gawsoftpl","description":"Cache server (redis storage) GRPC stream connection","archived":false,"fork":false,"pushed_at":"2024-10-09T11:44:48.000Z","size":452,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-15T10:53:19.523Z","etag":null,"topics":["cache","grpc","nestjs","redis","reflection","server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gawsoftpl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-14T15:56:45.000Z","updated_at":"2024-10-09T11:43:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e1e774a-9fbc-4f92-bc10-dd7145b65d29","html_url":"https://github.com/gawsoftpl/cache-grpc-server","commit_stats":{"total_commits":81,"total_committers":1,"mean_commits":81.0,"dds":0.0,"last_synced_commit":"74061670fb9515258cd6be9d59bb67b132bdcfc6"},"previous_names":["gawsoftpl/cache-grpc-server"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/gawsoftpl/cache-grpc-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gawsoftpl%2Fcache-grpc-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gawsoftpl%2Fcache-grpc-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gawsoftpl%2Fcache-grpc-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gawsoftpl%2Fcache-grpc-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gawsoftpl","download_url":"https://codeload.github.com/gawsoftpl/cache-grpc-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gawsoftpl%2Fcache-grpc-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"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":["cache","grpc","nestjs","redis","reflection","server"],"created_at":"2024-10-08T16:04:18.423Z","updated_at":"2026-01-24T16:46:18.822Z","avatar_url":"https://github.com/gawsoftpl.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Overall\nServer for fast save and read data from cache. Use GRPC stream for connection and Redis as storage.\nReady for TLS and mTLS.\n\nFeatures:\n- GRPC connection\n- GET and SET method as stream\n- Reflection\n- HealthProbe\n- Redis as storage\n- NestJs framework\n\nClient create one connection via stream, and send get or set command via grpc stream. This is very quick solution\nServer has implemented grpc.health.v1 for readinessprobe too\n\n## Run server\n### Via docker\n```sh\ndocker run -it --rm -e REDIS_URL=redis://redis:6379 -p 3000:3000 gawsoft/cache-grpc-server\n# Or via docker-compose \ndocker-compose up\n```\n\n## For check health\nIf you want to run this in kubernetes run \n```sh\ngrpc_health_probe --addr localhost:3000\n```\n\n### Via nodejs/typescript\n```sh\nyarn build\nyarn start\n```\n\n# Env\n```sh\nHOST=0.0.0.0:3000\nREDIS_URL=127.0.0.1:6379\n\n# Setup TLS\n#TLS_INSECURE=false\n#TLS_KEY_PATH=/etc/ssl/key.pem\n#TLS_CERT_PATH=/etc/ssl/cert.pem\n\n# For mutual tls\n#TLS_CA_CERT_PATH=/etc/ssl/ca.cert\n#TLS_VERIFY_CLIENT_CERT=true\n\n```\n## ProtoBuf\n```protobuf\nrpc Get (stream GetRequest) returns (stream GetResponse);\nrpc Exists (stream GetRequest) returns (stream ExistsResponse);\nrpc Set (stream SetRequest) returns (stream SetResponse);\n```\n\n\n## Use as a library (Custom storage strategy)\nIf you dont want to use Redis as a storage you can write custom storage class with Interface StorageStrategyInterface\n\n```sh\nnpm install cache-grpc-server\n```\n\n```typescript\nimport { NestFactory } from '@nestjs/core';\nimport { AppModule, GrpcClientOptions, SetRequestInterface, StorageStrategyInterface } from 'cache-grpc-server'\nimport { MicroserviceOptions } from '@nestjs/microservices';\nimport { Injectable } from '@nestjs/common';\n\n@Injectable()\nclass CustomStorageStrategy implements StorageStrategyInterface\n{\n  async existsMulti(keys: string[]): Promise\u003cboolean[]\u003e {\n    return [true, false];\n  }\n  async getMulti(keys: string[]): Promise\u003cstring[]\u003e {\n    return ['a','b'];\n  }\n  async save(data: SetRequestInterface): Promise\u003cstring\u003e {\n    return \"test\"\n  }\n}\n\nexport async function bootstrap() {\n  // Here inject custom storage strategy\n  const app = await NestFactory.create(AppModule.register(CustomStorageStrategy));\n  const grpcClientOptions = app.get(GrpcClientOptions);\n  app.connectMicroservice\u003cMicroserviceOptions\u003e(grpcClientOptions.getOptions());\n\n  await app.startAllMicroservices();\n  await app.init();\n  return app;\n}\n\nbootstrap();\n\n```\n\n## Tests\nE2E tests\n```sh\nyarn test:e2e\n```\n## Example client\n\n```sh\nts-node examples/client-set.ts\nts-node examples/client-get.ts\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgawsoftpl%2Fcache-grpc-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgawsoftpl%2Fcache-grpc-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgawsoftpl%2Fcache-grpc-server/lists"}