Example Golang application for our workshop. Todo list web app.
- Go 73.1%
- HTML 26.9%
| config | ||
| db | ||
| handlers | ||
| models | ||
| parser | ||
| templates | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
mytodo
A minimal, Todoist-inspired TODO web app written in Go + Tailwind CSS + HTMX. Storage through GORM, with drivers for SQLite (default), MariaDB/MySQL, and PostgreSQL.
Features
- Today view by default — includes carried-over overdue tasks from previous days.
- Inline edit — click a task to edit title, due date and priority in place.
- Priorities P1 (red), P2 (orange), P3 (blue), and None (gray).
- Natural-language dates in the quick-add input:
today,tomorrow,yesterday- weekdays:
friday,next monday, … in 3 days,in 2 weeks,next week- ISO dates:
2026-05-01 - US-style
5/1or5/1/2026
- Priority shortcuts inside the title:
p1,p2,p3,p4(or!,!!,!!!). - Jump to date / Upcoming views (next 14 days grouped by day).
- Completed tasks disappear immediately from the view.
Quick start
go build -o mytodo .
./mytodo # SQLite at ./mytodo.db, :8080
Open http://localhost:8080.
Configuration
Via flags or env vars:
| Flag | Env var | Default | Description |
|---|---|---|---|
--db-driver |
MYTODO_DB_DRIVER |
sqlite |
sqlite, mysql (or mariadb), postgres |
--db-dsn |
MYTODO_DB_DSN |
mytodo.db |
Connection string / file path |
--port |
MYTODO_PORT |
8080 |
HTTP port |
SQLite (default)
./mytodo --db-dsn ./mytodo.db
MariaDB / MySQL
./mytodo --db-driver mysql \
--db-dsn 'user:pass@tcp(127.0.0.1:3306)/mytodo?charset=utf8mb4&parseTime=True&loc=Local'
PostgreSQL
./mytodo --db-driver postgres \
--db-dsn 'host=127.0.0.1 user=mytodo password=secret dbname=mytodo port=5432 sslmode=disable TimeZone=Local'
The schema is auto-migrated on startup.
Usage examples
Type into the quick-add box:
Buy milk tomorrow p1Call mom todayShip release friday p2Pay invoice 2026-05-01 !!!Team meeting in 3 days
Project layout
config/ -- flag / env loading
db/ -- GORM init + migrations
models/ -- Task model, priority helpers
parser/ -- natural-language date + priority parser
handlers/ -- Gin handlers (views + HTMX CRUD partials)
templates/ -- Go html/template files (Tailwind via CDN + HTMX)
main.go -- wire everything up
License
MIT