# Go + PocketBase + HTMX

Dave's signature stack: one Go binary, embedded PocketBase, templ + HTMX, Tailwind. This site is the dogfood.

**Replaces:** Firebase / Supabase + Vercel

**Tier:** Easy

## Problem

The "app in an hour" path usually means Firebase or Supabase for auth and data, plus Vercel for the frontend. You get three bills, a JavaScript toolchain, and a database you cannot move. Most internal tools and content sites do not need that.

## Stack

- [Go](https://go.dev/) — One static binary, no runtime to babysit
- [PocketBase](https://pocketbase.io/) — Embedded realtime DB, auth, and admin (Dave stack — add)
- [htmx-ui/hello](https://github.com/htmx-ui/hello) — HTMX starter patterns
- [shadcn-htmx](https://shadcn-htmx.productdevbook.com/) — shadcn-style components for HTMX + Tailwind v4

## Estimated SaaS cost saved

| You stop paying | Typical / year | Self-host instead |
|---|---:|---|
| Firebase / Supabase (auth + DB + egress) | $1,200 | PocketBase on a 1 GB volume |
| Vercel Pro + extras | $1,200 | Same Go process on Railway |

**About $2,400 / year** on a small team, before you count lock-in.

## Deploy on Railway

Placeholder: one Railway service, PORT, and a /data volume for PocketBase. A one-click template ships next.

## AGENT_PROMPT

```
You are setting up a Go + PocketBase + templ + HTMX + Tailwind site that deploys as ONE Railway service.

Requirements:
- Embed PocketBase as a Go framework (github.com/pocketbase/pocketbase).
- Bind HTTP to 0.0.0.0:$PORT. Persist PocketBase data on /data (or $PB_DATA_DIR).
- Server-render pages with templ. Use HTMX for forms and search. Compile Tailwind to a static CSS file.
- Dockerfile copies the binary and static assets. Do not require Node at runtime.
- Include a /healthz endpoint and a README with local run + Railway volume notes.

Start from this repo's layout and keep the public surface as server-rendered HTML.
```

## FAQ

### Is PocketBase production-ready?

For a single-node app with a volume, yes. It is SQLite plus a small Go admin. If you outgrow it, you still own the schema and can export.

### Why HTMX instead of React?

Most catalog, landing, and form pages are request/response. HTMX keeps the server in charge, which is what you want for SEO and for LLM crawlers.

### Where does the admin live?

PocketBase serves /_/. Use a strong PB_ADMIN email and password via env on first boot.

Source: https://c17.io/stacks/go-pocketbase-htmx
