A simple full-stack task management application built with Go, PostgreSQL, and Docker. Users can securely manage personal to-do lists with authentication and a clean web interface.
- π User authentication (login/logout)
- β Create, read, update, delete (CRUD) tasks
- π Mark tasks as complete/incomplete
- β‘ Fast backend using Go
- π PostgreSQL database with indexing
- π³ Dockerized setup for easy deployment
- π Simple frontend with HTML + Tailwind CSS
- π Infrastructure automation using Terraform & Ansible
- π» Monitoring Logs, System and Uptime
task-manager/
.
βββ ansible
β βββ deploy.yml
β βββ inventory.yml
β βββ node_expoter.yml
β βββ update-install.yml
βββ cmd
β βββ server
βββ docker-compose.yml
βββ Dockerfile
βββ docs
β βββ ansible-task.log
β βββ images
β βββ nginx-with-ha.log
β βββ terraform-task.log
βββ go.mod
βββ go.sum
βββ internal
β βββ config
β βββ handlers
β βββ middleware
β βββ models
β βββ repository
β βββ services
βββ LICENSE
βββ migrations
β βββ init.sql
βββ monitoring
β βββ alertmanager
β βββ alloy
β βββ blackbox-exporter
β βββ docker-compose.yml
β βββ grafana-storage
β βββ loki
β βββ prometheus
β βββ webhook_receiver
βββ nginx.conf
βββ README.md
βββ terraform
β βββ main.tf
β βββ terraform.tf
β βββ terraform.tfstate
β βββ terraform.tfstate.backup
β βββ vagrant
β βββ variable.tf
βββ web
βββ templates
- Backend: Go 1.25
- Database: PostgreSQL 17
- Frontend: HTML + Tailwind CSS
- Authentication: bcrypt password hashing
- Containerization: Docker & Docker Compose
- Infrastructure: Terraform + Ansible
- Monitoring: Prometheus, Grafana, Loki, Alloy, Alertmanager, blackbox-exporter
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Login page |
| POST | /login |
Authenticate user |
| GET | /logout |
Logout user |
| GET | /dashboard |
View tasks |
| POST | /task/create |
Create task |
| POST | /task/update |
Update task |
| GET | /task/toggle |
Toggle completion |
| GET | /task/delete |
Delete task |
- Docker & Docker Compose
- Go 1.25 (for local development)
- PostgreSQL 17 (or use Docker)
# Clone and navigate
cd crud-api
# Start the application
docker-compose up -d
# Application runs on http://localhost:8080# Install dependencies
go mod download
# Set environment variables
export DB_USER=postgres
export DB_PASS=password
export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=task_manager
# Run migrations
psql -U postgres -d task_manager -f migrations/init.sql
# Start server
go run cmd/server/main.goDB_USER=postgres
DB_PASS=your_password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=task_manager
SERVER_PORT=8080
Monitoring stack includes:
- Prometheus - Metrics collection
- Grafana - Visualization & dashboards
- Loki - Log aggregation
- Alloy - Flexible telemetry collector
Access Grafana at http://localhost:3000 (default: admin/admin)
This project is licensed under the MIT License. See LICENSE file for details.
idusernamepassword_hashcreated_at
iduser_idtitledescriptionis_completedcreated_atupdated_at
Indexed on
user_idfor performance.
git clone https://github.com/your-username/task-manager.git
cd task-managerEdit docker/docker-compose.yml or create a .env file:
DEFAULT_USER=admin
DEFAULT_PASS=admin123
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=taskdb
cd docker && docker-compose up --build -dOpen your browser:
http://localhost:8080
Login with:
Username: admin
Password: admin123
This project includes a .devcontainer setup for seamless development in VS Code.
- Install Dev Containers extension in VS Code
- Press:
Ctrl + Shift + P β Reopen in Container
- Preconfigured Go environment
- PostgreSQL runs alongside app
- No local setup required
- Consistent dev environment
Ref: https://registry.terraform.io/providers/bmatcuk/vagrant/latest/docs
cd terraform
terraform init
terraform applycd ansible
# Step 1 β install curl, ca-certificates on target hosts
ansible-playbook -i inventory.yml update-install.yml
# Step 2 β install Docker, copy compose files, start the app
ansible-playbook -i inventory.yml deploy.ymlBoth playbooks handle Debian (apt) and RedHat / AlmaLinux (dnf) automatically via ansible_os_family.
The deploy strategy pulls the pre-built image from DockerHub β only docker-compose.yml and migrations/ are transferred to each server, making it reproducible on any new host without rebuilding.
Terraform β Provision VMs
β
Ansible (update-install.yml)
β
Ansible (deploy.yml)
β
Application running on :8080
| Playbook | Debian / Ubuntu | RedHat / AlmaLinux |
|---|---|---|
update-install.yml |
apt | dnf |
deploy.yml |
apt + Docker GPG key | dnf + Docker CE repo |
For detailed more detail logs visit: ./docs/
Note: Promtail reached end of life (EOL) on March 2, 2026.
https://grafana.com/docs/loki/latest/send-data/promtail/
So, I used Alloy to collect logs and forward them to Loki.
Built with Go for learning and practical DevOps integration.