Todo App built in Go with Skaffold deployment.
- sqlc - generate database interface and models from migrations and queries
- openapi-generator - generate models and clients from OpenAPI spec
- dockertest - spin up postgres in docker for integration tests
Bootstrap Kubernetes cluster in docker:
make bootstrap
This will setup local cluster running in Docker using kind.
Bootstrap might take some time to deploy Postgres.
Run the stack in the current terminal:
bin/skaffold run --force --port-forward
Terminating the run will destroy all resources except Postgres.
Skaffold will build Docker images and deploy the stack to the cluster.
Continously develop stack:
bin/skaffold dev --force --port-forward
If files change the affected artifacts will be built and re-deployed automatically.
Following ports are exposed:
:8080
API:9000
API Documentation:5432
Postgres
Create a note:
curl -s -X POST -H 'Content-Type: application/json' http://:8080/api/v1/todo -d '{"title": "Foo", "content": "Bar"}' | jq
Get a note:
curl -s http://:8080/api/v1/todo/:id | jq
List notes:
curl -s http://:8080/api/v1/todo | jq
Destroy the cluster:
make clean-kind
All data in Postgres will be lost.
Full cleanup including downloaded tools:
make clean