How lalopapa/mindmatch works
MindMatch is a word-pair memory game with local collections and a two-player online mode. The main workflow configures a game, applies shared game rules, and renders play; collections and preferences are stored locally, while online rooms are managed by a server and synchronized to clients over sockets. The README documents the product routes and local-first storage. Some server and UI relationships are based on the SOURCE INDEX rather than full excerpts; unverified client-to-server wiring is shown as optional.
Main entry points: app.ts HTTP and socket app · RoomService.ts Room and game service · collectionService.ts Collection service · orchestrator.ts Service orchestrator
Components 21
Game experience
- Game setup
app/(main)/page.tsx - Local game page
app/(main)/play/page.tsx - Board and status
app/components/game/Board.tsx - Local game state
app/game/useGame.ts - Collections pages
app/(main)/collections/page.tsx - Collection form
app/components/collection-form/CollectionForm.tsx
Local data
- Collection service
app/services/collectionService.ts - IndexedDB
app/services/database.ts - Settings service
app/services/settingsService.ts
Game rules
- Game engine
packages/engine/src/engine.ts
Online play
- Join room page
app/(main)/join/page.tsx - Online game page
app/(main)/online/[code]/page.tsx - Online game state
app/online/useOnlineGame.ts - Socket client
app/online/socket.ts
Room server
- HTTP and socket app
server/core/app.ts - Service orchestrator
server/core/orchestrator/orchestrator.ts - Room and game service
server/core/rooms/RoomService.ts - Room store
server/core/rooms/RoomStore.ts - Socket broadcaster
server/core/sockets/broadcaster.ts - Room maintenance
server/core/workers/maintenance/roomSweepWorker.ts
Other components
- Player
Connections 26
- Player → Game setup: configures
- Game setup → Local game page: starts game
- Local game page → Local game state: uses state
app/(main)/play/page.tsx - Local game page → Board and status: renders
app/(main)/play/page.tsx - Local game state → Game engine: applies rules
app/game/useGame.ts - Board and status → Game engine: uses game types
app/components/game/Board.tsx - Player → Collections pages: manages words
- Collections pages → Collection service: reads collections
app/(main)/collections/page.tsx - Collection form → Collection service: saves collection
- Collection service → IndexedDB: reads and writes
app/services/collectionService.ts - Collection service → Game engine: parses words
app/services/collectionService.ts - Settings service → IndexedDB: reads and writes
app/services/settingsService.ts - Player → Join room page: joins online
- Join room page → Online game page: opens room
- Online game page → Online game state: uses online state
app/(main)/online/[code]/page.tsx - Online game state → Socket client: sends actions
app/online/useOnlineGame.ts - Socket client → HTTP and socket app: exchanges socket events
- HTTP and socket app → Service orchestrator: creates services
server/core/app.ts - HTTP and socket app → Socket broadcaster: creates broadcaster
server/core/app.ts - HTTP and socket app → Room maintenance: starts worker
server/core/app.ts - Service orchestrator → Room store: creates store
server/core/orchestrator/orchestrator.ts - Service orchestrator → Room and game service: creates service
server/core/orchestrator/orchestrator.ts - Room and game service → Room store: manages rooms
server/core/rooms/RoomService.ts - Room and game service → Socket broadcaster: broadcasts updates
server/core/rooms/RoomService.ts - Room and game service → Game engine: applies game rules
server/core/rooms/RoomService.ts - Room maintenance → Service orchestrator: uses services
server/core/workers/maintenance/roomSweepWorker.ts