htmx-go-example

module
v0.0.0-...-b63fe73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: BSD-3-Clause

README

Contacts App (Go)

A Go web application made in the spirit of the official Flask example application that accompanies the book Hypermedia Systems. You can use this application as a starting point to follow along with the book starting at HTMX Patterns.

Prerequisites

  • Go 1.23 or later
  • Air for live reloading:
    go install github.com/air-verse/air@latest
    

Development

# Start the Tailwind CSS build process
make watch-css

# In a separate terminal start the development server (Linux / MacOS)
make dev

Tailwind CSS Development Notes

You can develop and build everything using only the TailwindCSS CLI (installed via make tailwindcss) but you likely will not have Tailwind Intellisense in your IDE. If you need Intellisense installing the NodeJS version should enable it - just run npm install in the project root and you should be good to go.

Production

Everything needed to run the application is in the dist directory. You can serve the files using any web server or reverse proxy.

# Build the application
make build

Note

  • This project uses the Library Manager CLI to manage client-side libraries. You do not need it, but I find if you have .NET on your system it is really handy for handling non-bundled client-side assets.

    # Install the client-side libraries
    libman restore
    
  • The data repository is rudimentary as that is not the point of the book, and by using a JSON file as the data store, it is easy to follow along without setting up a database and worrying about additional dependencies.

  • I will win no awards for design in my lifetime and I am okay with this.

Directories

Path Synopsis
cmd
web
internal
pkg
vcs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL