---
title: "Admin console"
description: "Role-aware three-pane admin navigation — section hubs in main menus, in-module submenus in the right rail, Security hub tabs, and shared SSOT config"
locale: "en"
---
# Admin console

> **Info**
> Use **Founder** / **Developer** tabs in the docs sidebar to filter this page. HTTP handlers for the same desks live in [Admin API](/docs/api/admin.md).

Ring’s **Admin console** (`/admin/*`) is a three-pane operator surface: left menus for **section hubs**, center for work, right rail for **in-module submenus** and related hubs. Navigation is role-filtered from one SSOT — platform admins (`admin` | `superadmin`) see community, trust, commerce, and CRM hubs; **superadmin** also sees Platform ops (settings, processes, performance, subscriptions, Web3).

| Surface | What it shows | Source |
|---------|---------------|--------|
| Icon rail | Single **Admin** entry → `/admin` | `sidebar-rail.tsx` + `isPlatformAdmin` |
| Desktop aside | Grouped hubs (Overview → … → Platform) | `useAdminNavMenu` ← `admin-nav-config.ts` |
| Mobile bottom sheet | Same filtered hubs | `bottom-navigation.tsx` |
| Right rail | Submenu → related hubs → optional news stats → help | `AdminWrapper` → `admin-rail.tsx` |
| Dashboard tiles | Same hubs (minus Dashboard itself) | `admin-dashboard-tiles.ts` |
| CRM shell | Full-width center + horizontal tabs (no right rail) | `CrmAdminShell` |

### For founders

## Why this matters for your clone

Operators should not hunt three different menus. One config drives desktop, mobile, dashboard tiles, and the right rail — so promoting someone to **admin** or **superadmin** changes what they can open consistently.

  
- **[Trust & safety hub](/docs/features/security.md)** — Security center folds fraud desk and verification into `/admin/security?tab=…`.

  
- **[Email AI-CRM](/docs/features/email-ai-crm.md)** — Inbox, drafts, contacts, analytics, and tasks under `/admin/crm/*` with `CrmAdminShell` tabs.

  
- **[Owner Project Lab](/docs/features/owner-project-lab.md)** — CRM orders desk, shared Project room, buyer My Projects.

  
- **[Store & ERP](/docs/features/store.md)** — Store hub opens products; rail links orders, stock, commissions, and add product.

  
- **[Telegram admin bot](/docs/features/manage-via-telegram.md)** — Whitelist RBAC for remote ops — complements the web console.

### Operator journey (typical day)

1. Open **Admin** from the icon rail → dashboard tiles for every hub you can access.
2. Jump to **Security** for fraud / verification / events without separate top-level Fraud or Verification menu items.
3. Use the **right rail** on News, Store, Matcher, DAO, Web3, Users, or Moderation for in-module links (and related hubs). **CRM** pages hide the right rail and use horizontal tabs instead.
4. **Superadmin** only: Platform group — Settings, Processes, Performance, Subscriptions, Web3 (settings page is superadmin-gated).

> **Tip**
> Legacy URLs `/admin/fraud-desk` and `/admin/verification` still work — they **redirect** into the Security hub tabs so bookmarks and old docs keep working.

### Role checklist

| Role | Main menus | Platform group |
|------|------------|----------------|
| `admin` | Overview, Community, Trust & safety, Commerce, Email & CRM | Hidden |
| `superadmin` | Same + Platform | Settings, Processes, Performance, Subscriptions, Web3 |

SSOT roles: `features/auth/user-role.ts` (`isPlatformAdmin`, `isSuperadmin`). Layout guard: `AdminAuthGuard` on `app/[locale]/admin/layout.tsx`.

### For developers

## Architecture

```mermaid
flowchart LR
  Config["admin-nav-config.ts"]
  Filter["filterAdminNavByRole"]
  Hook["useAdminNavMenu"]
  Aside["sidebar-aside"]
  Mobile["bottom-navigation"]
  Tiles["admin-dashboard-tiles"]
  Wrapper["AdminWrapper pageContext"]
  Rail["admin-rail"]

  Config --> Filter
  Filter --> Hook
  Filter --> Tiles
  Filter --> Rail
  Hook --> Aside
  Hook --> Mobile
  Wrapper --> Rail
```

### Module map (verified)

| Concern | Path |
|---------|------|
| Nav groups, `pageContext`, rail submenus, related hubs | `features/admin/admin-nav-config.ts` |
| Labels builder | `features/admin/admin-labels.ts` |
| Icons | `features/admin/admin-nav-icons.tsx` |
| Aside + mobile hook | `features/admin/use-admin-nav-menu.ts` |
| Dashboard tiles | `features/admin/admin-dashboard-tiles.ts` |
| Right rail UI | `components/layout/rails/admin-rail.tsx` |
| Layout shell | `components/wrappers/admin-wrapper.tsx` → `RingRightRailLayout` |
| Email shell (deprecated alias) | `features/admin/email/email-admin-shell.tsx` → `CrmAdminShell` |
| CRM shell | `features/admin/crm/crm-admin-shell.tsx` |
| Routes | `constants/routes.ts` (`ADMIN_*`, `ADMIN_CRM_*`; `ADMIN_EMAIL_*` aliases → `/admin/crm/*`) |
| Locale copy | `locales/{en,uk,ru}/modules/admin.json` |

### Main menu groups (`ADMIN_NAV_GROUPS`)

| Group `id` | Title key | Items (hubs) | `minRole` |
|------------|-----------|--------------|-----------|
| `overview` | `navGroupOverview` | Dashboard | `admin` |
| `community` | `navGroupCommunity` | Users, News, DAO, Moderation, Analytics | `admin` |
| `trust` | `navGroupTrust` | Security, Matcher | `admin` |
| `commerce` | `navGroupCommerce` | Store → products, Refcodes | `admin` |
| `email` | `navGroupEmail` | CRM orders + inbox hubs | `admin` |
| `platform` | `navGroupPlatformOps` | Settings, Processes, Performance, Subscriptions, Web3 | `superadmin` |

Fraud desk and Verification are **not** main-menu items.

### Right rail contract

Order in `AdminSidebarContent`:

1. **In-module submenu** when `resolveRailSection(pageContext)` is non-null and `getRailSubmenu` returns links  
2. **Related hubs** via `getRelatedHubs`  
3. **Full quick nav** only when `pageContext === 'dashboard'`  
4. **News stats** when `pageContext === 'news'` and `newsStats` is passed  
5. **Help** docs links  

Active highlighting for query tabs uses `pathWithQuery` (`pathname` + `useSearchParams`) so Security / Matcher / Moderation `?tab=` links highlight correctly.

| `pageContext` | Rail section | Notable submenu |
|---------------|--------------|-----------------|
| `security` / legacy fraud-desk / verification | `security` | `?tab=overview\|fraud\|verification\|events` |
| `matcher` | `matcher` | Analytics vs `?tab=moderation` |
| `store` | `store` | Products, orders, stock, commissions, add |
| `crm-*` | CRM (tabs, no rail) | Orders, inbox, drafts, contacts, analytics, tasks via `CrmAdminShell` |
| `news` | `news` | Articles, categories, analytics, bulk |
| `web3` | `web3` | Dashboard + Settings (settings link if superadmin) |
| `users` | `users` | `?tab=` overview / users / verification / analytics |
| `moderation` | `moderation` | queue / rules / reports / analytics (URL-synced client) |

### Security hub + redirects

```text
/admin/fraud-desk      → /admin/security?tab=fraud
/admin/verification    → /admin/security?tab=verification
```

Tabs SSOT: `features/admin/security/types/security-overview.ts` (`SECURITY_TABS`). Client: `admin-security-center-client.tsx` (controlled Tabs + `router.push`).

### Matcher tab sync

Rail Moderation → `/admin/matcher?tab=moderation`. Client `admin-matcher-client.tsx` reads `tab`; analytics sub-tabs (`performance`, `quality`, …) stay client-local when `tab` is absent.

### CRM pages

All CRM routes wrap with `CrmAdminShell` + `pageContext` (`crm-orders`, `crm-inbox`, `crm-drafts`, `crm-contacts`, `crm-tasks`, `crm-analytics`). The shell sets `showRightRail={false}` and renders horizontal tabs: Orders \| Inbox \| Drafts \| Contacts \| Tasks \| Analytics. Email HTTP APIs stay at `/api/admin/email/*`. Project-order chat topology: [Owner Project Lab](/docs/features/owner-project-lab.md).

There are **no redirects** from legacy `/admin/email-*` URLs. Use `/admin/crm/*`. `ADMIN_EMAIL_*` constants alias to CRM paths for code compatibility.

### Web3 settings

`/admin/web3/settings` must pass `pageContext="web3"` (superadmin-only page) so the Web3 submenu appears instead of dashboard related hubs.

### Extend the main menu

Add an item under the right group in `ADMIN_NAV_GROUPS` with `href`, `pageContext`, `minRole`, and `labelKey`. Add the label to `admin-labels.ts` and `locales/{en,uk,ru}/modules/admin.json`.

### Wire the page shell

Wrap the page (or client) with `AdminWrapper` and the matching `pageContext`. Email routes use `EmailAdminShell`.

### Add rail children when the section has multiple leaves

Extend `getRailSubmenu` / `resolveRailSection`. Prefer real routes or `?tab=` synced in the page client (see Security / Moderation). Pass `pathWithQuery` into `isActive` predicates that inspect query strings.

{`import { filterAdminNavByRole } from '@/features/admin/admin-nav-config'

// Empty for non-admins; Platform group items require superadmin
const groups = filterAdminNavByRole(session?.user?.role)`}

## Related documentation

- [api/admin](/docs/api/admin.md) — Deep-dive: verified `/api/admin/*` routes and access tiers for console work.

- [architecture/security](/docs/architecture/security.md) — Depends-on: RBAC layers and confidential tiers that gate AdminWrapper.

- [features/email-ai-crm](/docs/features/email-ai-crm.md) — Same-workflow: CRM admin UI under `/admin/crm/*` shares the operator desk model.

- [features/admin-wiki](/docs/features/admin-wiki.md) — Next-step: store compounding project knowledge in the Admin Wiki vault beside News.

- [development/whitelabel-navigation](/docs/development/whitelabel-navigation.md) — See-also: clone-level nav customization when forking admin menus.
