Arcadia wiring: - home: real Overview dashboard (tenants/users/audit/health probe) replacing the inherited Vibespace welcome tiles; skeleton loaders, refresh button, registers admin context - profile: split into Account (synced via getUser/updateUser of session user) and local Preferences; updateSessionUser keeps the appbar in sync after edits - session: drop unused signIn mock, add updateSessionUser, refresh tests - profile schema: drop redundant Profile.name/email (session is the source of truth) - routes: delete orphaned resources route + lib Auth flows that previously 404'd: - /signup, /login/forgot, /login/reset, /login/2fa wired via @crema/arcadia-auth-ui - shared AuthShell + AuthBrand wrapper Assistant tools (admin-tools.ts): - +10 tools: deactivate_tenant, set_user_status, delete_user, list_memberships, list_roles, revoke_api_key, create_user, update_user, assign_role, remove_role - list_memberships gains user_id filter for "tenants this user belongs to" queries - search_kb / read_chunk: new token resolution (window override → VITE_ARCADIA_SEARCH_TOKEN service token → operator session JWT → "dev"); on 401/403 emit a tailored hint based on which token was used UI consistency: - new PageHeader component - AppShell.title was unrendered — dropped; first-child padding on #main-content keeps the floating actions pill from colliding with header content - removed dead "Sign in required" fallback cards from 14 routes (AppShell already redirects) - stripped p-6 from outer wrappers across 14 routes (was double-padding under AppShell's own p-6) - migrated home + tenants to PageHeader arcadia-search ergonomics: - scripts/mint-search-token.mjs + `npm run mint:search-token` mints HS512 JWT with required tenant_id claim, upserts VITE_ARCADIA_SEARCH_TOKEN into .env.local - README/.env document the new VITE_ARCADIA_SEARCH_URL / VITE_ARCADIA_SEARCH_TOKEN knobs - .env.local now gitignored Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
88 lines
4.3 KiB
Markdown
88 lines
4.3 KiB
Markdown
# Arcadia Admin
|
|
|
|
Admin webapp for [arcadia-core](../reference/arcadia-app) — the multi-tenant Phoenix backend. Built on the [Crema design system](https://git.sky-ai.com/CremaUIStudio) with the **Skyrise** theme and started from the [Vibespace](../vibespace) starter.
|
|
|
|
Surfaces tenant management, user/role administration, billing, audit logs, storage configs, scheduled tasks, feature flags, and platform monitoring on top of arcadia's `/api/v1` and `/admin/*` endpoints.
|
|
|
|
## Quick start
|
|
|
|
```bash
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Open [http://localhost:5173](http://localhost:5173). The app talks to arcadia at `http://localhost:4000` by default; override with `VITE_ARCADIA_URL` in `.env.local`.
|
|
|
|
To use it for real:
|
|
|
|
1. Have arcadia running locally (see `../reference/arcadia-app/DEV_SETUP.md`).
|
|
2. Visit `/login` and sign in with admin credentials. In dev seeds: `admin@example.com` / `AdminP@ssw0rd` (tenant `default`).
|
|
|
|
## Configuration
|
|
|
|
| Env var | Default | Purpose |
|
|
|---|---|---|
|
|
| `VITE_ARCADIA_URL` | `http://localhost:4000` | Base URL of arcadia-core. |
|
|
| `VITE_ARCADIA_TENANT` | `default` | Tenant id sent as `X-Tenant-ID`. Override per-deployment. |
|
|
| `VITE_ARCADIA_SEARCH_URL` | `http://127.0.0.1:7800` | Base URL of arcadia-search (Tantivy). |
|
|
| `VITE_ARCADIA_SEARCH_TOKEN` | _(unset)_ | Service-principal JWT for the assistant's `search_kb`/`read_chunk` tools. Set this when arcadia-search runs in `AUTH_MODE=jwt` and doesn't share its signing secret with the arcadia issuing operator session tokens. When unset, the operator's own session JWT is used (works only with matched signing keys). |
|
|
|
|
## What's in here
|
|
|
|
### App shell
|
|
`app/components/layout/app-shell.tsx` — left rail + appbar + avatar dropdown. Brand identity in `app/lib/identity.ts` (`name: "Arcadia Admin"`, icon: `Shield`). The shell is **template code, not a lib** — fork it freely as admin features are added.
|
|
|
|
### Arcadia client + auth UI
|
|
- [`@crema/arcadia-client`](../lib-arcadia-client) — typed HTTP client (generic + openapi-fetch-backed `client.typed`), Phoenix Channels realtime, error normalization. Mounted at the root via `<ArcadiaProvider>`.
|
|
- [`@crema/arcadia-auth-ui`](../lib-arcadia-auth-ui) — login / signup / password reset / 2FA forms, themed via Skyrise tokens. The `/login` route renders `<LoginForm>`.
|
|
|
|
### Skyrise theme
|
|
[`lib-theme-skyrise`](../lib-theme-skyrise) — premium AI-first glass: iridescent body, frosted-glass surfaces, vivid text, Apple-spring motion. Default 18px root.
|
|
|
|
Surface tints (`body[data-surface="snow|stone|sage|slate"]`) and dark mode (`html.dark`) work out of the box via the existing pickers in the appbar.
|
|
|
|
### Command bus
|
|
[`@crema/action-bus`](../lib-action-bus) — every interactive element has `data-action="<id>"` so admin flows can be scripted, e2e-tested, or driven by an LLM through a single bus. See `docs/AI_FIRST.md`.
|
|
|
|
## Sibling repos
|
|
|
|
```
|
|
your-workspace/
|
|
arcadia-admin/ ← this repo
|
|
vibespace/ ← starter that this was cloned from
|
|
reference/arcadia-app/ ← Phoenix backend (read-only reference)
|
|
lib-arcadia-client/
|
|
lib-arcadia-auth-ui/
|
|
lib-action-bus/
|
|
lib-aifirst-ui/
|
|
lib-chat-ui/
|
|
lib-llm-ui/
|
|
lib-notification-ui/
|
|
lib-theme-skyrise/
|
|
```
|
|
|
|
## Dev scripts
|
|
|
|
| Command | What it does |
|
|
|---|---|
|
|
| `npm run dev` | Vite dev server |
|
|
| `npm run build` | Production build |
|
|
| `npm run start` | Serve the built app |
|
|
| `npm run typecheck` | `react-router typegen && tsc` |
|
|
| `npm run test` | Vitest run |
|
|
| `bash start.sh` / `bash stop.sh` | Run dev server in the background |
|
|
|
|
## Conventions
|
|
|
|
- **Brand strings, not literals.** Use `useBrand().name` — never hardcode "Arcadia Admin".
|
|
- **`[data-action="<id>"]`** on every interactive element. Naming: `nav-*`, `appbar-*`, `tenants-*`, `users-*`, `audit-*`, etc.
|
|
- **Tokens, not values.** `bg-card`, `text-foreground`, `var(--primary)` — never hex.
|
|
- **Lib edits commit to each lib's own repo.** `git status` here only shows app-level changes.
|
|
|
|
## Further reading
|
|
|
|
- [`docs/AI_FIRST.md`](docs/AI_FIRST.md) — command-bus / DSL system tour
|
|
- [`app/components/layout/THEME_CONTRACT.md`](app/components/layout/THEME_CONTRACT.md) — token contract every theme must satisfy
|
|
- `CLAUDE.md` — orientation for an LLM working in this repo
|
|
- `../reference/arcadia-app/` — backend (DEV_SETUP, controllers, OpenAPI source-of-truth)
|