ddfec7258ffc6e832f5f5782c25d0fdf420808a6
- /roles — role table with create dialog and a permission-matrix sheet: collapsible per-module sections (selected/total counts, role's own modules start expanded) and a key/description filter that force- expands matches; super-admin role is read-only - /admin-users — user search (Enter to run) with role assignment dialog; editing your own roles is blocked Both nav items gate on auth:role:* keys, which only super-admin holds. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gig-admin
Standalone admin dashboard for the gig-platform backend (/api/admin/v1/*).
React 19 · TanStack Start (SPA mode) · TanStack Query/Table · shadcn/ui · Tailwind v4 · TypeScript.
Quick start
cp .env.example .env # VITE_API_BASE_URL → backend origin
pnpm install
pnpm dev # http://localhost:3000
Log in with an admin-role account (Passport password grant against
POST /api/admin/v1/auth/login/password). To seed a local admin, run in the
backend repo:
ddev exec php artisan tinker storage/app/e2e-admin-seed.php
# → admin@gig.local / Admin@12345
Scripts
| Command | Purpose |
|---|---|
pnpm dev |
dev server on :3000 |
pnpm build / pnpm preview |
production build / preview |
pnpm typecheck |
tsc --noEmit |
pnpm test |
vitest (API client envelope/refresh/error tests) |
pnpm gen:api |
regenerate src/api/types.gen.ts from the backend's scribe-admin OpenAPI spec (../gig-platform/public/api-docs/admin/openapi.yaml; run ddev exec php artisan scribe:generate --config scribe-admin there first) |
Architecture notes
- Auth: Bearer tokens in localStorage (zustand persist).
src/api/client.tsunwraps the{success, data, message}envelope, sendsX-Language-Locale, and does a single-flight refresh-then-retry on 401 (POST /api/v1/auth/refresh-token,client_machine_name=admin-api-client). - Permissions:
GET /auth/mereturnsmeta.roles/meta.permissions; nav items and routes gate on them (super-adminpasses everything). - Lists:
useListPage+<DataTable>bind to the backend'spagination {current_page, page_size, …}shape (page/page_sizeparams). - Generated types (
types.gen.ts) are reference-only (@ts-nocheck— scribe emits duplicate operationIds); hand-written shapes live insrc/api/types.ts.
Features (milestone 1)
- 分类管理:分类树 CRUD、待审核队列(通过/驳回/合并到已有分类)
- 内容工作室:机器人作者(暂停/恢复)、系列、文章、子话题、分类简报、风格预设、 Agent 接入令牌(签发一次性展示 / 吊销)
- 用户与系统:SID 保留规则、幸运号码、查询/分配;语言设置;推送设备;机器人会话令牌
Next milestones: moderation reports (comment / file-x), dashboard stats (needs backend endpoints).
Description
Languages
TypeScript
99.3%
CSS
0.5%