Add Vite + React Router + shadcn admin SPA - #6
Conversation
Two-pane master-detail Vite + React Router + shadcn frontend that is a full replacement for the Go-template UI, consuming the existing /api JSON endpoints. Includes backend delta: CORS + 3 new JSON endpoints (script test, forward delivery, forward-all recorded). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add `make dev` for a one-command local development loop: brings up Postgres + Redis in Docker (waiting until healthy), applies migrations via the API binary, then runs the API with an in-process worker under Air for hot reload. Add `make dev-setup` (installs Air) and `make dev-down` (stops the infra). Start CHANGELOG.md (Keep a Changelog + SemVer) with a 0.1.0 entry, and document changelog + docs-site upkeep expectations in CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ad errors
Mirror worker.FanoutWorker.runTransform's payload/headers unmarshal
semantics in SourceHandler.TestScript instead of falling back to a
{"_raw": ...} payload or silently discarding a headers unmarshal
error, so a passing preview implies the script will actually run in
production. Also stop discarding the actions-lookup error, which
previously let a DB failure silently run the script against zero
actions and still report success.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Set up the standalone React admin SPA under web/ui/: Vite + React 19 + TS, Tailwind v4 (CSS-first, @tailwindcss/vite), shadcn/ui (base-nova style, 17 base components on @base-ui/react primitives), @/ path alias, and Vitest + RTL + jsdom with a passing smoke test. Scaffolding only — no app features yet. Adds Makefile ui-dev/ui-build targets.
Addresses Task 4 review finding: config file was outside every tsconfig project, producing phantom editor errors. No build/runtime change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Wire inboundauth verification into the ingest handler so unauthenticated or badly-signed webhooks are rejected with 401 before any delivery row is created or published to Redis. Adds a nitrohook_webhook_auth_failures_total counter (source, reason) for observability.
…empts Addresses Task 6 review: useForwardDelivery only invalidated the deliveries list, leaving an open delivery-detail/attempts view stale after a forward (a forward creates a new attempt and changes status). Also widen useDeliveries to accept limit for client parity and drop the now-unused slug param (the deliveries prefix key already covers source-filtered lists). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Re-commits Task 1's persistence layer, which was orphaned from branch history by an intervening amend+reset; content is identical to the reviewed commit 20ad733. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds AppShell (20/80 split with Sources|Deliveries section switcher), generic ListPane, EmptyState, and a createBrowserRouter skeleton wiring /sources and /deliveries index routes. main.tsx now wraps RouterProvider in QueryClientProvider and renders the themed shadcn Toaster.
Adds an auth-card htmx fragment on the source overview page (mirroring mode-card) with a preset dropdown and secret field, backed by a new POST /sources/:slug/auth handler that saves config via store.SetAuthConfig and re-renders the fragment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Wire the /sources route's left pane to real data via useSources(), and add a Base UI-based CreateSourceDialog (react-hook-form + zod) that creates a source and navigates to its detail route on success. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses Task 8 review: onSubmit awaited mutateAsync with no catch, so a failed create produced an unhandled promise rejection alongside the onError toast. Wrap in try/catch; dialog stays open for retry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses Task 10 review: the smtp and twilio field groups in the action form rendered no inline validation errors (their required-field zod messages never displayed), and the payload-mapping/edit-mode-seeding logic (toPayload, defaultValuesFromAction) had no direct test coverage despite being the highest-risk code in the form. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses Task 11 review: the editor re-synced from source.script_body on every change, so a Save-triggered refetch could clobber in-progress edits. Seed only when the slug changes (ref-guarded). Also make the undefined/null JsonViewer tests assert real rendered content instead of toBeDefined(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds RouteError error boundaries to /sources and /deliveries routes, documents the admin SPA (web/ui/README.md) and links it from the root README, and folds in accumulated cleanup: extract a single formatDate helper into lib/utils.ts (removing three duplicated copies) and delete the dead App.tsx/App.css/App.test.tsx scaffold left over from create-vite.
…ssets Adds a third binary, cmd/mcp, a stdio Model Context Protocol server exposing read-only list_sources, list_actions, and list_deliveries tools backed by the existing store (github.com/modelcontextprotocol/go-sdk). Also included: - docker-compose: add Grafana service (promotes prometheus/client_golang to a direct dependency) - web/static: vendor htmx + Monaco editor assets for the script editor UI - Makefile: run-mcp target and bin/mcp build - docs: MCP server guide, tour page, local-dev quickstart section; CLAUDE.md updated to three binaries; astro nav entries - go.mod: bump to go 1.25, add go-sdk and supporting deps - .gitignore: ignore local .superpowers/ tooling state Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ON API createActionRequest/updateActionRequest never bound the config field, so Create validated a nil config (400 "config is required") and Update never passed config into store.ActionUpdateParams (silent no-op). Add Config json.RawMessage to both request structs and wire it into the validation temp action, ActionCreateParams, and ActionUpdateParams. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses whole-branch review (Important): the one env var an operator must set to serve the SPA from a non-default origin was undocumented. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 146 files, which is 96 over the limit of 50. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (9)
📒 Files selected for processing (146)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ter-shadcn-c0fac5
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-handling tasks Commits in-flight UI work (dashboard, header, theme toggle, nuqs status filter, delivery detail body) so per-task commits stay scoped. All 39 frontend tests green at this checkpoint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
source-events.tsx's multi-select changes were committed alongside the error-handling task (a7f7618); this commits the rest of that in-flight feature (checkbox component, queries mutation, tests) so the branch builds standalone. Typecheck clean; 57/57 frontend tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lly fails Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The feat/webhook-auth branch shipped verification with an htmx-only
config UI. This ports it to the SPA stack:
- GET /api/auth/presets and PUT /api/sources/{slug}/auth, mirroring the
htmx handler's validation (unknown preset, missing secret/public key,
fail-closed on blank credentials).
- Authentication card on the React source Overview tab: enable switch,
provider preset select, secret/public-key fields that follow the
preset, inline validation, and a has_secret hint since secrets are
never echoed back.
- Source API responses now carry a sanitized auth_config (enabled,
scheme, preset, public_key, has_secret) instead of the raw JSON,
which previously leaked plaintext signing secrets to every client;
MCP list_sources drops auth_config entirely.
- CORS middleware now allows PUT — its absence failed the browser
preflight for the new endpoint (caught by live verification).
- Includes the Config -> SourceConfiguration rename in inboundauth and
a fix for the setupRouter call-site mismatch that broke the
integration build.
- Docs: API reference for the new endpoints; auth guide updated for
the SPA flow. Changelog entries under Unreleased.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The SourceConfiguration rename swept up FailureReason, which maps verification errors to metric labels and has nothing to do with the config type. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
What
A modern Vite + React Router v7 + shadcn/ui admin SPA for NitroHook (in
web/ui/), a full replacement for the server-rendered Go-template UI, consuming the existing/apiJSON endpoints. Two-pane master–detail layout (~20% list / ~80% detail). No auth (matches current API).Includes a small Go backend delta required for parity:
CORS_ALLOWED_ORIGINS, defaulthttp://localhost:5173)configon the JSON action create/update handlers so slack/smtp/twilio actions work via the APIThe Go-template UI is left untouched.
Stack
Vite · React 18 · TypeScript · React Router v7 · shadcn/ui (Base UI + Tailwind v4) · TanStack Query · react-hook-form + zod · CodeMirror 6 · Vitest + React Testing Library.
Features
Verification
go test ./...✓; new CORS/script-test/forward handler teststsc -bclean, production build succeedsFollow-ups (non-blocking)
errorElementis at the layout level, so a leaf render error replaces the whole shell incl. nav — consider a pathless-parent refactor to keep nav intactz.string().url()deprecation, delivery detail showssource_idUUID vs. name, TestScript response shape differs from the design docDesign + plan:
docs/superpowers/specs/2026-07-10-react-admin-spa-design.md,docs/superpowers/plans/2026-07-10-react-admin-spa.md🤖 Generated with Claude Code