Skip to content

Feat/admin module plugin system#319

Merged
Lakes41 merged 3 commits into
Adamantine-guild:mainfrom
Truphile:feat/admin-module-plugin-system
Jul 24, 2026
Merged

Feat/admin module plugin system#319
Lakes41 merged 3 commits into
Adamantine-guild:mainfrom
Truphile:feat/admin-module-plugin-system

Conversation

@Truphile

Copy link
Copy Markdown
Contributor

Summary of Changes

  1. Plugin Interface & Registry (lib/admin-modules/):
    types.ts: Defined AdminModule, AdminModuleContext, AdminNavItem,
    and AdminRole interfaces supporting dynamic route builders, feature
    flags, required roles, display ordering, and React components.
    registry.ts: Created AdminModuleRegistry singleton offering
    register(), unregister(), getNavItems(), getEnabledModules(), and
    role/feature-flag evaluation helper methods.
    index.ts: Migrated all standard first-party modules (overview,
    members, policies, analytics, rewards, settings, governance) into
    lib/admin-modules/modules/ and auto-registered them.
    README.md: Provided comprehensive documentation for community
    deployments and downstream forks to register custom admin plugins.
  2. Dynamic Navigation Integration (components/nav.tsx):
    • Updated primary navigation bar to render admin links dynamically via
    getNavAdminModules(...) evaluating user roles and feature flag rollouts
    instead of hardcoding entries.
  3. Gating & Security (components/admin-module-gate.tsx):
    • Implemented AdminModuleGate component for evaluating feature
    availability and role requirements dynamically per module.
  4. Testing (test/admin-modules.test.ts):
    • Added unit test suite verifying registration, role/feature filtering,
    nav resolution with community URL prefixes, custom module additions,
    and module unregistration. All 472 unit tests pass.

The test suite execution has completed successfully, confirming that all
472 tests pass without any regressions.

Summary of Completed Work

  1. AdminModule Interface & Registry (lib/admin-modules/):
    • types.ts: Defines AdminModule, AdminModuleContext, AdminNavItem, and
    AdminRole.
    • registry.ts: Provides AdminModuleRegistry with methods to
    register/unregister modules, filter active modules by role and feature
    flags, and resolve navigation links.
    • index.ts & modules/: Refactored all existing admin modules (overview,
    members, policies, analytics, rewards, settings, governance) into
    isolated plugin definitions and auto-registered them.
    • README.md: Created detailed documentation explaining how third-party
    plugins or community forks can register custom modules cleanly without
    modifying core app files.
  2. Core Navigation Integration (components/nav.tsx):
    • Replaced hardcoded navigation links with getNavAdminModules(),
    ensuring dynamic link generation and access checking across community
    URL prefixes.
  3. Gating Component (components/admin-module-gate.tsx):
    • Implemented a unified access control component that checks module
    feature flags and role permissions dynamically.

closes #266

@Lakes41
Lakes41 merged commit aaefd62 into Adamantine-guild:main Jul 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design a plugin architecture for admin dashboard modules

2 participants