How jworkss/socketio works
Onda en Juego is a real-time multiplayer sound-and-wave drawing game. Players authenticate or enter as guests, join a 3–5-player room, configure and calibrate the microphone, then take turns recording audio while others draw waveforms; the server compares submissions, awards points, and broadcasts results. The diagram separates browser interaction, server-side domain handling, and JSON persistence. README documents the overall Socket.IO flow; some client/server event wiring and portions of game logic were not sampled, so those links rely on that documentation.
Main entry points: main.js Client startup · mic-calibration.js Mic calibration · rooms.js Lobby and rooms · game.js Round and drawing
Components 17
Browser experience
- Game interface
public/index.html - Client startup
public/main.js - Session and views
public/app-state.js - Access and admin
public/auth.js - Lobby and rooms
public/rooms.js - Mic calibration
public/mic-calibration.js - Audio engine
public/audioEngine.js - Round and drawing
public/game.js
Game server
- HTTPS and Socket.IO
server.js - Authentication handlers
server/auth.js - Room management
server/rooms.js - Rounds and scoring
server/game.js
JSON storage
- JSON persistence
server/persistence.js - Users and scores
data/users.json - Audio metadata
data/audioData.json
Other components
- Player
- Browser microphone
Connections 23
- Player → Game interface: uses
README.md - Game interface → Client startup: loads
README.md - Client startup → Access and admin: initializes
public/main.js - Client startup → Lobby and rooms: initializes
public/main.js - Client startup → Mic calibration: initializes
public/main.js - Client startup → Round and drawing: initializes
public/main.js - Access and admin → Session and views: updates
public/auth.js - Lobby and rooms → Session and views: updates
public/rooms.js - Lobby and rooms → Mic calibration: opens
public/rooms.js - Mic calibration → Audio engine: controls
public/mic-calibration.js - Round and drawing → Audio engine: records and plays
public/game.js - Round and drawing → Mic calibration: closes calibration
public/game.js - Access and admin → Authentication handlers: sends auth events
README.md - Lobby and rooms → Room management: sends room events
README.md - Round and drawing → Rounds and scoring: sends game events
README.md - HTTPS and Socket.IO → Authentication handlers: registers
server.js - HTTPS and Socket.IO → Room management: registers
server.js - HTTPS and Socket.IO → Rounds and scoring: creates and registers
server.js - Authentication handlers → JSON persistence: reads and writes users
server/auth.js - Rounds and scoring → JSON persistence: reads and writes data
server/game.js - JSON persistence → Users and scores: reads and writes
server/persistence.js - JSON persistence → Audio metadata: reads and writes
server/persistence.js - Mic calibration → Browser microphone: requests access
README.md