Cory Zeitz

Return Home

Coursework Detail Page

Mancala Multiplayer Game

Mancala Reef

A real-time Mancala platform with Socket.IO gameplay sync, persistent sessions, and split deployment across Vercel + Render.

Mancala project details

Platform Summary

Real-time multiplayer Mancala application focused on low-latency gameplay, persistent user sessions, and consistent game-state synchronization across connected players.

Frontend

Next.js

Realtime

Socket.IO

Database

MongoDB Atlas

System Architecture

The platform is intentionally split between Vercel and Render to keep SSR/auth workflows separate from long-lived websocket workloads.

LayerHostResponsibility
Frontend + APIVercelAuthentication, pages, and session management.
Socket ServerRenderGameplay state sync, lobby lifecycle, and chat messaging.
PersistenceMongoDB Atlas + PrismaUsers, games, messages, and player statistics.

Core Real-Time Events

  • createLobby / joinLobby: creates or enters active rooms.
  • makeMove: validates turn logic, persists state, then broadcasts updates.
  • sendMessage: room-scoped chat synchronized for both players.
  • gameOver: finalizes winner/draw and closes active session state.
  • connection / disconnect: tracks user presence and cleanup.

Data Model + Reliability

  • User: auth, sessions, and lifetime statistics.
  • Game: board state, timestamps, outcome, and replayable history.
  • Chat: persisted lobby messages tied to game context.
  • Application-level trigger updates wins/losses/draws when status transitions to complete.
  • Request validation and typed Prisma flows prevent malformed event payloads.

Testing Coverage

Test suite includes unit and API tests today, with socket integration test expansion in progress for multi-user game path simulation.

Unit

Game logic, state transitions, utility helpers.

API

Auth, game creation, stat-update paths.

Integration

Socket event flow and multiplayer consistency (in progress).