How nickrusso-os/battleship-game- works
Covey.Town is a browser-based virtual meeting space: participants select or create a town, join its shared 2D map, move among other players, and enter proximity conversations or viewing areas, with games as another interactable. The frontend maintains town/player/interactable state over Socket.IO; the service manages town state and broadcasts updates. Video calling is a distinct Twilio-backed capability integrated into the town experience. The map reflects documented capabilities and sampled wiring; unsampled subsystem links are shown only where their ownership is clear from the README or entry-point source.
Main entry points: TownsController.ts Town routes · TownController.ts Town controller · TownMap.tsx Town map · App.tsx App experience
Components 26
Town frontend
- App experience
frontend/src/App.tsx - Town login
frontend/src/components/Login/Login.tsx - Town selection
frontend/src/components/Login/TownSelection.tsx - Town map
frontend/src/components/Town/TownMap.tsx - Map scene
frontend/src/components/Town/TownGameScene.ts - Social sidebar
frontend/src/components/SocialSidebar/SocialSidebar.tsx - Interactable UI
frontend/src/components/Town/interactables/ConversationArea.ts - Battleship UI
frontend/src/components/Town/interactables/BattleShip/BattleShipArea.tsx - Socket.IO client
frontend/src/classes/TownController.ts - Towns REST client
frontend/src/App.tsx
Town service
- Service server
townService/src/Server.ts - Town routes
townService/src/town/TownsController.ts - Town state
townService/src/town/Town.ts - Player state
townService/src/lib/Player.ts - Towns store
townService/src/lib/TownsStore.ts - Game logic
townService/src/town/games/GameAreaFactory.ts - Twilio video client
townService/src/lib/TwilioVideo.ts
Video calling
- Video overlay
frontend/src/components/VideoCall/VideoOverlay/VideoOverlay.tsx - Video provider
frontend/src/components/VideoCall/VideoFrontend/components/VideoProvider/index.tsx - Call controls
frontend/src/components/VideoCall/VideoFrontend/components/Room/Room.tsx
Domain state
- Town controller
frontend/src/classes/TownController.ts - Player controller
frontend/src/classes/PlayerController.ts - Area controllers
frontend/src/classes/interactable/InteractableAreaController.ts - Battleship controller
frontend/src/classes/interactable/BattleShipAreaController.ts
Other components
- Participant
- Twilio Video
Connections 32
- Participant → App experience: opens
- App experience → Town login: shows
- Town login → Town selection: selects town
- Town selection → Towns REST client: lists towns
- Towns REST client → Service server: REST requests
- Service server → Town routes: routes requests
- Town routes → Towns store: reads/writes towns
- Town routes → Town state: joins town
- Town state → Player state: manages players
- Town state → Game logic: manages games
- Service server → Town routes: dispatches sockets
- Town routes → Towns store: finds town
- Town routes → Socket.IO client: initializes client
- Socket.IO client → Town controller: socket events
- Town controller → Socket.IO client: sends commands
- Town controller → Town map: provides town state
- Town map → Map scene: renders map
- Map scene → Player controller: updates movement
- Town map → Social sidebar: shows players
- Town map → Interactable UI: renders areas
- Town controller → Area controllers: creates controllers
- Area controllers → Interactable UI: supplies area state
- Interactable UI → Town controller: issues commands
- Town map → Battleship UI: renders game
- Battleship UI → Battleship controller: reads game state
- Battleship controller → Town controller: sends game moves
- App experience → Video provider: configures provider
- App experience → Video overlay: shows call
- Video overlay → Call controls: renders room UI
- Video provider → Twilio Video: connects media
- Town state → Twilio video client: creates video token
- Twilio video client → Twilio Video: requests token