Overview
htmx-contact is a web application with a simple contact list functionality. It is built on the following technology stack:
- golang
- htmx
- go-templ
The implementation follows the guidelines from the chapters 03-05 of Hypermedia Systems book. The implementation serves educational purposes and strives to popularize htmx.
This implementation was not endorsed by authors of the book. It does not claim any copyright ownership over source code, patterns, or any other materials from the book.
The book is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This implementation is licensed under The GNU General Public License version 3 which was declared as a “BY-SA–Compatible License” for version 4.0 on 8 October 2015.
Development
OS
Recommended operating system is MacOS or Linux.
On Windows just use wsl 2 and install some common Linux distribution like Ubuntu.
Tools
Please, install:
- make 3.8+ It will be used to run helper commands during development.
Most likely you already have it. If not, here are instructions for MacOS; and here are instructions for Ubuntu. - go 1.22+ It is the primary programming language for our application and toolchain.
For installation instructions, please, see the docs. - golangci-lint It checks code for typical errors (logical, syntactical, best practices and so on).
It is recommended to use binary installation as described here. -
goimports It formats code in the standard code style and organizes imports in alphabetical order.
$ go install golang.org/x/tools/cmd/goimports@v0.17.0 -
templ
It is a template framework that generates html markup in our application. Templates are implemented as*.templfiles; templ compiles them into go code and they become an integral part of our codebase.
Best source of the development documentation is the official guide.
To install, please, run the following command:$ go install github.com/a-h/templ/cmd/templ@v0.2.543
Scripts
To run code generation and build the web app from source, run the following command:
$ make all
To start the web app locally run the following command:
$ make dev
Описание
Implementation of a contact list app from the book hypermedia.systems using golang, htmx, go-templ