How developervelnix-lab/winco_frontend works
Purpose and Runtime
This is a Vite-built React single-page client for an online casino/betting experience. It provides public game discovery, authentication, game launch UI, wallet-related journeys, account management, betting statements, promotions, and responsible-gambling/legal content. The README contains no operational documentation.
Core browser entry points are index.html, src/main.jsx, and src/App.jsx. Build/runtime configuration is in vite.config.js; a generated service-worker distribution exists under dev-dist/.
Application Shell and Navigation
src/App.jsx is the likely composition and route boundary for the SPA, with global styles in src/App.css and src/index.css. Navigation and persistent account controls are assembled from:
• src/components/navbar/Navbar.jsx
• src/components/navbar/BelowNavbarComponent.jsx
• src/components/navbar/MobileFooterNav.jsx
Desktop/mobile navigation directs users between lobby, account, transaction, promotion, and policy flows. Page implementations are primarily grouped under src/components/pages/, while duplicate top-level pages/ files appear to be an alternate or legacy page location.
Global State, Theme, and Access Control
Application-wide state is separated into focused React contexts:
• src/context/SiteContext.jsx
• src/context/GameContext.jsx
• src/context/ThemeContext.jsx
GameContext is the likely handoff layer between game selection and launch/display components. Theme state and token synchronization are centralized in src/constants/ThemeSynchronizer.jsx and src/constants/theme.js, with consumers supported by src/hooks/useColors.js.
Authentication screens and route gating are contained in:
• src/components/auth/Login.jsx
• src/components/auth/Register.jsx
• src/components/auth/ProtectedRoute.jsx
This establishes a public-versus-authenticated boundary around account and monetary features.
Casino Lobby and Game Discovery
The home/lobby is componentized into content rails and verticals rather than a single monolith:
• src/components/home/Home.jsx
• src/components/home/CasinoLobby.jsx
• src/components/home/GameSection.jsx
Game catalog content appears locally data-driven through modules in src/components/jsondata/, including slotgames.js, live.js, sport.js, turbogames.js, and gameproviders.js. UI stages filter/select providers and games, render category sections, and pass selected games to launch/play surfaces such as src/components/common/GameLaunchModal.jsx and src/components/GamePlayComponent.jsx.
Account, Wallet, and Betting Operations
Authenticated customer journeys are represented as page-level screens:
• src/components/pages/DepositPage.jsx
• src/components/pages/WithdrawPage.jsx
• src/components/pages/Transaction.jsx
Account administration is centered on src/components/pages/AccountSetting.jsx and src/components/pages/ChangePasswordPage.jsx. Betting/history functionality is split between src/components/pages/OpenBetPage.jsx, src/components/pages/ProfitLossPage.jsx, and statement components in src/components/sidebar-components/statements/. These flows are UI boundaries for financial transactions and betting records; backend contracts are not present in the tree.
API, PWA, and Deployment Boundary
src/utils/apiFetch.js is the central visible API-access abstraction and should be the primary boundary for adding auth headers, error normalization, or backend integration. No server implementation is included; read_address.php is the only PHP artifact and is outside the React source structure.
PWA installation behavior is exposed through src/hooks/usePWAInstall.js and src/components/home/AppInstallHero.jsx. Service worker artifacts are checked in at dev-dist/registerSW.js, dev-dist/sw.js, and dev-dist/workbox-5a5d9309.js. Static deployment assets and Apache configuration live in public/, including public/.htaccess.
Main entry points: App.jsx App routes · Navbar.jsx Responsive navigation · ProtectedRoute.jsx Auth and route guard · CasinoLobby.jsx Casino lobby
Components 18
SPA shell
- Browser entry
src/main.jsx - App routes · Composes the SPA and route boundary.
src/App.jsx - Responsive navigation · Desktop, secondary, and mobile navigation controls.
src/components/navbar/Navbar.jsx
Shared state
- Site context
src/context/SiteContext.jsx - Game context · Carries selected-game state to play surfaces.
src/context/GameContext.jsx - Theme synchronization · Synchronizes theme state and tokens.
src/constants/ThemeSynchronizer.jsx
Customer journeys
- Auth and route guard · Login, registration, and protected-route boundary.
src/components/auth/ProtectedRoute.jsx - Casino lobby · Renders lobby rails and game categories.
src/components/home/CasinoLobby.jsx - Local game catalog · Local slots, live, sport, turbo, and provider data.
src/components/jsondata/slotgames.js - Game launch · Launch modal and game play surface.
src/components/common/GameLaunchModal.jsx - Wallet journeys · Deposit, withdrawal, and transaction screens.
src/components/pages/DepositPage.jsx - Account management · Settings and password-management screens.
src/components/pages/AccountSetting.jsx - Betting records · Open bets, profit/loss, and statements.
src/components/pages/OpenBetPage.jsx - Promotions and policies · Promotional, responsible-gambling, and legal content.
Platform boundary
- API access · Central client boundary for backend integration.
src/utils/apiFetch.js - PWA installation · Install prompt and lobby hero.
src/hooks/usePWAInstall.js - Service worker · Checked-in generated offline worker distribution.
dev-dist/sw.js - Static deployment · Public assets and Apache deployment rules.
public/.htaccess
Connections 21
- Browser entry → App routes: mounts
- App routes → Responsive navigation: renders
- App routes → Site context: uses
- App routes → Game context: uses
- App routes → Theme synchronization: initializes
- App routes → Auth and route guard: gates routes
- Responsive navigation → Casino lobby: navigates
- Responsive navigation → Wallet journeys: navigates
- Responsive navigation → Account management: navigates
- Responsive navigation → Betting records: navigates
- Casino lobby → Local game catalog: reads
- Casino lobby → Game context: selects game
- Game context → Game launch: provides selection
- Auth and route guard → Wallet journeys: protects
- Auth and route guard → Account management: protects
- Auth and route guard → Betting records: protects
- Wallet journeys → API access: requests
- Account management → API access: requests
- Betting records → API access: requests
- PWA installation → Service worker: registers
- Static deployment → Browser entry: serves