https://github.com/zachcoleman/poc-template
A template for quickly building grpc-based POC applications
https://github.com/zachcoleman/poc-template
buf grpc grpc-gateway leptos rust tonic
Last synced: 14 days ago
JSON representation
A template for quickly building grpc-based POC applications
- Host: GitHub
- URL: https://github.com/zachcoleman/poc-template
- Owner: zachcoleman
- License: apache-2.0
- Created: 2023-08-29T03:08:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-30T04:52:30.000Z (almost 3 years ago)
- Last Synced: 2025-07-15T01:55:40.795Z (11 months ago)
- Topics: buf, grpc, grpc-gateway, leptos, rust, tonic
- Language: Rust
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# poc-template
## Prerequisites
```sh
brew install make
brew install protobuf
brew install bufbuild/buf/buf
```
## Gateway Setup
```sh
cd gateway
go get \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
google.golang.org/protobuf/cmd/protoc-gen-go \
google.golang.org/grpc/cmd/protoc-gen-go-grpc
export GO_PATH=~/go
export PATH=$PATH:$GO_PATH/bin
```
## Run gRPC-Gateway
```sh
cd gateway && go run .
```
## Generate Protobuf Definitions and Code
For the Gateway and other `buf` tools:
```sh
cd proto && buf generate --path *.proto
```
For the Tonic client and server:
```sh
cd backend && cargo build
```
## Run Server:
```sh
cargo run --bin server
```
## Run Integration Tests (depends on running server)
```sh
cargo test
```
## Verify SQLite is Installed:
```sh
sqlite3 --version
```
Install if necessary:
```sh
brew install sqlite
```
## Install `sqlx` cli
```sh
cargo install sqlx-cli
```
## Create and Migrate the database
If `DATABASE_URL` is set:
```sh
sqlx database create
sqlx migrate run
```