Skip to content

shaxbee/todo-app-skaffold

Repository files navigation

Skaffold Todo App

Skaffold Todo App

Todo App built in Go with Skaffold deployment.

Features

  • 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

Prerequisites

Development

Bootstrap

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

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.

Develop

Continously develop stack:

bin/skaffold dev --force --port-forward

If files change the affected artifacts will be built and re-deployed automatically.

Test

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

Cleanup

Destroy the cluster:

make clean-kind

All data in Postgres will be lost.

Full cleanup including downloaded tools:

make clean

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published