Get Hacking
Run Minder
Follow the steps in the Installing a Development version guide.
The application will be available on https://localhost:8080
and gRPC on https://localhost:8090
.
When iterating, it can be helpful to only rebuild and reload the minder
container. You can do this with:
make run-docker services=minder
Run the tests
make test
CLI
The CLI is available in the cmd/cli
directory. You can also use the pre-built minder
CLI with your new application; you'll need to set the --grpc-host localhost --grpc-port 8090
arguments in either case.
go run cmd/cli/main.go --help
APIs
The APIs are defined in protobuf here.
An OpenAPI / swagger spec is generated to here
It can be accessed over gRPC or HTTP using gprc-gateway.
How to generate protobuf stubs
We use buf to generate the gRPC / HTTP stubs (both protobuf and openAPI).
To build the stubs, run:
make clean-gen
make gen
Database migrations and tooling
Minder uses sqlc to generate Go code from SQL.
The main configuration file is sqlc.yaml
.
To make changes to the database schema, create a new migration file in the
database/migrations
directory.
Add any queries to the database/queries/sqlc.sql
file.
To generate the Go code, run:
make sqlc
Users will then need to perform a migration
make migrateup
make migratedown
Viper configuration
Minder uses viper for configuration.
An example CLI configuration file is config/config.yaml.example
.
An example server configuration file is config/server-config.yaml.example
.
Most values should be quite self-explanatory.
Before running the app, please copy the content of config/config.yaml.example
into $PWD/config.yaml
file,
and config/server-config.yaml.example
into $PWD/server-config.yaml
file, and modify to use your own settings.