/ruby_grpc_skeleton

Ruby gRPC template

Primary LanguageRuby

My Service

Hanami / gRPC fusion. This service does... what?

System Architecture

Setup

This service makes heavy use of docker and docker compose. Setting up docker is beyond the scope of this readme.

mkdir ~/projects/my_project/
cd ~/projects/my_project/
git clone git@github.com:my_project/my_service.git
git clone git@github.com:my_project/protos.git

cd ~/projects/my_project/my_service
docker-compose run --rm bundle install --with development test
docker-compose up -d # you might have to kick this a few times...
docker-compose run --rm bundle exec hanami db prepare
docker-compose run --rm bundle exec rake seed:things
docker-compose run --rm bundle exec rake grpc:fetch_thing

Generate code when you change applicable .proto files:

# This expects your proto files to be in the same directory as your app
docker-compose run --rm protoc

How to run various Hanami commands:

docker-compose run --rm bundle exec hanami console
docker-compose run --rm bundle exec hanami g model NewModel

How to prepare (create and migrate) DB for development and test environments:

docker-compose run -e HANAMI_ENV=test --rm bundle exec hanami db prepare
docker-compose run --rm rpsec

Deployment

This should be done for you via CI/CD, but in case you need to manually push an image:

docker login https://docker.pkg.github.com
docker build -t docker.pkg.github.com/my_project/my_service/my_service:0.1.0 .
docker push docker.pkg.github.com/my_project/my_service/my_service:0.1.0

Reading

Explore Hanami guides, API docs, or jump in chat for help. Enjoy! 🌸

Explore gRPC guides, or jump in chat for help.

Learn about protobuf.

Learn about Docker.

Learn about GitHub Actions.