Scaffold: serve, config, embed, base layout #3

Open
opened 2026-05-14 23:17:15 +02:00 by arne · 0 comments
Owner

Parent

#2

What to build

The bare bones of chat-posta — a Go cobra binary with serve and version subcommands. serve starts an HTTP server that returns a "chat.posta.no" welcome page using the lifted design tokens from posta/web's static/style.css (palette, fonts, base typography, dark-mode variants). SQLite is opened on startup with a migration framework in place; no tables created yet. Config layers TOML → env → flags with the same precedence as posta-server (flag > env > config > default). HTML, CSS, and fonts embedded via embed.FS for a self-contained binary.

Acceptance criteria

  • chat-posta version prints the build version
  • chat-posta serve --listen :8080 --db /tmp/test.db starts an HTTP server
  • GET / returns 200 HTML with the cream/forest palette CSS variables
  • Config can be set via flag, env (CHAT_POSTA_*), or TOML
  • Config precedence: flag > env > config > default
  • Binary builds statically with CGO_ENABLED=0
  • SQLite file is created at configured path on first run; subsequent runs reuse it
  • Crimson Pro + IBM Plex Sans/Mono @font-face rules embedded
  • OS-driven dark mode works on the welcome page (lifted dark variants)
  • Static assets served via embed.FS with sensible Cache-Control

Blocked by

None - can start immediately.

## Parent #2 ## What to build The bare bones of `chat-posta` — a Go cobra binary with `serve` and `version` subcommands. `serve` starts an HTTP server that returns a "chat.posta.no" welcome page using the lifted design tokens from `posta/web`'s `static/style.css` (palette, fonts, base typography, dark-mode variants). SQLite is opened on startup with a migration framework in place; no tables created yet. Config layers TOML → env → flags with the same precedence as posta-server (flag > env > config > default). HTML, CSS, and fonts embedded via `embed.FS` for a self-contained binary. ## Acceptance criteria - [ ] `chat-posta version` prints the build version - [ ] `chat-posta serve --listen :8080 --db /tmp/test.db` starts an HTTP server - [ ] GET `/` returns 200 HTML with the cream/forest palette CSS variables - [ ] Config can be set via flag, env (`CHAT_POSTA_*`), or TOML - [ ] Config precedence: flag > env > config > default - [ ] Binary builds statically with `CGO_ENABLED=0` - [ ] SQLite file is created at configured path on first run; subsequent runs reuse it - [ ] Crimson Pro + IBM Plex Sans/Mono `@font-face` rules embedded - [ ] OS-driven dark mode works on the welcome page (lifted dark variants) - [ ] Static assets served via `embed.FS` with sensible `Cache-Control` ## Blocked by None - can start immediately.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
posta/chat#3
No description provided.