A containerized Todo Web API built using Go, REST, MongoDB, Docker, and Kubernetes, applying Clean Architecture principles.
Task Forge API is a simple containerized Todo Web API designed to demonstrate the application of modern technologies and practices:
- Go (Golang) for backend implementation
- REST API for communication
- MongoDB for persistence
- Docker for containerzation
- Kubernetes for orchestration
- Clean Architecture for maintainability and separation of concerns
This project is intended to run locally using Minikube and Makefile.
- Linux or WSL environment
- Minikube installed and running
- Make installed
From the root of the project directory, run:
make allThis will:
- Build the API image
- Deploy MongoDB and the API into Minikube
- Expose the API on localhost:8080
Here are sample requests supported by the API:
curl --location --request GET 'localhost:8080/api/todos'curl --location --request POST 'localhost:8080/api/todos' \
--header 'Content-Type: application/json' \
--data '{"title":"dummy","completed":false}'curl --location --request PUT 'localhost:8080/api/todos/7f3c9f2e-8c6a-4b9d-9f7a-2e1a4c6d8b90' \
--header 'Content-Type: application/json' \
--data '{"title":"dummy2","completed":false}'curl --location --request DELETE 'localhost:8080/api/todos/7f3c9f2e-8c6a-4b9d-9f7a-2e1a4c6d8b90'curl --location --request GET 'localhost:8080/health/live'
curl --location --request GET 'localhost:8080/health/ready'The project follows Clean Architecture, separating concerns into delivery, domain, infrastructure, and use cases:
cmd/
main.go # Application entrypoint
internal/todo/
delivery/http/ # HTTP handlers (controllers)
error.go
http_todo_handler.go
domain/entity/ # Core domain entities
todo.go
infra/ # Infrastructure layer
repository/
boltdb/
boltdb_todo_repository.go
mongodb/
mongodb_todo_repository.go
service/
uuid_generator.go
mocks/ # Mocks for testing
usecase/ # Application use cases (business logic)
repository/
service/
create_todo_use_case.go
create_todo_use_case_test.go
delete_todo_use_case.go
delete_todo_use_case_test.go
get_todos_use_case.go
get_todos_use_case_test.go
update_todo_use_case.go
update_todo_use_case_test.go
error.go
k8s/ # Kubernetes manifests
api/
configmap.yaml
deployment.yaml
service.yaml
mongo/
deployment.yaml
pv.yaml
pvc.yaml
service.yaml
Dockerfile # Container build instructions
Makefile # Build and deploy automation
go.mod / go.sum # Go module dependencies
.gitignore # Git ignore rules
This project was built to:
- Showcase containerization and orchestration with Kubernetes
- Demonstrate clean architecture in Go
- Provide a simple, practical example of a RESTful API with persistence
This project is for educational and demonstration purposes.