Home Doh Ref
Dohballs
  • 📁 doh_chat
  • 📁 doh_modules
    • 📦 dataforge
    • 📦 express
    • 📁 sso
    • 📁 user

Admin Dashboard

A modern administrative dashboard interface for Doh applications that automatically discovers and displays available admin routes.

Features

  • Route Discovery - Automatically detects /admin/* routes (one level deep only)
  • Cascade Icon System - Intelligent icon assignment based on route names with weighted pattern matching
  • Dark Theme - Modern dark UI with responsive design
  • Search & Filter - Real-time search and access-level filtering
  • Statistics Display - Quick overview of route counts by access level
  • Permission-Based Access - Built-in authentication and permission checks

Installation

Add to your boot.pod.yaml:

host_load:
  - admin_dashboard

Usage

Navigate to /admin to access the dashboard. Users must be authenticated and have the access:admin_dashboard permission.

Granting Access

Assign the admin_dashboard_user permission group to users who should access the dashboard:

await Doh.assignPermissionGroup(user, 'admin_dashboard_user');

Routes

Route Method Description
/admin GET Main dashboard page
/api/admin_dashboard/routes GET API endpoint returning available admin routes

Route Filtering

Only routes exactly one level deep after /admin/ are displayed:

  • /admin/users - Included
  • /admin/settings - Included
  • /admin/users/profile/:id - Excluded (too deep)

Icon System

Icons are assigned using a cascade system with weighted patterns:

Priority Weight Example
Exact match 100 /admin/users -> fas fa-users
Word-based 80 Contains "user" -> fas fa-user
Category 60 Contains "manage" -> fas fa-tools
Fallback 1 Default -> fas fa-cog

Permissions

The module defines:

  • Permission: access:admin_dashboard
  • Permission Group: admin_dashboard_user (assignable)
  • Context: admin_dashboard - validates path is /admin

Dependencies

  • express_router - Route handling
  • user_host - Authentication middleware

CSS Customization

The dashboard uses CSS custom properties for theming. Override in your own stylesheet:

:root {
  --ad-bg-color: #1e1e1e;
  --ad-text-color: #e0e0e0;
  --ad-accent-color: #4d8bbd;
  /* See admin_dashboard.css for full list */
}

Public API (Browser)

The UI module exposes methods for programmatic control:

// Refresh the dashboard
admin_dashboard_ui.refresh();

// Set filter programmatically ('all', 'admin', 'auth')
admin_dashboard_ui.setFilter('admin');

// Set search term
admin_dashboard_ui.setSearch('users');
Last updated: 2/17/2026