rmnr
DocsTourSlicesBest PracticeAgentsInstall

Command Palette

Search for a command to run...

New

Slice · AI prompt

Admin Panel — Unified Product Admin

17-section admin surface (events, funnels, attribution, users, A/B, flags, pricing, CMS, email, audit, ...) gated by RBAC. Auto-filters sidebar by tier (solo/influencer/organization) and user permissions. Single backend resolver (getMyAdminAccess) mirrors frontend gate so UI can never leak.

Resource detail View source
Copy this prompt into Claude / Codex / Cursor
admin-panel.prompt.mdmarkdown
# Install `admin-panel` — Admin Panel — Unified Product Admin

> 17-section admin surface (events, funnels, attribution, users, A/B, flags, pricing, CMS, email, audit, .

📚 Knowledge base : https://resource.rahmanef.com/llms.txt
📦 Slice detail   : https://resource.rahmanef.com/slices/admin-panel
🧠 JSON catalog   : https://resource.rahmanef.com/api/knowledge?slice=admin-panel
🔗 Source         : https://github.com/rahmanef63/resource-site/tree/main/template-base/frontend/slices/admin-panel

## 1. Install

```bash
npx rahman-resources add admin-panel
# alias: npx rr add admin-panel
```

The CLI copies `template-base/frontend/slices/admin-panel/` into your project + augments `.env.example` + installs npm deps automatically. Run it from your project root.

## 2. What it ships

- shadcn primitives: `card`, `badge`, `button`
- peer slices (cascade install):
  - `rbac-roles` — Admin sections require RBAC perms — must seed roles first.
  - `dashboard-shell` — AdminShell is the INNER section nav — mount AdminPage inside the dashboard-shell app chrome.
- convex feature paths: `template-base/convex/features/admin-panel`

## 3. Wire it up

Run `npx rr add admin-panel`. Wrap pages with <AdminPage workspaceId tier>. AccessGate hides UI for non-admins, AdminShell renders 2-col layout with sidebar filtered by tier+perms. ADMIN_SECTIONS in config.ts is SSOT (17 entries). Personal-brand-os = tier 'solo' = owner sees everything.

## Rules of engagement

- shadcn-only UI primitives. No raw `<button>` / `<dialog>` / native date or file inputs.
- 200-line hard cap per source file (extract neighbours when over).
- All Convex queries hit an index (`.withIndex(...)`); never bare `.collect()`.
- Public mutations/queries declare `args:` validators + authz.
- Full ruleset: https://resource.rahmanef.com/best-practice

The agent will fetch /llms.txt for the full ruleset and use /api/knowledge for the JSON catalog.