Go Real-Time Card Game Server

A minimal real-time multiplayer card game backend written in Go using Gin and Gorilla WebSocket. Players join or create a room (auto-generated room ID), receive an initial randomized deck, and interact via simple text commands (/start, /throw <card>, /take). The server manages turn order, supports action cards (reverse, skip), tracks the current card in play, and broadcasts state updates to all connected players. Designed as a concise foundation for extending game logic, persistence, or richer protocols.

Technologies Used

GoWebSocketReal-timeMultiplayerGame Server

Key Features

  • Room auto-generation with short alphanumeric IDs
  • UUID-based player identity
  • WebSocket real-time messaging
  • Command-based gameplay (/start, /throw, /take)
  • Random deck distribution and draw
  • Turn queue management with reverse & skip logic
  • Current card broadcast to all players
  • Simple JSON deck serialization

Technical Stack

Go
Gin (HTTP routing)
Gorilla WebSocket
google/uuid
math/rand
encoding/json