Admin Worker
React Router 7 + Cloudflare Worker application serving the Admin Console UI. Proxies API requests to the Admin Lambda backend.
Quick Reference
| Resource | Location |
|---|---|
| Source Code | components/admin_worker/ |
| Infrastructure | infra/admin/ |
UI Overview
| Route | Description |
|---|---|
/ |
Home/landing page |
/accounts |
Accounts list |
/indexes |
Index listing |
/indexes/:id |
Index detail with tabs (Infra, Export, Jobs, Configuration, Aliases) |
/indexes/:id/jobs/:jobId |
Sync job detail |
/monitoring |
System monitoring |
Local Development
cd components/admin_worker
npm install
npm run dev # http://localhost:5173
Local API Access
For local development against a real Admin Lambda:
- Get a Cloudflare Access token from the browser dev tools after authenticating
- Create
.dev.varsfile:LOCAL_CF_ACCESS_TOKEN=your_cf_access_jwt_here - Run
npm run dev
Testing
npm test # Run all tests
npm run coverage # With coverage report
Test Utilities
Use helpers from tests/lib/test-utils.ts:
import {
createMockEnv,
createMockContext,
createMockResponse,
createMockGatewayClient,
setupGatewayClient,
renderWithRouter,
} from "../lib/test-utils";
// Mock a successful API response
setupGatewayClient("get", createMockResponse({ json: { items: [] } }));
// Mock an error response
setupGatewayClient("get", createMockResponse({ ok: false, status: 404 }));
// Render component with router
const { getByText } = render(renderWithRouter(<MyComponent />));