How jeanneumannmelo/oitobet works
Oitobet is a browser-based pool game with account, balance, shop, and payment features. The main client workflow initializes the canvas and game, presents sign-in or guest play, accepts shots, and runs local or online matches; authenticated match and balance actions connect to Firebase and server APIs. Online match handling, some UI integrations, and several backend routes are represented from the source index or imports rather than complete excerpts, so uncertain runtime connections are omitted.
Main entry points: main.js Game entry and loop · firebase.js Client Firebase · routes.js Payment routes · input.js Shot input
Components 23
Game client
- Game entry and loop
client/src/main.js - Game state
client/src/state.js - Shot input
client/src/input/input.js - Game physics
client/src/engine/physics.js - Turn rules
client/src/engine/logic.js - Bot opponent
client/src/engine/bot.js - Online client
client/src/net/socket.js - Canvas rendering
client/src/render/table.js
Accounts and economy
- Sign-in UI
client/src/ui/Auth.js - Profile completion
client/src/ui/CompleteProfile.js - Home and lobby
client/src/ui/Home.js - Cue shop
client/src/ui/Shop.js - Client Firebase
client/src/firebase.js - Firebase data
Backend services
- Server entry
server/index.js - Game room
server/GameRoom.js - Shared physics
shared/physics.js - Admin Firebase
server/firebase-admin.js
Payments
- Payment routes
server/payment/routes.js - CartWave client
server/payment/cartwaveClient.js - Medusa client
server/payment/medusaClient.js
Other components
- Player
- Payment provider
Connections 25
- Player → Game entry and loop: starts play
client/src/main.js - Game entry and loop → Game state: uses state
client/src/main.js - Game entry and loop → Shot input: initializes
client/src/main.js - Game entry and loop → Game physics: steps physics
client/src/main.js - Game entry and loop → Turn rules: processes turns
client/src/main.js - Game entry and loop → Bot opponent: runs opponent
client/src/main.js - Game entry and loop → Canvas rendering: draws game
client/src/main.js - Shot input → Turn rules: restarts game
client/src/input/input.js - Shot input → Online client: sends shots
client/src/input/input.js - Game entry and loop → Sign-in UI: opens sign-in
client/src/main.js - Game entry and loop → Profile completion: opens profile
client/src/main.js - Game entry and loop → Home and lobby: shows home
client/src/main.js - Sign-in UI → Client Firebase: authenticates
client/src/ui/Auth.js - Profile completion → Client Firebase: updates profile
client/src/ui/CompleteProfile.js - Home and lobby → Client Firebase: loads account
client/src/ui/Home.js - Home and lobby → Online client: starts online play
client/src/ui/Home.js - Client Firebase → Firebase data: reads and writes
client/src/firebase.js - Cue shop → Client Firebase: uses shop data
- Server entry → Game room: dispatches matches
- Game room → Shared physics: uses physics
server/GameRoom.js - Payment routes → CartWave client: creates charges
server/payment/routes.js - Payment routes → Medusa client: creates PIX
server/payment/routes.js - Payment routes → Admin Firebase: updates accounts
server/payment/routes.js - CartWave client → Payment provider: requests payments
- Medusa client → Payment provider: requests payments