Getting Started

Start with a complete dog-breeds app built with Go + Templ + HTMX + Alpine.js. Clone it, run it, then read how it works.

Expected outcome

This is the starter app's table running inside the docs. Try search, filtering, sorting, and pagination.

Starter repository
Breed
Group
Origin
Size
Temperament
Australian Shepherd
Australian Shepherd Herding
HerdingUSAMediumActive
Beagle
Beagle Hound
HoundEnglandSmallCurious
Border Collie
Border Collie Herding
HerdingScotlandMediumSmart
Boxer
Boxer Working
WorkingGermanyLargeEnergetic
Bulldog
Bulldog Non-Sporting
Non-SportingEnglandMediumCalm
Page 1 of 4

Use the starter repo

The starter includes the Go server, templ page, generated templ output, and dog images.

bash
git clone https://github.com/araihu/goshtoso-getting-started dog-breeds
cd dog-breeds
go run .
# Open http://localhost:3000

How assets work

  • Goshtoso runtime assets

    CSS, themes, Alpine.js, HTMX, fonts, and library artwork are served from /assets/ by assets.Handler().

  • Starter app assets

    Dog images live in assets/dogs, are embedded with Go, and are served by the starter app from /dog-images/.

Build it manually

The starter repo is the fastest path. The walkthrough below shows the moving parts if you want to build the same app from scratch.

1. Create your project

bash
mkdir dog-breeds && cd dog-breeds
go mod init dog-breeds
go get github.com/a-h/templ@latest
go get github.com/araihu/goshtoso@latest

2. Create the page template

page.templ renders the table and loads Goshtoso's runtime dependencies.

page.templ
// Source file not found: page.templ

3. Create the server

main.go mounts Goshtoso runtime assets, serves embedded dog images, renders the page, and returns HTMX table fragments.

main.go
// Source file not found: main.go

4. Generate and run

bash
templ generate
go run .
# Open http://localhost:3000