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 | Portal auth login, supports 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: credits/USD balances, player count, buy credits, quick links |
/players | PlayersPage | Player list, search, pagination, create player |
/players/:playerId | PlayerDetailPage | Player detail: deposit/redeem, ban/unban, history |
/cashiers | CashiersPage | Cashier management: list, create |
/cashiers/:cashierId | CashierDetailPage | Cashier report, shifts, fraud, suspend/terminate |
/fraud-indicators | FraudIndicatorsPage | Fraud metrics (Cashier + Player tabs) |
/transactions | TransactionsPage | Credits ledger, filter, CSV export |
/online-transactions | OnlineBalanceTransactionsPage | USD wallet ledger, crypto withdrawal, export |
/provider-fees | ProviderFeesPage | Provider fee configuration (deposit/withdrawal/transfer) |
/withdrawals | WithdrawalsApprovalPage | Approve/reject player withdrawal requests |
/settings | SettingsPage | Cost rate, low balance warning, enable 2FA |
/kiosk-domain | KioskDomainPage | Manage kiosk subdomain + download poster |
/popups/send | SendPlayerPopupPage | Send in-app popup to player |
/broadcasts/send | SendBroadcastPage | Send broadcast notification |
/payment/success | ShopPaymentSuccessPage | Successful payment callback |
/payment/cancelled | ShopPaymentCancelledPage | Cancelled payment callback |
/payment/error | ShopPaymentErrorPage | Payment error callback |
/transfer/legacy | TransferToPlayerPage | Legacy credit transfer flow (lookup phone + OTP) |
Redirect routes
| Route | Redirect | Notes |
|---|---|---|
/transfer | → /players | Legacy |
/purchase | → / | Legacy |
* (catch-all) | → / |
Menu visibility conditions
Send popup / Send broadcast
Shown only when can_delegate_popups === true (from dashboard API or user profile).
Logic in AppLayout.tsx:
- Fetch dashboard →
setPopupNavAllowed(!!res.data.can_delegate_popups) - Fallback from
user.can_delegate_popups
Pages /popups/send and /broadcasts/send redirect if permission is missing.
Components by domain
Layout & Shell
| Component | File | Role |
|---|---|---|
AppLayout | components/layout/AppLayout.tsx | Desktop sidebar, mobile bottom nav, balance cards, nav, account menu |
ProtectedRoute | components/auth/ProtectedRoute.tsx | Auth guard, redirect /login |
ModalPortal | components/ui/ModalPortal.tsx | Modal portal |
PortalEmptyState | components/ui/PortalEmptyState.tsx | Empty state UI |
Auth
| Component | Role |
|---|---|
LoginPage | Portal login + OTP + Turnstile |
ForgotPassword*Page | 3-step password reset |
VerifyNowTrigger | Shop email/phone verification modal |
Business
| Component | Role |
|---|---|
ShopCreditPurchaseTrigger/Modal | Buy credits (Crypto + Balance tabs) |
PlayerDetailPanel | Player actions: deposit, redeem, ban, history |
ShopPlayerLinkByPhonePanel | Create player form in modal |
ShopDashboardOverview | Shop profile card on dashboard |
ShopNotificationBell | Broadcast bell (poll every 2 minutes) |
ShopInAppPopupGate | App-wide popup gate |
PortalWithdrawalLimitsPanel | USD withdrawal limits |
AvailableCreditsCallout | Display balance during transfer/deposit |
ShopPosterDownloadSection | Download kiosk promo poster (3 templates) |
Poster templates
| Template | Style |
|---|---|
NeonArcade | Neon arcade |
GoldPremium | Gold premium |
DarkNeon | Dark neon |
Rendered via html-to-image → download PNG.
Payment return flow
Backend redirects to Shop Portal after payment:
/payment/success?transaction_id=...&status=...
/payment/cancelled?transaction_id=...
/payment/error?message=...
Query params: transaction_id, status, message.