Go web application for submitting and reviewing wiki edit patches (subject/episode/person/character). Uses Chi v5 router, Uber Fx for dependency injection, and PostgreSQL via pgx/v5.
Entry point: main.go → Fx app with handler struct holding all dependencies.
Key flows:
- Users submit patches → stored in PostgreSQL
- Reviewers accept/reject patches → wiki updated via external API
- Canal (Debezium CDC) auto-marks patches outdated when wiki changes
- Notifications sent via Kafka (protobuf-encoded messages on
notify.v1topic)
- Go 1.26, standard library style
- Templates: templ (
.templfiles intemplates/) - SQL: sqlc for type-safe query generation from
db/query.sql - Error handling:
handleErrorhelper returns appropriate HTTP responses - HTTP handlers are methods on the
handlerstruct (Chi router)
Uses Taskfile:
task build— build binary todist/app.exetask dev— build and run with dev tagtask gen— run sqlc code generationtask gen:template— run templ code generationtask format— gofmt + templ fmttask migrate— run database migrations
- Session/CSRF middleware via gorilla packages
- Config loaded from environment variables (see
config.go) - Database transactions use a
txhelper pattern - Kafka messages use manual protowire encoding (no generated Go protobuf code)
- External wiki API calls go through
api.goclient methods