{"id":15489295,"url":"https://github.com/larien/product","last_synced_at":"2025-10-10T11:33:19.737Z","repository":{"id":54489745,"uuid":"339169616","full_name":"larien/product","owner":"larien","description":"This is an implementation of services communication via gRPC, using Docker, different testing approaches, and other topics like mocking, relational database, API.","archived":false,"fork":false,"pushed_at":"2021-02-19T23:43:19.000Z","size":95,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-10T11:32:11.201Z","etag":null,"topics":["docker","golang","grpc","mocking","nodejs","postgresql","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/larien.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}},"created_at":"2021-02-15T18:27:31.000Z","updated_at":"2024-05-13T16:26:15.000Z","dependencies_parsed_at":"2022-08-13T17:31:19.543Z","dependency_job_id":null,"html_url":"https://github.com/larien/product","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/larien/product","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larien%2Fproduct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larien%2Fproduct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larien%2Fproduct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larien%2Fproduct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/larien","download_url":"https://codeload.github.com/larien/product/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/larien%2Fproduct/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003712,"owners_count":26083610,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","golang","grpc","mocking","nodejs","postgresql","testing"],"created_at":"2024-10-02T07:04:52.713Z","updated_at":"2025-10-10T11:33:19.717Z","avatar_url":"https://github.com/larien.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Product Service\n\nProduct Service is an implementation of services communication via gRPC and HTTP requests. Some technologies used here are Golang, Node.JS, gRPC, PostgreSQL, Docker and Docker Compose and many others.\n\nThese services were designed according to [Hash's hiring test](https://github.com/hashlab/hiring). To understand each service and its technical decisions, please access each service's README:\n- [Product](product/README.md)\n- [Discount](discount/README.md)\n\n## Project structure\n\n- **discount**: service 1 implementation, written in Node.JS\n- **migrations**: contains the database migration scripts and it's used along golang-migrate\n- **product**: service 2 implementation, written in Golang\n- **protos**: contains the protobuf scripts and generated code for gRPC communication\n\n## Installation\n\nInstall [**docker**](https://docs.docker.com/get-docker/) and [**docker-compose**](https://docs.docker.com/compose/) and build the images.\n\n```bash\ndocker-compose build\n```\n\n## Usage\n\nExport the necessary environment variables (hint: save them to a `.env` file and run `export $(xargs \u003c.env)`). Below there are a few to get you started:\n\n```bash\nDB_USER=larien\nDB_HOST=database\nDB_PORT=5432\nDB_NAME=product\nDB_PASSWORD=lauren123\nLOG_LEVEL=1\nPORT=:8080\nPOSTGRESQL_URL=postgres://larien:lauren123@database:5432/product?sslmode=disable\nGRPC_PORT=:50051\nGRPC_HOST=0.0.0.0\n```\n\nRun the built images (include `-d` if you don't want to read the logs in your terminal)\n\n```bash\ndocker-compose up --remove-orphans\n```\n\n## Tips and tricks\n\n### Connecting to the database inside the container\n\n```bash\ndocker exec -it database bash\nsu - postgres\npsql -p 5432 -d \u003cdatabase-name\u003e -U \u003cuser-name\u003e\n```\n\nHappy inserting!\n\n## Authors and acknowledgment\n\nLauren Ferreira - [larien.dev](larien.dev)\n\n## Contributing\nPull requests are welcome, but there is no development planned for this project.\n\n## License\n[GNU General Public License v3.0](https://choosealicense.com/licenses/gpl-3.0/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarien%2Fproduct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flarien%2Fproduct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flarien%2Fproduct/lists"}