Admin Dashboard & Demo Modes
Relevant source files
The following files were used as context for generating this wiki page:
The Admin Dashboard serves as the central management hub for the BankChase platform, providing specialized interfaces for system administration, analytics, and demonstration fund management. It is designed to facilitate developer testing, user onboarding, and system-wide monitoring through a secure, role-restricted environment.
A primary feature of the administrative suite is the Demo Money Transfer system. This module allows administrators to inject virtual funds into user accounts for testing or demonstration purposes, featuring an automated refund mechanism to ensure funds are temporary. This architecture supports both individual and bulk operations, essential for large-scale onboarding or "Demo Day" scenarios.
Sources: SYSTEM_STATUS_REPORT.md:73-82, DEMO_MONEY_GUIDE.md:3-23, COMPLETE_APP_READY.md:65-68
Administrative Architecture
The administration system is divided into specialized modules accessible via the primary admin route. Access is restricted via Role-Based Access Control (RBAC), ensuring that only users with the admin or auditor roles can interact with these endpoints and views.
Core Admin Modules
- Admin Dashboard (
/admin/dashboard): Centralized view for system analytics and statistics. - Security Administration (
/admin/security): Interface for managing platform security configurations. - DNS Configuration (
/admin/dns): Specialized tool for managing domain and network settings. - Demo Money Hub (
/admin/demo-money): A dedicated tool for managing practice funds and virtual transfers. - Audit Logging (
/api/admin/audit-logs): An immutable record of all administrative actions, tracking IP addresses and target resources.
Sources: SYSTEM_STATUS_REPORT.md:73-82, DELIVERY_SUMMARY.md:15-19, COMPLETE_APP_READY.md:46-62
Administrative Roles and Permissions
| Role | Access Level | Responsibilities |
|---|---|---|
| Admin | Full Access | User management, security settings, demo fund initiation, and audit viewing. |
| Auditor | Read-Only | Access to audit logs and compliance data for forensic trails. |
| Customer | No Access | Restricted from all /admin/* routes and /api/admin/* endpoints. |
Sources: DELIVERY_SUMMARY.md:15-20, RBAC_INDEX.md:82-88
Demo Money Transfer System
The Demo Money system is a virtual fund management utility designed for testing and demonstrations. It utilizes a separate database schema to track temporary fund movements and manages an automated expiration logic.
Transfer Logic and Flow
The system distinguishes between internal (registered) users and external accounts. Internal transfers result in immediate credit, while external accounts receive "Pending Demo Credit" that requires an automated background job to finalize or refund.
The diagram shows the logic path between immediate internal credits and the time-delayed refund cycle for external accounts.
Sources: DEMO_MONEY_GUIDE.md:162-192
API Reference: Demo Operations
| Endpoint | Method | Description |
|---|---|---|
/api/admin/demo-transfer | POST | Initiates a single demo transfer to a specific account number. |
/api/admin/demo-transfer/bulk | POST | Distributes a fixed demo amount to all users in the organization. |
/api/admin/demo-transfer/history | GET | Retrieves a filtered list of all virtual fund movements. |
/api/admin/demo-transfer/process-refunds | POST | Background job trigger for processing expired transfers (requires CRON_SECRET). |
Sources: DEMO_MONEY_GUIDE.md:45-103
Implementation Detail: Refund Scheduling
The system relies on a daily cron job to process auto-refunds. This is typically configured via a vercel.json file to trigger the /process-refunds endpoint.
{
"crons": [{
"path": "/api/admin/demo-transfer/process-refunds",
"schedule": "0 2 * * *"
}]
}
Sources: DEMO_MONEY_GUIDE.md:120-127
Data Models and Schemas
Administrative operations involve specific data structures within the PostgreSQL (Supabase) and MongoDB hybrid architecture. While PostgreSQL handles immutable audit trails and user roles, MongoDB is used for real-time analytics and tracking.
Admin Audit Logging (PostgreSQL)
The admin_audit_logs table provides an immutable record for compliance.
| Field | Type | Description |
|---|---|---|
id | UUID | Primary key for the log entry. |
admin_id | UUID | Foreign key referencing the administrator who performed the action. |
action_type | TEXT | Description of the action (e.g., 'transfer_demo', 'update_role'). |
target_resource | TEXT | The resource or user affected by the action. |
ip_address | TEXT | The network address of the administrator during the event. |
Sources: DELIVERY_SUMMARY.md:65-71, DEMO_MONEY_GUIDE.md:31-43
Demo Transfer Tracking
The demo_transfers table manages the lifecycle of virtual funds, including expiry timestamps for automated refunds.
This relationship diagram illustrates how demo transfers link administrators to targeted accounts while tracking fund status.
Sources: DEMO_MONEY_GUIDE.md:31-43
Summary
The Admin Dashboard & Demo Modes provide a robust framework for managing the BankChase application. By integrating Role-Based Access Control with specialized tools like the Demo Money system and immutable audit logs, the platform ensures that administrative actions are both powerful for onboarding/testing and fully transparent for compliance. The automated refund system specifically allows for safe, temporary fund injection, making it a critical tool for development and sales environments.
Sources: DEMO_MONEY_GUIDE.md:213-220, SYSTEM_STATUS_REPORT.md:195-200