Simple app from Alex Edward's book "let's Go". Written in Go 1.22
Just use docker compose, this will create MySQL and Go backend services. All Go files are watched by air: any changes will be detected and app will rebuild
docker compose up -dApp can be found on https://localhost:4000 (yes, it has self-signed certificate)
- scs for session management
- httprouter for routing
- alice for chaining middlewares
- nosurf CSRF
- crypto for password hashing
Core logic of app
- handlers.go, routes.go – logic of handlers and URL patterns
- middleware.go – some middlewares, e.g. logging, authentication and permission checks
- templates.go – helpers functions for templates
- helpers.go - useful shortcuts, e.g.
serverErrorandrender
- models representation, SQL
- functions for testing
- validation
HTML with Go templating