Routes & Pages
Defined in src/App.tsx. All protected routes are wrapped by ProtectedRoute + AppLayout (except payment return pages).
Public routes (no auth required)
| Route | Component | Purpose |
|---|---|---|
/login | LoginPage | Login with username/email + password; 2FA OTP; Turnstile |
/forgot-password | ForgotPasswordContactPage | Enter email/phone to receive OTP |
/forgot-password/otp | ForgotPasswordOtpPage | Verify OTP |
/forgot-password/reset | ForgotPasswordResetPage | Set new password |
Protected routes
| Route | Component | Purpose |
|---|---|---|
/ | DashboardPage | Home: balances, stats, buy credits, distribute credits |
/shops | ShopsPage | Shop list, create shop, suspend/unsuspend, distribute credits |
/shops/:shopId | ShopDetailPageRedesign | Shop detail: overview, security, ledgers, game mappings |
/players | PlayersPage | Player list, filter by shop/username/phone/email |
/players/:playerId | AgentPlayerDetailPage | Player detail + transaction history |
/transactions | AgentTransactionsPage | Credits ledger, filter, CSV export |
/online-transactions | OnlineBalanceTransactionsPage | USD wallet ledger, crypto withdrawal, export |
/provider-fees | ProviderFeesPage | View provider fee table (read-only) |
/fraud-indicators | FraudIndicatorsPage | Player fraud flags, analysis, resolve |
/popups/send | SendShopPopupPage | Send in-app popup to shop/player |
/broadcasts/send | SendBroadcastPage | Send broadcast notification |
/settings | SettingsPage | Cost rate, low balance warning, enable 2FA |
/payment/success | AgentPaymentSuccessPage | Successful payment callback |
/payment/cancelled | AgentPaymentCancelledPage | Cancelled payment callback |
/payment/error | AgentPaymentErrorPage | Payment error callback |
Redirect routes
| Route | Redirect | Notes |
|---|---|---|
/purchase | → / | Legacy |
* (catch-all) | → / |
note
ShopDetailPage.tsx (legacy version) still exists in the repo but the route uses ShopDetailPageRedesign.tsx.
Menu visibility conditions
Send popup / Send broadcast
Shown only when can_delegate_popups === true (from dashboard API or user profile).
Logic in AppLayout.tsx similar to Shop Portal.
Shop detail tabs (/shops/:shopId)
| Tab | Content |
|---|---|
| Overview | Shop info, wallets (credit + USD) |
| Security | Rename, password, cost rate, popup permission |
| Credit transactions | Credits ledger + detail modal |
| USD transactions | Online balance ledger |
| Games | Enable/disable game providers for shop |
Components by domain
Layout & Shell
| Component | File | Role |
|---|---|---|
AppLayout | components/layout/AppLayout.tsx | Sidebar, mobile bottom nav, balance cards, nav, notification bell |
AgentPageLayout | components/layout/AgentPageLayout.tsx | Page content frame: title, description, actions |
ProtectedRoute | components/auth/ProtectedRoute.tsx | Auth guard, redirect /login |
PortalEmptyState | components/ui/PortalEmptyState.tsx | Empty state UI |
Auth
| Component | Role |
|---|---|
LoginPage | Login + 2FA OTP + Turnstile |
ForgotPassword*Page | 3-step password reset |
VerifyNowTrigger | Agent email/phone verification modal |
Credits & Finance
| Component | Role |
|---|---|
CreditPurchaseTrigger/Modal | Buy credits (crypto / convert USD) |
DistributeCreditsTrigger | Distribute credits to shop |
WithdrawCreditsFromShopTrigger | Withdraw credits from shop to agent |
AvailableCreditsCallout | Display credit balance |
PortalWithdrawalLimitsPanel | USD withdrawal daily limits |
CurrencyIcon | Crypto icon (BTC, DOGE, LTC, Cash App) |
Shops
| Component | Role |
|---|---|
ShopGovernanceModal | Confirm suspend/unsuspend |
shopStatusBadge | Shop status badge |
Notifications
| Component | Role |
|---|---|
AgentNotificationBell | Bell icon + broadcast dropdown (poll every 2 minutes) |
AgentInAppPopupGate | In-app popup modal gate |
BroadcastMessageBody | Render broadcast/popup content |
Dashboard & Players
| Component | Role |
|---|---|
AgentHierarchyMiniTree | Shop hierarchy tree + stats by date |
AgentPlayerDetailPanel | Player detail panel |
Payment return flow
Backend redirects to Agent Portal after payment:
/payment/success?transaction_id=...&status=...
/payment/cancelled?transaction_id=...
/payment/error?message=...
Query params: transaction_id, status, message.