{"id":30896546,"url":"https://github.com/sahil2k07/grpc-go","last_synced_at":"2026-05-15T08:04:22.989Z","repository":{"id":309591969,"uuid":"1036187955","full_name":"Sahil2k07/gRPC-GO","owner":"Sahil2k07","description":"Go-based Inventory Service with REST (Echo) and gRPC endpoints for managing users and inventory items.","archived":false,"fork":false,"pushed_at":"2025-08-20T18:45:33.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T20:47:41.287Z","etag":null,"topics":["echo","golang","gorm","grpc-go","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Sahil2k07.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,"zenodo":null}},"created_at":"2025-08-11T17:29:15.000Z","updated_at":"2025-08-20T18:45:37.000Z","dependencies_parsed_at":"2025-08-12T19:28:42.917Z","dependency_job_id":"bfbbbe62-e285-4bfc-ad13-9864e10e3f7e","html_url":"https://github.com/Sahil2k07/gRPC-GO","commit_stats":null,"previous_names":["sahil2k07/grpc-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sahil2k07/gRPC-GO","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahil2k07%2FgRPC-GO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahil2k07%2FgRPC-GO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahil2k07%2FgRPC-GO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahil2k07%2FgRPC-GO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sahil2k07","download_url":"https://codeload.github.com/Sahil2k07/gRPC-GO/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sahil2k07%2FgRPC-GO/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231200,"owners_count":25245673,"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-09-08T02:00:09.813Z","response_time":121,"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":["echo","golang","gorm","grpc-go","postgresql"],"created_at":"2025-09-08T23:09:11.570Z","updated_at":"2026-05-15T08:04:17.956Z","avatar_url":"https://github.com/Sahil2k07.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GRPC + Go Inventory Management\n\nThis project demonstrates a full-stack inventory management system built using **Go** and **gRPC**. It includes a Go backend server and gRPC services for inventory operations.\n\n---\n\n## Table of Contents\n\n- [Features](#features)\n- [Prerequisites](#prerequisites)\n- [gRPC Setup](#grpc-setup)\n- [Running the Server](#running-the-server)\n- [Building the Project](#building-the-project)\n\n---\n\n## Features\n\n- Inventory management with stock updates and consumption\n- gRPC APIs for communication\n- Multi-platform build support (Linux, Windows, macOS)\n- Secure gRPC with TLS certificates\n\n---\n\n## Prerequisites\n\n- Go \u003e= 1.20\n- Protobuf Compiler (`protoc`)\n- OpenSSL (for certificates)\n\n---\n\n## gRPC Setup\n\n1. **Install protobuf compiler on Ubuntu**\n\n   ```bash\n   sudo apt install -y protobuf-compiler\n   protoc --version # Ensure compiler version is 3+\n   ```\n\n2. **Install `grpc-protobuf-compiler` in your `ubuntu` machine**\n\n   ```bash\n   apt install -y protobuf-compiler\n   protoc --version # Ensure compiler version is 3+\n   ```\n\n3. **Install these go-packages locally to generate grpc go code**\n\n   ```bash\n   go install google.golang.org/protobuf/cmd/protoc-gen-go@latest\n   go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest\n   ```\n\n4. **Use this command to generate the the go code for grpc services**\n\n   ```bash\n   protoc \\\n   --go_out=internal/generated/stock --go_opt=paths=source_relative \\\n   --go-grpc_out=internal/generated/stock --go-grpc_opt=paths=source_relative \\\n   proto/stock.proto\n   ```\n\n5. **Command for creating certs and keys**\n\n   ```bash\n   openssl req -new -x509 -days 365 -nodes -out certs/server.crt -keyout certs/server.key -subj \"/CN=localhost\"\n   ```\n\n6. **Use this command to create your custom `Authorization-Token` for you grpc services**\n\n   ```bash\n   openssl rand -hex 32\n   ```\n\n---\n\n## Running the Server\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/Sahil2k07/gRPC-GO.git\n\n   cd gRPC-GO\n   ```\n\n2. **Restore all the packages:**\n\n   ```bash\n   go mod download\n   ```\n\n3. **Optionally have a local copy of all the packages:**\n\n   ```bash\n   go mod vendor\n   ```\n\n4. \\*\\*Make a `dev.toml` file and give all the credentials. A `dev.example.toml` has been provided\n\n   ```toml\n   [server]\n   server_port = \":5000\"\n   origins = [\"http://localhost:3000\", \"https://example.com\"]\n\n   [grpc]\n   grpc_port = \":6000\"\n   grpc_url = \"localhost:6000\"\n   grpc_token = \"5763121b0c2141eb73d3c1ddfe65a02f30e56adc2fd6f62d1a143f38dc1f3680\"\n\n   [database]\n   db_host = \"localhost\"\n   db_port = \"5432\"\n   db_user = \"postgres\"\n   db_password = \"sahil\"\n   db_name = \"grpc-go\"\n\n   [jwt]\n   cookie_name = \"gRPC-GO-cookie\"\n   secret = \"K3#v@9$1!pZ^mL2\u0026uQ7*rF4)gT8_W+oB\"\n   ```\n\n5. **Run the migrations and restore the tables in your database. Refer to `cmd/migration/main.go`**\n\n   ```bash\n   go run cmd/migration/main.go\n   ```\n\n6. **Start the REST API Server:**\n\n   ```bash\n   go run cmd/server/main.go\n   ```\n\n7. **Start the gRPC Server:**\n\n   ```bash\n   go run cmd/grpc/main.go\n   ```\n\n---\n\n## Building the Project\n\nThis project uses a Makefile to build server and gRPC binaries.\n\n- **Build Linux server:**\n\n  ```bash\n  make server\n  ```\n\n- **Build Linux gRPC service:**\n\n  ```bash\n  make grpc\n  ```\n\n- **Build for Windows/macOS (cross-platform):**\n\n  ```bash\n  make server-windows\n  make grpc-windows\n  ```\n\n  ```bash\n  make server-macos\n  make grpc-macos\n  ```\n\n- **Build everything at once:**\n\n  ```bash\n  make all\n  ```\n\n- **Clean build artifacts:**\n\n  ```bash\n  make clean\n  ```\n\n- **Running the Server Build:**\n\n  ```bash\n  ./build/server\n  ```\n\n- **Running the gRPC Build:**\n\n  ```bash\n  ./build/grpc\n  ```\n\n## .NET Service\n\n\u003e **Note:** This is a link to the separate .NET repository. The .NET service and the Go/gRPC services communicate with each other.\n\nYou can find the .NET service repository here: [https://github.com/Sahil2k07/OMS-gRPC](https://github.com/Sahil2k07/dotnet-inventory-service)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahil2k07%2Fgrpc-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsahil2k07%2Fgrpc-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsahil2k07%2Fgrpc-go/lists"}