In this boring weekend, I spent my time creating a boilerplate code to build application with Go, gRPC and gRPC Gateway (to support RESTful JSON API from frontend into gRPC server).
- Create new docker postgres instance
docker run --name boilerplatedb -e POSTGRES_PASSWORD=secret -p 5438:5432 -d postgres - Copy sample.config => config
make migrate-upmake run-backend
cd migrations- create new migration file with increment prefix under sql folder example:
0003_create_events_table.sql - Write the query, for up and down
- Run
make migrate-up - If you want to rollback
make migrate-down
make generate-mock
2024