projx / admin-panel
CLAUDE.md71 starsChanged 4 months agoMITView on GitHub
Stack-scoped notes. The root ../CLAUDE.md carries cross-cutting standards — read both, they compose. This directory is a projx template: a working app whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It is Docker-only — a static binary that serves an auth-gated, read-only-by-default table browser over any Postgres reachable via DATABASE_URL. Meant to run internal-only behind nginx. gofmt (via scripts/check-gofmt.sh) → go vet ./... → go build…
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- cli/CLAUDE.mdCLAUDE.md
- e2e/CLAUDE.mdCLAUDE.md
- express/CLAUDE.mdCLAUDE.md
- fastapi/CLAUDE.mdCLAUDE.md
- fastify/CLAUDE.mdCLAUDE.md
- go/CLAUDE.mdCLAUDE.md
- infra/CLAUDE.mdCLAUDE.md
- laravel/CLAUDE.mdCLAUDE.md
- mobile/CLAUDE.mdCLAUDE.md
- nextjs/CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- vitejs/CLAUDE.mdCLAUDE.md
- projxSkill
The file
Files
admin-panel — Go / HTMX admin (projx template)
Stack-scoped notes. The root
../CLAUDE.mdcarries cross-cutting standards — read both, they compose.This directory is a projx template: a working app whose own suite must stay green on the projx repo (root §"Per-template gates") and the source the CLI copies into scaffolded projects. It is Docker-only — a static binary that serves an auth-gated, read-only-by-default table browser over any Postgres reachable via
DATABASE_URL. Meant to run internal-only behind nginx.
Stack
- Language — Go (module
adminpanel) - UI — server-rendered HTMX (no JS build step)
- DB — connects to an arbitrary Postgres via
DATABASE_URL(introspects, does not own a schema) - Auth — session-based admin login + mandatory TOTP 2FA (
internal/auth), argon2id recovery codes, per-admin lockout - Secrets —
internal/secretencrypts/decryptsservice_configscells (AES-256-GCMbase64(IV‖TAG‖CT), byte-compatible with the fastify/fastapi/go writers), write-permission-gated, never logged. A dedicated Service Config editor (/service-config) lets write-mode admins edit the decrypted key-value pairs of a config and re-encrypts on save (internal/web/serviceconfig.go).
Layout
| Path | What it holds |
cmd/admin/ | Entrypoint (main) — excluded from coverage |
internal/auth/ | Login, session, mandatory TOTP 2FA + recovery codes, lockout |
internal/browser/ | Postgres introspection + read-only (default) table browser |
internal/secret/ | Write-gated service_configs encryption + decryption (Node-format cross-compat) |
internal/audit/ | Audit-log writes (decrypt action is logged-but-not-plaintext) |
internal/{config,db,web,testenv}/ | Config, pool, HTMX handlers/templates, test harness |
scripts/ | check-coverage.sh, check-gofmt.sh, test.sh |
Quality gates (root §"Per-template gates")
gofmt (via scripts/check-gofmt.sh) → go vet ./... → go build ./... → go test ./... (real Postgres; integration suite self-skips when TEST_DATABASE_URL is unset) → bash scripts/check-coverage.sh (≥80%, entrypoint excluded). Locally bash ../scripts/ci-local.sh admin_panel.
Things that bite
- Read-only by default — write mode is an explicit, server-side-rechecked permission. The Decrypt affordance only renders for write-mode admins; read-only admins get a 403 even on a hand-crafted request. Never move the gate into hidden UI.
- 2FA is mandatory and server-enforced (
admin_sessions.mfa_passed+admin_users.totp_enrolled_at) — a password-only session is held in the forced-enrolment flow; recovery codes are consumed atomically (no replay). - Decryption key is bootstrap-only (
CRED_ENCRYPTION_KEY, base64 → 32 bytes); when unset the Decrypt action never renders and the route returns 503. - Service config editor is write+key gated —
/service-configedit/save/create require write mode and a configured key (503 if unset, 403 if read-only), re-checked server-side. Values are parsed as JSON on save (numbers/bools/objects typed; a string that looks like JSON is preserved by quoting on display) and re-encrypted; plaintext is never written to the audit log. The add/remove-row form usesstatic/admin.jsevent delegation — no inline handlers (CSPscript-src 'self'). - Docker-only — there is no local dev server story; build the image and run it against a Postgres.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

