Skip to content

adamwoolhether/hypermedia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypermedia apps with HTMX, HXML, Go and Templ

This repo is an implementation of the example Contacts.app from the book Hypermedia Systems, a wonderful book about, well, Hypermedia.
All HTMX and HXML code relevant to the book can can be found in app/hypermedia.
It remains true to the book's examples for the most part, making a few small css styling adjustments here and there.

The project structure was geared towards a more production-oriented approach, and is inspired by Ardan Labs Service Repo. And yes, some of the structural code was taken directly from there for ease of learning htmx.
Naturally, this is far from anything production ready. There is no auth, and the "DB" is, well, a slice of json objects loaded into memory :).

All makefile commands below have been tested on MacOS only.

Run the web example

make up

Navigate to http://localhost:42069/

Run the Mobile example

We leverage the Hyperview demo to bootstrap our demo.

Install the required libs, iOS simulator, and copy relevant files:

make dev.setup.mobile

Run the backend

make up

In another terminal window, start the iOS simulator*

make mobile

*Alternatively, you can navigate to hyperview/demo/ and use one of the other options to run the demo, but note that Android simulator requires our app to listen on the same IP as your machine. (maybe can add as config later).

Alt Text

Dev

Install Templ and WGO command line tools.

make dev.setup

Run wgo with templ file watching to auto-reload changes

make dev

TODO enhancements/issue:

  • Better flash handling: currently just stuffing into context.
  • Smooth progress bar transition, needed to use JS, possible without?
  • Web cannot delete single contact with checkbox (alpine / sweet confirm), not sure why.