Skip to main content

Routes & Pages

Định nghĩa trong src/App.tsx. Tất cả route protected được bọc bởi ProtectedRoute + AppLayout (trừ payment return pages).


Public routes (không cần auth)

RouteComponentMục đích
/loginLoginPageĐăng nhập username/email + password; OTP 2FA; Turnstile
/forgot-passwordForgotPasswordContactPageNhập email/phone để nhận OTP
/forgot-password/otpForgotPasswordOtpPageXác minh OTP
/forgot-password/resetForgotPasswordResetPageĐặt mật khẩu mới

Protected routes

RouteComponentMục đích
/DashboardPageTrang chủ: số dư, thống kê, mua credit, phân phối credit
/shopsShopsPageDanh sách shop, tạo shop, suspend/unsuspend, phân phối credit
/shops/:shopIdShopDetailPageRedesignChi tiết shop: overview, security, ledgers, game mappings
/playersPlayersPageDanh sách players, filter theo shop/username/phone/email
/players/:playerIdAgentPlayerDetailPageChi tiết player + lịch sử giao dịch
/transactionsAgentTransactionsPageSổ credits (ledger), filter, export CSV
/online-transactionsOnlineBalanceTransactionsPageSổ USD wallet, rút crypto, export
/provider-feesProviderFeesPageXem bảng phí provider (read-only)
/fraud-indicatorsFraudIndicatorsPageCờ gian lận player, phân tích, resolve
/popups/sendSendShopPopupPageGửi in-app popup tới shop/player
/broadcasts/sendSendBroadcastPageGửi broadcast notification
/settingsSettingsPageCost rate, cảnh báo số dư thấp, bật 2FA
/payment/successAgentPaymentSuccessPageCallback thanh toán thành công
/payment/cancelledAgentPaymentCancelledPageCallback hủy thanh toán
/payment/errorAgentPaymentErrorPageCallback lỗi thanh toán

Redirect routes

RouteRedirectGhi chú
/purchase/Legacy
* (catch-all)/
note

ShopDetailPage.tsx (bản cũ) vẫn tồn tại trong repo nhưng route dùng ShopDetailPageRedesign.tsx.


Điều kiện hiển thị menu

Send popup / Send broadcast

Chỉ hiển thị khi can_delegate_popups === true (từ dashboard API hoặc user profile).

Logic trong AppLayout.tsx tương tự Shop Portal.


Shop detail tabs (/shops/:shopId)

TabNội dung
OverviewThông tin shop, wallets (credit + USD)
SecurityĐổi tên, password, cost rate, popup permission
Credit transactionsLedger credits + modal chi tiết
USD transactionsOnline balance ledger
GamesBật/tắt game providers cho shop

Components theo domain

Layout & Shell

ComponentFileVai trò
AppLayoutcomponents/layout/AppLayout.tsxSidebar, bottom nav mobile, balance cards, nav, notification bell
AgentPageLayoutcomponents/layout/AgentPageLayout.tsxFrame nội dung page: title, description, actions
ProtectedRoutecomponents/auth/ProtectedRoute.tsxGuard auth, redirect /login
PortalEmptyStatecomponents/ui/PortalEmptyState.tsxEmpty state UI

Auth

ComponentVai trò
LoginPageLogin + OTP 2FA + Turnstile
ForgotPassword*Page3-step password reset
VerifyNowTriggerModal xác minh email/phone agent

Credits & Finance

ComponentVai trò
CreditPurchaseTrigger/ModalMua credit (crypto / convert USD)
DistributeCreditsTriggerPhân phối credit xuống shop
WithdrawCreditsFromShopTriggerRút credit từ shop về agent
AvailableCreditsCalloutHiển thị số dư credit
PortalWithdrawalLimitsPanelGiới hạn rút USD/ngày
CurrencyIconIcon crypto (BTC, DOGE, LTC, Cash App)

Shops

ComponentVai trò
ShopGovernanceModalConfirm suspend/unsuspend
shopStatusBadgeBadge trạng thái shop

Notifications

ComponentVai trò
AgentNotificationBellBell icon + dropdown broadcasts (poll 2 phút)
AgentInAppPopupGateGate hiển thị in-app popup modal
BroadcastMessageBodyRender nội dung broadcast/popup

Dashboard & Players

ComponentVai trò
AgentHierarchyMiniTreeCây hierarchy shop + stats theo ngày
AgentPlayerDetailPanelPanel chi tiết player

Payment return flow

Backend redirect về Agent Portal sau thanh toán:

/payment/success?transaction_id=...&status=...
/payment/cancelled?transaction_id=...
/payment/error?message=...

Query params: transaction_id, status, message.