---
phase: 09-admin-panel-rearchitecture
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
- frontend/src/layouts/AdminLayout.vue
- frontend/src/components/admin/AdminSidebar.vue
- frontend/src/views/admin/AdminOverviewView.vue
- frontend/src/api/admin.js
autonomous: true
requirements:
- ADMIN-08
- ADMIN-09
- ADMIN-11
user_setup: []
must_haves:
truths:
- "AdminLayout.vue renders an aside (AdminSidebar) and a main content area containing a router-view"
- "AdminSidebar shows the DocuVault logo with an 'Admin' subtitle and five nav links: Overview, Users, Quotas, AI Config, Audit Log — no Back to app link"
- "AdminOverviewView fetches GET /api/admin/overview on mount and renders four stat cards + a 10-row audit table"
- "frontend/src/api/admin.js exports getAdminOverview()"
artifacts:
- path: "frontend/src/layouts/AdminLayout.vue"
provides: "Admin route shell (sidebar + router-view)"
contains: "router-view"
- path: "frontend/src/components/admin/AdminSidebar.vue"
provides: "Admin-only sidebar nav with 5 router-links, no Back to app"
contains: "to=\"/admin/audit\""
- path: "frontend/src/views/admin/AdminOverviewView.vue"
provides: "Stats cards + recent audit table at /admin"
contains: "getAdminOverview"
- path: "frontend/src/api/admin.js"
provides: "getAdminOverview() API client function"
contains: "export async function getAdminOverview"
key_links:
- from: "frontend/src/layouts/AdminLayout.vue"
to: "frontend/src/components/admin/AdminSidebar.vue"
via: "import AdminSidebar"
pattern: "import AdminSidebar from '\\.\\./components/admin/AdminSidebar.vue'"
- from: "frontend/src/views/admin/AdminOverviewView.vue"
to: "frontend/src/api/admin.js"
via: "getAdminOverview()"
pattern: "getAdminOverview\\("
- from: "frontend/src/api/admin.js"
to: "/api/admin/overview"
via: "request()"
pattern: "/api/admin/overview"
---
Create the admin route shell — `AdminLayout.vue` (the route component at `/admin`), `AdminSidebar.vue` (the admin-only sidebar with five nav links per D-07 and no Back-to-app per D-06), and `AdminOverviewView.vue` (the new overview view at `/admin` showing stats cards + last-10 audit table per D-01, D-03). Extend the frontend `api/admin.js` module with `getAdminOverview()` so the view can fetch the new backend endpoint.
Purpose: ADMIN-08 requires `AdminLayout.vue` as the `/admin` route component with its own sidebar; ADMIN-09 defines the nav set (D-06 overrides the Back-to-app link); ADMIN-11 requires the overview UI. This plan builds the shell + new view; routing is wired in 09-04.
Output: 4 new/modified frontend files. The shell renders correctly when manually mounted; the overview view single-fetches the backend endpoint built in 09-01.
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
@.planning/phases/09-admin-panel-rearchitecture/09-CONTEXT.md
@.planning/phases/09-admin-panel-rearchitecture/09-RESEARCH.md
@.planning/phases/09-admin-panel-rearchitecture/09-PATTERNS.md
@CLAUDE.md
@frontend/src/layouts/AuthLayout.vue
@frontend/src/components/layout/AppSidebar.vue
@frontend/src/components/admin/AuditLogTab.vue
@frontend/src/api/admin.js
@frontend/src/stores/auth.js
@frontend/src/utils/formatters.js
From frontend/src/api/client.js (re-export barrel from Phase 8):
- `request(path, options)` — the canonical fetch helper with 401-refresh handling. New API helpers MUST call `request()` and not roll their own `fetch`. Import via `./utils.js` in the domain module: `import { request } from './utils.js'`.
From frontend/src/api/admin.js (existing domain module — Phase 8 CODE-04 output):
- Already exports `listAdminUsers`, `createAdminUser`, `setAdminUserQuota`, `getAiConfig`, etc. via `request()`. Add `getAdminOverview` alongside these.
From frontend/src/stores/auth.js:
- `useAuthStore()` exposes `user` (ref with `{ email, role, ... }`) and `logout()` action. AdminSidebar imports the store for the user footer + sign-out.
From frontend/src/components/layout/AppSidebar.vue (reference pattern):
- Container: `Task 1: Add getAdminOverview() to api/admin.jsfrontend/src/api/admin.js
- frontend/src/api/admin.js (current exports — Phase 8 CODE-04 file; find the existing `request` import and the pattern other GET helpers use, e.g. `listAdminUsers`)
- frontend/src/api/utils.js (confirm `request` is exported here per Phase 8 CODE-04)
- frontend/src/api/client.js (verify `getAdminOverview` re-export is automatic via the barrel)
- `getAdminOverview()` returns a Promise resolving to `{ user_count, total_storage_bytes, doc_status, recent_audit }`.
- On 401 the underlying `request()` triggers a silent refresh; on non-401 errors the rejected Promise carries the server message.
- Function is exported as a named export and re-exported automatically from `client.js` via the existing barrel.
Open `frontend/src/api/admin.js`. Add a new named export `getAdminOverview` that calls `request('/api/admin/overview')` and returns its result (no extra wrapping). Follow the exact style of the existing GET helpers in the same file (likely `export async function getAdminOverview() { return request('/api/admin/overview') }`). Do NOT define a duplicate `request` import; reuse whatever import line already exists in `admin.js`. Do NOT touch `client.js` — Phase 8 CODE-04 made it a re-export barrel that picks up every named export from `admin.js` automatically.cd frontend && grep -c "export async function getAdminOverview" src/api/admin.js && grep -c "/api/admin/overview" src/api/admin.js
- `grep -c "export async function getAdminOverview" frontend/src/api/admin.js` returns 1.
- `grep -c "'/api/admin/overview'" frontend/src/api/admin.js` returns 1.
- No new `import` line for `request` is added; existing import is reused.
- `cd frontend && node -e "import('./src/api/admin.js').then(m => { if (typeof m.getAdminOverview !== 'function') process.exit(1) })"` exits 0 (function is exported).
`getAdminOverview()` exists in `api/admin.js` and resolves via the standard `request()` helper.Task 2: Create AdminLayout.vue + AdminSidebar.vuefrontend/src/layouts/AdminLayout.vue, frontend/src/components/admin/AdminSidebar.vue
- frontend/src/layouts/AuthLayout.vue (template-only layout pattern; confirms the "no App.vue branch" idiom)
- frontend/src/components/layout/AppSidebar.vue (CSS classes, scoped style block, SVG family, user footer, sign-out function — copy these verbatim)
- frontend/src/stores/auth.js (signature of `useAuthStore()` and `logout()`)
- PATTERNS.md §AdminSidebar.vue (SVG path strings for the five nav icons)
- `AdminLayout.vue` template: `