Skip to main content

Routes & Pages

Defined in src/App.tsx. All protected routes are wrapped by ProtectedRoute + AppLayout (except payment return pages).


Public routes (no auth required)

RouteComponentPurpose
/loginLoginPageLogin with username/email + password; 2FA OTP; Turnstile
/forgot-passwordForgotPasswordContactPageEnter email/phone to receive OTP
/forgot-password/otpForgotPasswordOtpPageVerify OTP
/forgot-password/resetForgotPasswordResetPageSet new password

Protected routes

RouteComponentPurpose
/DashboardPageHome: balances, stats, buy credits, distribute credits
/shopsShopsPageShop list, create shop, suspend/unsuspend, distribute credits
/shops/:shopIdShopDetailPageRedesignShop detail: overview, security, ledgers, game mappings
/playersPlayersPagePlayer list, filter by shop/username/phone/email
/players/:playerIdAgentPlayerDetailPagePlayer detail + transaction history
/transactionsAgentTransactionsPageCredits ledger, filter, CSV export
/online-transactionsOnlineBalanceTransactionsPageUSD wallet ledger, crypto withdrawal, export
/provider-feesProviderFeesPageView provider fee table (read-only)
/fraud-indicatorsFraudIndicatorsPagePlayer fraud flags, analysis, resolve
/popups/sendSendShopPopupPageSend in-app popup to shop/player
/broadcasts/sendSendBroadcastPageSend broadcast notification
/settingsSettingsPageCost rate, low balance warning, enable 2FA
/payment/successAgentPaymentSuccessPageSuccessful payment callback
/payment/cancelledAgentPaymentCancelledPageCancelled payment callback
/payment/errorAgentPaymentErrorPagePayment error callback

Redirect routes

RouteRedirectNotes
/purchase/Legacy
* (catch-all)/
note

ShopDetailPage.tsx (legacy version) still exists in the repo but the route uses ShopDetailPageRedesign.tsx.


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)

TabContent
OverviewShop info, wallets (credit + USD)
SecurityRename, password, cost rate, popup permission
Credit transactionsCredits ledger + detail modal
USD transactionsOnline balance ledger
GamesEnable/disable game providers for shop

Components by domain

Layout & Shell

ComponentFileRole
AppLayoutcomponents/layout/AppLayout.tsxSidebar, mobile bottom nav, balance cards, nav, notification bell
AgentPageLayoutcomponents/layout/AgentPageLayout.tsxPage content frame: title, description, actions
ProtectedRoutecomponents/auth/ProtectedRoute.tsxAuth guard, redirect /login
PortalEmptyStatecomponents/ui/PortalEmptyState.tsxEmpty state UI

Auth

ComponentRole
LoginPageLogin + 2FA OTP + Turnstile
ForgotPassword*Page3-step password reset
VerifyNowTriggerAgent email/phone verification modal

Credits & Finance

ComponentRole
CreditPurchaseTrigger/ModalBuy credits (crypto / convert USD)
DistributeCreditsTriggerDistribute credits to shop
WithdrawCreditsFromShopTriggerWithdraw credits from shop to agent
AvailableCreditsCalloutDisplay credit balance
PortalWithdrawalLimitsPanelUSD withdrawal daily limits
CurrencyIconCrypto icon (BTC, DOGE, LTC, Cash App)

Shops

ComponentRole
ShopGovernanceModalConfirm suspend/unsuspend
shopStatusBadgeShop status badge

Notifications

ComponentRole
AgentNotificationBellBell icon + broadcast dropdown (poll every 2 minutes)
AgentInAppPopupGateIn-app popup modal gate
BroadcastMessageBodyRender broadcast/popup content

Dashboard & Players

ComponentRole
AgentHierarchyMiniTreeShop hierarchy tree + stats by date
AgentPlayerDetailPanelPlayer 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.