Skip to content

typelate/sortable-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sortable Example

A drag-and-drop task list built with Go, htmx, and SortableJS. Tasks within a list can be reordered by dragging, and the new order is persisted to PostgreSQL.

Stack

  • muxt — template-driven HTTP routing
  • htmx + SortableJS — drag-and-drop reordering without a JS framework
  • sqlc — type-safe SQL queries
  • pgx — PostgreSQL driver

Running

Set the DATABASE_URL environment variable and run:

go run github.com/typelate/sortable-example/cmd/server

The server listens on PORT (default 8080).

Goose-like migrations run automatically on startup.

Testing

Unit tests (no database required):

go test ./...

Integration tests in internal/database require a running PostgreSQL instance reachable via DATABASE_URL. They are skipped automatically when the database is unavailable.

License

MIT

About

An example app using muxt, htmx, sortable.js, and Postgres (pgx)

Topics

Resources

License

Stars

Watchers

Forks

Contributors