feat(admin): build tooling, Docker stage and docs; close test gaps

- Add Makefile (admin, build, test) and a node stage in the Dockerfile
- Add .dockerignore so host node_modules and builds stay out of the image
- Document the admin UI in the README
- Cover mutation survivors: token cleanup on non-401 failures, cache dropped on 401 and sign out, member filter by name, archive invalidated after approval, page offset
This commit is contained in:
tgiachi 2026-11-09 15:42:07 +01:00
commit a0a083273c

View file

@ -15,6 +15,8 @@ A modern, single-binary mailing list manager: an evolution of Mailman.
- Per-recipient one-click unsubscribe links (RFC 8058) with signed tokens.
- SQLite storage, one YAML config file.
- Admin REST API under `/api/v1` (see `docs/openapi.yaml`).
- Admin web UI (Vite, React, shadcn/ui) served by the API listener at `/`: lists, settings,
members, held queue and archive.
## Run
@ -40,6 +42,21 @@ the unsubscribe links in every message use it. Keep the `api` listener private.
curl -H "Authorization: Bearer $PARSIMONY_API_TOKEN" -d '{"name":"dev","domain":"example.org","title":"Dev"}' localhost:8080/api/v1/lists
```
## Admin UI
The UI is a single-page app in `admin/`, built into `internal/adminui/dist` and embedded in the binary.
It is served on the API listener together with `/api`, so it needs no CORS, and only when
`PARSIMONY_API_TOKEN` is set. You sign in with that token (kept in `sessionStorage`, gone when the tab closes).
```
make admin # npm ci && npm run build
make build # go build, embeds the UI
make test # go test + vitest
```
Without `make admin` the binary still builds and the UI answers 503 with a hint.
For frontend work run the daemon, then `cd admin && npm run dev` (Vite proxies `/api` to `127.0.0.1:8080`).
## Postfix
Deliver the list domains to parsimony over LMTP and keep the `+` extensions intact, for example: