Datastar + Go demo: real-time todo list with SSE
  • Go 58.6%
  • HTML 41.4%
Find a file
Ash cd1b1b8464 feat: real-time todo app with Datastar + Go SSE
- Live todo CRUD with SSE fan-out to all connected clients
- Continuous clock stream demonstrating long-lived SSE
- Signal debugging endpoint
- chi router + datastar-go SDK
- Embedded HTML, single binary deployment
2026-02-19 08:37:53 +00:00
go.mod feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00
go.sum feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00
go.sum.bak feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00
index.html feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00
main.go feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00
README.md feat: real-time todo app with Datastar + Go SSE 2026-02-19 08:37:53 +00:00

Datastar Playground 🚀

A real-time todo app built with Datastar + Go — showcasing SSE streaming, reactive UI, and zero-JS-framework patterns.

Features

  • Real-time todos — Add, toggle, delete with instant UI updates via SSE fan-out
  • Live clock — Continuous SSE stream demonstrating long-lived connections
  • Signal debugging — Inspect Datastar client signals from the server
  • No JS framework — Pure HTML + data-* attributes, 11KB client

Architecture

Browser (Datastar 11KB)  ←── SSE ──→  Go (chi router)
     data-* attributes                  datastar-go SDK
     Signals (reactive state)           In-memory store + fan-out

Key Patterns

  1. SSE Fan-out: TodoStore notifies all connected clients via channels
  2. ReadSignals: Extract typed data from Datastar requests
  3. PatchElements: Send HTML fragments to morph into the DOM
  4. PatchSignals: Update client-side reactive state from server
  5. Continuous streams: Clock endpoint keeps connection alive

Run

go run .
# Open http://localhost:8080

Stack

  • Datastar — Hypermedia framework
  • datastar-go — Go SDK
  • chi — HTTP router
  • Go embed — Single binary deployment