Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.12 KB

File metadata and controls

36 lines (27 loc) · 1.12 KB

Snippetbox app

Simple app from Alex Edward's book "let's Go". Written in Go 1.22

How to run

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 -d

App can be found on https://localhost:4000 (yes, it has self-signed certificate)

Powered by

Project structure

cmd/web

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. serverError and render

internal

  • models representation, SQL
  • functions for testing
  • validation

ui

HTML with Go templating