Skip to content

zachcoleman/poc-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poc-template

Prerequisites

brew install make
brew install protobuf
brew install bufbuild/buf/buf

Gateway Setup

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

cd gateway && go run .

Generate Protobuf Definitions and Code

For the Gateway and other buf tools:

cd proto && buf generate --path *.proto

For the Tonic client and server:

cd backend && cargo build

Run Server:

cargo run --bin server

Run Integration Tests (depends on running server)

cargo test

Verify SQLite is Installed:

sqlite3 --version

Install if necessary:

brew install sqlite

Install sqlx cli

cargo install sqlx-cli

Create and Migrate the database

If DATABASE_URL is set:

sqlx database create
sqlx migrate run

About

A template for quickly building grpc-based POC applications

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published