{"id":19782451,"url":"https://github.com/steadylearner/grpc-express-postgresql","last_synced_at":"2026-05-16T05:05:08.698Z","repository":{"id":42320860,"uuid":"210164778","full_name":"steadylearner/gRPC-Express-Postgresql","owner":"steadylearner","description":"gRPC node js CRUD example with database connection and tests with Express","archived":false,"fork":false,"pushed_at":"2023-01-24T00:41:09.000Z","size":253,"stargazers_count":0,"open_issues_count":20,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T02:32:56.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.steadylearner.com/blog","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/steadylearner.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-09-22T14:54:56.000Z","updated_at":"2019-09-24T14:12:24.000Z","dependencies_parsed_at":"2023-01-26T17:45:34.584Z","dependency_job_id":null,"html_url":"https://github.com/steadylearner/gRPC-Express-Postgresql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadylearner%2FgRPC-Express-Postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadylearner%2FgRPC-Express-Postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadylearner%2FgRPC-Express-Postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steadylearner%2FgRPC-Express-Postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steadylearner","download_url":"https://codeload.github.com/steadylearner/gRPC-Express-Postgresql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241113291,"owners_count":19911859,"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":[],"created_at":"2024-11-12T06:05:11.052Z","updated_at":"2026-05-16T05:05:08.607Z","avatar_url":"https://github.com/steadylearner.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to structure folder\n\n1. **products** folder should include **Express** server, grpc_product server and client, grpc_user client, **product.proto** and **user.proto** and tests for them.\n\n2. **users** folder should include **grpc_user server** and **user.proto**.\n\n## The purpose\n\n1. Blackfriday, return the product list with 10% discount.\n\n2. Birthday, return the product list with 5% discount.\n\n3. When not 1. and 2, return the product list.\n\n4. Without Connection for users gRPC server, return the product list\n\n5. Separate gRPC server for products and users\n\n6. Use /product end point.\n\n## Install\n\n```console\n$bash ./install.sh\n```\n\n## Test \n\n1. `$cd users \u0026\u0026 yarn serve`\n\n2. `$cd ../products \u0026\u0026 yarn serve` in another console\n\n3. `$yarn test-tape` in the same folder\n\n## End Point\n\nIt only use /product Express route with gRPC clients and Postgresql database.\n\n## Schema\n\n1. users\n\n```\nCREATE TABLE users(\n  id VARCHAR(255) PRIMARY KEY,\n  first_name VARCHAR(255) NOT NULL,\n  last_name VARCHAR(255) NOT NULL,\n  date_of_birth Date NOT NULL\n);\n```\n\n2. products\n\n```\nCREATE DOMAIN pct AS \n  REAL NOT NULL CHECK (value \u003e= 0);\n\nCREATE DOMAIN value_in_cents AS \n  INTEGER NOT NULL CHECK (value \u003e= 0);\n\nCREATE TYPE discount AS (\n  pct pct,\n  value_in_cents value_in_cents\n);\n\nCREATE TABLE products(\n  id VARCHAR(255) PRIMARY KEY,\n  price_in_cents INTEGER NOT NULL CHECK (price_in_cents \u003e 0),\n  title VARCHAR(255) NOT NULL UNIQUE,\n  description TEXT NOT NULL,\n  discount discount\n);\n```\n\n## CRUD operation\n\n1. You can test them for users and products without datbase in before/without_db folders.\n\n2. Then, you can modify them to be usable with database.\n\n## Note\n\nThis is the mirror project of [Graphql-Express-Postgresql](https://github.com/steadylearner/Graphql-Express-Postgresql). That means you can learn Graphql and gRPC with these projects.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteadylearner%2Fgrpc-express-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteadylearner%2Fgrpc-express-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteadylearner%2Fgrpc-express-postgresql/lists"}