How ilhamliorahmat/yuk-main works
Yuk Main is a mobile-first Indonesian multiplayer party-game hub. Players enter through the hub, authenticate or join a room, then play a selected game through a room view; room actions pass through the platform service to the PHP API, which dispatches authoritative game logic and persists room state. Shared session features cover switching, public stage view, co-seating, invites, and recaps; PWA support is a separate capability. Edge evidence is limited to the README and supplied excerpts/SOURCE INDEX references, so undocumented connections are omitted.
Main entry points: YukMainAppContent.tsx App entry · YukMainHub.tsx Game hub · ActiveRoomContainer.tsx Room router · games Game room views
Components 22
Hub & identity
- App entry
components/hub/YukMainAppContent.tsx - Game hub
components/hub/YukMainHub.tsx - Authentication
hooks/use-auth.tsx
Rooms & games
- Game registry
lib/games/registry.ts - Room router
components/games/ActiveRoomContainer.tsx - Game room views
components/games - Game rules
lib/games - Game state types
lib/games/types.ts
Session features
- Session scoring
lib/games/session/engine.ts - Session controls
components/games/session - Public stage
components/games/session/LayarPanggungView.tsx
Platform backend
- Room sync hook
hooks/use-room-session.ts - Room service
lib/platform/room-service.ts - API client
lib/platform/api-client.ts - PHP API routes
public/api/index.php - Action dispatcher
public/api/lib/dispatcher.php - Authoritative game rules
public/api/lib - Room persistence
public/api/lib/rooms.php
Offline runtime
- PWA support
public/sw.js - Offline notice
components/pwa/OfflineNoticeBanner.tsx
Other components
- Player
- MySQL
Connections 21
- Player → App entry: opens
- App entry → Game hub: renders
components/hub/YukMainAppContent.tsx - App entry → Authentication: uses
components/hub/YukMainAppContent.tsx - Game hub → Game registry: lists games
- Game hub → Room router: starts room
- Room router → Game room views: routes by type
- Game room views → Game rules: uses rules
- Game rules → Game state types: uses types
lib/games/bos-kaki-lima/engine.ts - Room router → Room sync hook: subscribes
- Room sync hook → API client: fetches snapshots
hooks/use-room-session.ts - Room service → API client: sends actions
lib/platform/room-service.ts - Room service → Game rules: sanitizes settings
lib/platform/room-service.ts - API client → PHP API routes: HTTP requests
lib/platform/api-client.ts - PHP API routes → Action dispatcher: routes actions
public/api/index.php - Action dispatcher → Authoritative game rules: dispatches rules
- Action dispatcher → Room persistence: updates rooms
- Room persistence → MySQL: reads and writes
- Session controls → Session scoring: records recaps
- Game room views → Session controls: offers controls
- Public stage → Room service: reads public room
- PWA support → Offline notice: supports offline notice