Skip to content

feat(frontend): add Vite mock API for UI-only development - #285

Merged
zheli merged 6 commits into
mainfrom
zzz/549768c6
Jul 28, 2026
Merged

feat(frontend): add Vite mock API for UI-only development#285
zheli merged 6 commits into
mainfrom
zzz/549768c6

Conversation

@zheli

@zheli zheli commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a Vite middleware mock API so the Web UI can be developed without the Go backend or a running LocalNet.
  • Enable npm run dev:mock with fixture-backed routes, in-memory state, and SSE event streaming.
  • Document mock mode in CONTRIBUTING.md.

Changes

  • Mock layer (frontend/mock/): HTTP router, in-memory store, SSE hub, seed utilities, and JSON fixtures for instances, containers, tokens, contracts, metrics, and related API surfaces.
  • Vite integration: mockApiPlugin wired into vite.config.ts; dev:mock script added to package.json.
  • Tests: Router and seed unit tests (router.test.ts, seed.test.ts).
  • Docs: Mock API mode section in CONTRIBUTING.md.

Test plan

  • cd frontend && npm test — 26 files, 219 tests passed

Notes

Introduce a mock API layer under frontend/mock/ with fixtures, in-memory
store, SSE hub, and route handlers so the Web UI can run via `npm run dev:mock`
without the Go backend or a LocalNet instance. Wire the plugin into Vite,
document mock mode in CONTRIBUTING.md, and add router/seed tests.
@cursor

cursor Bot commented Jul 27, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

zheli added 5 commits July 27, 2026 12:15
npm ci failed in CI because the lockfile was out of sync with
package.json after the mock:seed script added tsx as a devDependency.
npm ci failed on the self-hosted Linux CI runner because the lockfile
was generated on macOS and omitted @emnapi optional peer entries that
Linux npm ci requires.
@zheli
zheli merged commit 1d64582 into main Jul 28, 2026
24 of 25 checks passed
@zheli
zheli deleted the zzz/549768c6 branch July 28, 2026 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant