This project aims to demonstrate the implementation of a sample TODO app with plugable storage backend. The system will showcase the following features:
Utilization of Protocol Buffer based API contracts and dependency management via buf.
Generation of OpenAPI specification from the Protobuf API definitions.
Implementation of gRPC and HTTP gateway server for communication.
Sample Golang project architecture showcasing best practices and code architecture.
Multiple testing strategies including unit and end-to-end (e2e) testing, along with support for auto-generated mocks for unit testing.
Containerizing of the system for deployment on Kubernetes. Scripts for Docker images and K8s deployment manifests
Implementation of a server that exposes healthz, statusz, pprof, promethus metrics endpoints for server monitoring and debugging.
CLI application that interacts with server via configurable http or grpc transport.
Non-Goals
This system does not consider user management, authentication or session management. All APIs are assumed to be public and owned by everyone. These features will be demonstrated in future examples.
Application Overview
Checkout the application demo and how the application work here.
Highlevel design
Read the detailed design decision of todo service in docs/design.md.
Code Overview
apis - apis directory contains protocol buffer defination for the service and buf generated golang codes and swagger defination. Golang codes resist inside apis/go directory.
cmd - cmd is the entry point for different binaries. Currenlty have crud-apiserver and todocl
crud-apiserver - runs a server binary that responses to http and grpc.
todocli - is a cli application that can connect to the server via http or grpc and perform operations related to todod.
hack - collection of scripts and configs used in the project
hack/docker - contains the docker file to builf and contair the service.
hack/k8s - basic Kubernetes yaml files to run deployment, mainly inteneded for testing.
hack/scripts - collection of scripts.
pkg - library codes for the project.
pkg/clients - todo service clients.
pkg/service - contsins the business logics implementation of the HelloService.
pkg/storage - implementation of different persistant storage module, includeing database schema and models.
Development
Read the development Guideline and local build instructions in developmen.md.