Skip to content

WannaFight/snippetbox

Repository files navigation

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

About

SnippetBox app from Alex Edward's book "Let's Go"

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages