josedario87 a28bc286a1 feat: implement competitive clicker MVP with Colyseus.js
- Add real-time multiplayer game server with Colyseus
- Implement unique player naming system with auto-increment
- Create lobby system with automatic matchmaking
- Build 10-minute competitive clicking game rooms (max 2 players)
- Add admin dashboard for game management (pause/resume/restart/kick)
- Implement Vue 3 client with professional UI
- Add WebSocket communication with state synchronization
- Include TypeScript throughout with proper typing
- Create REST API for admin operations
- Add reconnection support and error handling
2025-08-06 02:32:18 -06:00

Snatch Game - Competitive Clicker

A real-time multiplayer competitive clicker game built with Colyseus.js and Vue 3.

Features

  • 🎮 Real-time multiplayer gameplay
  • 🏆 10-minute competitive clicking battles
  • 👥 2 players per room with automatic matchmaking
  • 🎯 Unique player naming system with auto-increment
  • 🎛️ Admin dashboard for game management
  • 📊 Real-time statistics and monitoring
  • 🔄 Automatic reconnection support
  • ⏸️ Pause/Resume/Restart game controls

Tech Stack

  • Backend: Colyseus.js, Express, TypeScript
  • Frontend: Vue 3, Vite, TypeScript
  • Real-time: WebSockets
  • Styling: Custom CSS

Installation

# Install all dependencies
npm run install:all

Development

# Start both server and client in development mode
npm run dev

This will start:

URLs

Project Structure

snatchgame/
├── server/                 # Backend Colyseus server
│   ├── src/
│   │   ├── rooms/         # Game and Lobby rooms
│   │   ├── schemas/       # State schemas
│   │   ├── utils/         # Utilities (name manager)
│   │   ├── adminApi.ts    # Admin REST API
│   │   └── index.ts       # Server entry point
│   └── package.json
│
├── client/                 # Frontend Vue application
│   ├── src/
│   │   ├── views/         # Vue components (Lobby, Game, Dashboard)
│   │   ├── services/      # Colyseus client service
│   │   ├── router/        # Vue Router
│   │   └── main.ts        # App entry point
│   └── package.json
│
└── shared/                 # Shared types between client and server
    └── types.ts

Game Rules

  1. Players enter the lobby and choose a username
  2. Click "Quick Play" to join or create a game room
  3. Game starts when 2 players join a room
  4. Players have 10 minutes to click as fast as possible
  5. The player with the most clicks wins
  6. Games automatically restart after finishing

Admin Dashboard

The admin dashboard provides:

  • View all active rooms and their status
  • Pause/Resume games in progress
  • Restart games
  • Kick players from rooms
  • View real-time statistics
  • Monitor server performance

API Endpoints

  • GET /api/rooms - List all active rooms
  • GET /api/rooms/:roomId/stats - Get room statistics
  • POST /api/rooms/:roomId/pause - Pause a game
  • POST /api/rooms/:roomId/resume - Resume a game
  • POST /api/rooms/:roomId/restart - Restart a game
  • POST /api/rooms/:roomId/kick/:playerId - Kick a player
  • GET /api/stats - Get global server statistics
Description
No description provided
Readme 6.4 MiB
Languages
Vue 66.8%
TypeScript 26.6%
Mermaid 3.2%
Shell 2.2%
JavaScript 0.6%
Other 0.6%