datapages README

The project's README from github.com/romshark/datapages. As one markdown file: README.md.

Datapages

CI golangci-lint Coverage Status Go Reference License: MIT Release

Discord Slack

[!NOTE] Beta: Datapages is ready for production use. APIs are close to stable but can still change.

Datapages is a web framework and toolchain for Go, Templ and Datastar. It supports collaborative web applications, HTMX-style sites and installable desktop applications.

See FAQ.md for frequently asked questions.

Give coding agents project-specific guidance

datapages init writes instructions and skills for coding agents. datapages lint and datapages gen report invalid application declarations and template calls with file positions and suggested fixes.

Focus on your business logic

Datapages parses and checks the application package, then generates the HTTP wiring. The generated code covers routes, sessions, SSE streams, per-tab state, CSRF protection, typed URL and action helpers, Prometheus metrics and offline service workers. Application code remains Go and Templ.

Examples

Getting Started

See the documentation. Start with the installation and the tutorial.

Specification

SPECIFICATION.md defines handler signatures, parameters, return values, events, sessions and modules.

Modules

Datapages includes modules with replaceable implementations:

Motivation

Go, Templ and Datastar are a direct way to build server-rendered applications. Projects built with them still repeat the same work for routes, SSE streams, NATS, sessions, CSRF protection, development reloads and deployment.

Datapages defines conventions for that repeated work and checks them with the CLI:

These conventions also give coding agents a stable application model. The generated instructions describe the model, and the CLI reports violations with source positions and fixes.

Cost comparison: doing it all yourself, using AI assistance, and Datapages plus AI assistance

Who this is for

Datapages fits projects where:

Contributing

See CONTRIBUTING.md for development setup and commands, DEV.md for the watcher of the documentation pages, and AGENTS.md for code style, testing conventions, commit message format and project structure.

datapages (romshark/datapages)

Searching Database…

What is this?Datapages is a web framework and toolset for building GUI and web apps in pure Go on a Templ + Go + Datastar stack — real-time collaborative web apps, simple server-rendered sites, or installable local-first GUI apps.
How is it different from wiring up Datastar with Go by myself?It parses your source packages and generates the wiring you'd otherwise hand-roll in every project: routing, SSE streams, per-tab server-side state, CSRF protection, Prometheus metrics and service workers — so your code stays clean and takes full advantage of Go's static typing.
What's the first command I run to try it out?Scaffold an app with datapages init; during development datapages gen generates the boilerplate and datapages watch gives you hot-reload with errors shown right in the browser preview.
Do I need NATS or other infrastructure to run it?No — the pieces are pluggable: in-memory sessions and broker work for single-instance apps, and you can swap in NATS-backed implementations (KV sessions with AES-128-GCM encrypted cookies) when you scale out.
The README calls it beta — how safe is it for production?It explicitly says Datapages is ready for production use, but APIs are close to stable and can still change — expect some upgrade churn while it matures.
So it's not for building an offline SPA with a REST API?Correct — it targets server-rendered apps where the server owns the data, not a local-first offline-capable SPA, and it removes the need to maintain a separate REST/GraphQL API just to feed the frontend.
Can it build real desktop apps, or only web apps?Hybrid ones: the calculator example runs both as a multi-client server and as a single-client desktop app, and apps deploy as a single, statically compiled binary.
Why did the author build this instead of using Datastar with Go directly?Datastar + Go + Templ is his preferred stack, but he kept repeating the same patterns — SSE handling, NATS usage, auth, hot-reload setup — in every project. Datapages packages those solutions and adds the structural stability he found missing in the Go Datastar ecosystem.
What is the Tao architecture it enforces?A Datastar Tao-oriented app structure provided as a sensible default — common conventions for types and methods that the tooling checks — while still leaving room to go beyond it. The todolist example is the most Tao-conform one.
Can I use Tailwind CSS or Web Components with it?Yes — there are examples for both: a minimal static page showing Tailwind CSS integration, and a landing page with vanilla and Lit-based Web Components bundled via esbuild through a custom watcher.
Creator
romshark
Size
17.1 MB
Stars
122
Age
10mo
Commits · 90 Days