Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thegeorgenikhil/grpc-go-expense-manager-crud
This a simple CRUD application using gRPC and Go, where you can create, read, update and delete expenses.
https://github.com/thegeorgenikhil/grpc-go-expense-manager-crud
crud expense-manager go grpc
Last synced: 5 days ago
JSON representation
This a simple CRUD application using gRPC and Go, where you can create, read, update and delete expenses.
- Host: GitHub
- URL: https://github.com/thegeorgenikhil/grpc-go-expense-manager-crud
- Owner: thegeorgenikhil
- Created: 2022-11-28T09:32:47.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-28T09:35:32.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T16:51:13.638Z (5 months ago)
- Topics: crud, expense-manager, go, grpc
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expense Manager CRUD using gRPC and Go
This a simple CRUD application using gRPC and Go, where you can create, read, update and delete expenses.
# Prerequisites
- [Go](https://golang.org/dl/)
- [Protocol Buffers](https://developers.google.com/protocol-buffers/docs/downloads)# Setting up a gRPC-Go project
1. Create a new directory for your project and cd into it```bash
mkdir grpc-go-expense-manager-crud
cd grpc-go-expense-manager-crud
mkdir client server proto
```2. Installing the gRPC Go plugin
```bash
go install google.golang.org/protobuf/cmd/[email protected]go install google.golang.org/grpc/cmd/[email protected]
export PATH="$PATH:$(go env GOPATH)/bin"
```3. Initialize a Go module
```bash
go mod init github.com/your_username/grpc-go-expense-manager-crudgo mod tidy
```4. Create the proto file with the required services and messages in the proto directory
5. Generate .pb.go files from the proto file
```bash
protoc --go_out=. --go_opt=paths=source_relative \ --go-grpc_out=. --go-grpc_opt=paths=source_relative \ proto/expense.proto
```6. Create the server and client directories and create the main.go files with necessary controllers and services
# Running the application
1. Install the dependencies
```bash
go mod tidy
```2. Run the server
```bash
go run server/main.go
```3. Run the client
```bash
go run client/main.go
```# References
- [What is gRPC](https://grpc.io/docs/what-is-grpc/introduction/)
- [gRPC Go Quickstart](https://grpc.io/docs/languages/go/quickstart/)