Skip to main content

Home & core pages

modules/dashboard/pages/{HomeUI, DashboardUI, tradersUI, tradersdetailsUI, customersUI, CustomerDetailsUI, ordersUI, ordersdetailsUI.tsx, productsUI, settingsUI}

:::tip Status legend Live — real data + real mutations · Partial — mostly live, some dead/mock controls · Mock — UI only, no API call · Legacy — redirect shim or superseded route :::

Home — Partial​

Route: /

Secondary/simplified KPI landing page (distinct from /dashboard) — accounts-in-danger, amount-at-risk, drawdown, and suspicious-activity KPIs. No capability/session guard, unlike /dashboard.

Sub-modules

components/KPIcomponents/* — AccountsInDangerKPI, AmountAtRiskKPI, AmountPaidOutKPI, DetailedAccountMetrics, DrawDownTrackingKPI, ReccomendationKPI, SuspiciousActivities, TotalActiveAccounts, TotalTradersKPI

ControlEffect
Funded/Live toggleLocal state only — not wired to any child component's props. Dead toggle.
Daily/Weekly/Monthly toggleSame — local state, never passed down. Dead toggle.

:::danger Mock DrawDownTrackingKPI on this page is fed hardcoded static mock dates/values, not an API hook. No filters, export, or refresh button exist on this page at all. :::

Dashboard — Live​

Route: /dashboard

Main authenticated KPI overview — 20 parallel React Query hooks feeding 11 Section cards. Capability-gated on dashboard_home_view via SessionCapabilityPageShell specifically to avoid firing dozens of 403s for login-only users.

Sub-modules (11 sections)
  • Financial Metrics — FinanceKPI: Payout MTD, Revenue MTD, Pending Transactions
  • Trading Metrics — TradingKPI: Active Traders, Total Orders, Max Drawdown Avg, New Traders
  • E-commerce Metrics — ECommerceKPI: Weekly/Daily Revenue, New Orders, MRR
  • Risk Metrics — KeyOverallTraderMetricsKPI: Trader Equity, Active Challenges, Pass Rate (30d), Funded Accounts
  • Danger Zone donut + trend — RiskPaiChartKPI (echarts donut, day-range selector) + CurrentAccoutnLineChart (trend line, own day-range selector)
  • Top traders — HighRiskTradersKPI, ProfitableTradersKPI — top-5 tables, row → encrypted-id deep link to Trader Details
  • E-commerce Operations — TodayRevenewKPI — revenue/order-volume trend, own day-range selector
  • Order Status Overview — OrderStatusOverviewKPI — counts by status
  • Worthy Card List — WorthyCardListKPIs — payment-card table with users-count and per-card orders modals
ControlEffect
Refresh (AdminPageRefresh)handleRefreshAll() refetches all 20 hooks in parallel
3 independent day-range pickersDanger-zone donut, danger-zone trend, and revenue/orders trend each re-query independently
Top-trader row "Details"AES-encrypts trader id → localStorage → navigates to Trader Details
Worthy Card List row actionOpens users-count modal (UserListTableModal) and a per-card orders modal (WrothyOrdersListKPI)

Traders — Live​

Route: /dashboard/traders

Lists all traders with summary KPIs and a searchable/paginated table.

Sub-modules
  • TradersCardKPI — 4 stat cards: Total Active Traders, Active Challenges, Funded Accounts, Total Capital Deployed
  • TradersTableKPI — CommonFilterSection + CommonDashboardTable
ControlEffectHook
RefreshRefetches active traders, challenges, funded accounts, capital deployed, tablehandleRefreshAll
Search ("name, email")500ms debounce, resets pageuseGetTraderListTable
Date range pickerFilters KPI cards + table, resets pageuseGetActiveTraders, useGetTraderListTable
Clear search / date / allResets respective filter state—
PaginationServer-paginated tableuseGetTraderListTable
"Details" row buttonAES-encrypts user_id → localStorage["dtl_data"] → full-page nav to Trader Details (not client router)—

Trader Details — Partial​

Routes: /dashboard/trader_details /dashboard/traders/details

Deep-dive profile + performance-analytics page for a single trader, loaded via AES-encrypted id in localStorage (no query-param guard — silently blank if missing).

Sub-modules
  • Trader Profile Summary — CommonContent: name, email (mailto), status, active accounts, total P/L, drawdown
  • TradingAccountsKPI — paginated table of the trader's trading accounts
  • PerformanceAnalyticsMainKPI — composes DetailedStatisticsKPI (9 stat cards), DayliPLChart, EquityChart, TradeHistoryKPI, RuleComplianceKPI
ControlEffectHook
Backrouter.back()—
RefreshRefetches profile, accounts, and (if account selected) performance stats/PnL/equityhandleRefreshAll
Account selectorDrives detail-stats, daily-PnL chart, Trade History, Rule ComplianceuseGetTraderPerformanceAnalyticsAccountDetailStats
Daily P/L chart day-rangeIndependent re-query...DailyPnlChart
Equity chart day-rangeIndependent re-query...DailyEquityChart
Trade History: search/date/clear/paginationFilters trade rows...TradeHistory
Trade History: Export CSVClient-side only — builds a Blob from currently-loaded rows and triggers browser download (not a server export)—
Rule Compliance paginationServer-paginated...RuleCompliance

:::danger Dead code Two full action-button stacks are commented out and never rendered: header (Edit Profile / Send Password Reset / Suspend User Account) and performance panel (Suspend Trading / Manage Payouts / Graduate to Funded / Reset Challenge / Activate Trading). AdminNotesKPI is also commented out. The Username field renders as a dead link (href="#"). :::

Customers — Live​

Route: /dashboard/customers

Lists all customers with summary KPIs and a searchable/paginated table.

Sub-modules
  • CustomersCardKPI — 4 cards: Total Customers, New Customers (30d), Active Traders, Customers w/ Orders (30d)
  • CustomersTableKPI — CommonFilterSection + CommonDashboardTable
ControlEffect
RefreshRefetches all 4 cards + table
Search ("name, email")500ms debounce — note: page-reset-on-search is commented out here, unlike Traders/Orders
Date range picker (joined)Filters table
Clear search / date / allResets filter state
PaginationServer-paginated table
"Details" row buttonEncrypts user_id → localStorage["cst_data"] → full-page nav to Customer Details

:::danger Dead code A bulk-selection "floating action bar" (Activate Selected / Export Selected / Suspend Selected, all wired to alert()) is fully commented out; the table's isCheckboxEnabled is also set false, so no bulk UI renders at all. :::

Customer Details — Mock (read-only)​

Routes: /dashboard/customer_details /dashboard/customers/[customer_id] /dashboard/customers/details

Detail view: profile, contact info, order history, trading-account summary, IP logs. Despite the dynamic-id route validating a numeric customer_id, data is actually read from encrypted localStorage["cst_data"] in all three route variants — the URL param is effectively cosmetic.

Sub-modules
  • CommonContent × 3 — Customer Basic Information, Contact & Account Details, Trading Activity Summary
  • CommonDashboardTableCopy × 3 — Order History, Trading Account Summary, IP Logs — each with independent pagination
ControlEffect
Back / Refreshrouter.back() / refetches details, order history, trading summary, IP logs
3 independent table paginationsOrder History / Trading Account Summary / IP Logs each server-paginated separately
Email fieldmailto: link only

:::danger Mock The entire header action stack (Edit Profile/Save/Close, Activate Account, Send Password Reset, Suspend Account) is commented out — currently no action buttons render on this page besides Back/Refresh. Even if reachable, the handler only does console.log + a fake setTimeout + alert() — no real API call exists. The confirmation modal is mounted but can never be opened. :::

Orders — Live​

Route: /dashboard/orders

Lists all commerce orders with today's-metrics KPIs, rich filtering, and a detailed order table.

Sub-modules
  • TraderMetricsKPI — Orders Today, Pending Confirmation, Sales Today
  • OrderListKPI — CommonDashboardTableCopy with colored chips for payment/order status/type
ControlEffect
RefreshRefetches all KPI cards + table
Search ("Order Id or Email")Debounced
Date range pickerIgnored whenever "Relative Period" filter is set
Filter popoverBroker (multi-select), Relative Period, Payment Gateway, Payment Status, Order Type, Account Type — Apply/Discard
Per-chip clearRemoves a single active filter value
PaginationServer-paginated
"Details" row buttonEncrypts both order_id and product → localStorage → full-page nav to Order Details
Order ID columnCopy-to-clipboard enabled

Order Details — Mock (read-only)​

Route: /dashboard/order_details

Detail view: order summary, customer info, line items, payment info.

Sub-modules
  • CommonContent × 4 — Order Summary, Customer Information, Order Items, Payment Information
  • CommonDashboardTable — Order Items (non-paginated, computed Sub Total/Discount/Total rows)
ControlEffect
Back / Refreshrouter.back() / refetches summary, items, payment info
Customer name linkClient-side nav to /dashboard/customers/{user_id} — uses plaintext user_id, inconsistent with the encrypted-localStorage pattern used everywhere else
Email fieldmailto: link

:::danger Mock Header action stack (Issue Refund, Resend Confirmation Email, Cancel Order) is commented out — not rendered. Handler is console.log + fake setTimeout only, explicitly flagged in-source as dummy scaffolding. :::

Products — Live​

Route: /dashboard/commerce/products

Product-performance analytics — KPI cards, revenue/units pie charts by product, detailed per-product stats table.

Sub-modules
  • ProductCardKPI — Total Units Sold, Total Revenue, Best Product by Revenue, Best Product by Units
  • FinancePieChart × 2 — Revenue by Product / Units Sold by Product, each with own day-range selector
  • DetailedProductStatisticsKPI — Per-product Units/Revenue/Avg Price/Net Revenue table
ControlEffect
RefreshRefetches all 6 underlying queries
Revenue-by-Product day selectorIndependent re-query
Units-Sold-by-Product day selectorIndependent re-query

:::warning Dead code A shared selectedDay state exists for the top KPI cards + detail table but has no UI control that ever changes it — effectively a fixed 30-day window with no visible selector. A leftover mock-data useEffect (fake products, 1.2s artificial delay) sets state that's never read except its loading flags. :::

Settings — Mock​

Route: /settings

Account settings — personal info, 2FA toggle, change password. Every interactive control on this page is a UI-only mock, confirmed by reading source.

Sub-modules
  • PersonalInfo — Edit/Save toggle, hardcoded default values, no onSubmit handler at all
  • TwoFactorAuthComp — Switch, onSubmit is console.log only
  • ChangePasswordComp — Real form fields, but submit does console.log + alert("...dummy")
  • Not rendered — BillingInfo, AppearenceKPI commented out; notificationspreferencesKPI orphaned/unreferenced entirely

:::danger Mock No API hook is imported anywhere on this page. "Save" on Personal Info just toggles edit mode off with nothing persisted; the 2FA switch and Change Password submit both log to console / alert and stop there. No refresh, export, or navigation actions exist on this page. :::