Skip to content

cheeragpatel/quiz-game

Repository files navigation

Quiz Game ๐ŸŽฎ

A multiplayer quiz game with a retro 70's game show aesthetic, powered by GPT-4. Features dynamic question generation, real-time multiplayer support, and a virtual host (Mona Woolery) that provides witty commentary.

System Architecture

graph TB
    subgraph Frontend
        React[React App]
        Socket[Socket.IO Client]
        Router[React Router]
    end
    
    subgraph Backend
        Express[Express Server]
        SocketIO[Socket.IO Server]
        Redis[Redis]
        GPT4[GPT-4 API]
    end
    
    React --> Socket
    Socket --> SocketIO
    React --> Router
    Express --> SocketIO
    SocketIO --> Redis
    Express --> GPT4
    Express --> Redis
Loading

โœจ Features

  • ๐Ÿค– GPT-4 powered question generation across various topics
  • ๐ŸŽฎ Real-time multiplayer gameplay using Socket.IO
  • ๐ŸŽญ GitHub-based player registration with avatar integration
  • ๐ŸŽ™๏ธ Virtual host (Mona Woolery) providing dynamic commentary
  • ๐Ÿ“Š Live score tracking and leaderboard
  • ๐ŸŽฏ Configurable game settings (number of questions, topics)
  • ๐Ÿ’พ Persistent game state with Redis
  • ๐Ÿ† Round-by-round winner celebrations
  • ๐ŸŽช Multiple game instances support
  • ๐Ÿ”„ Automatic reconnection handling

๐Ÿ› ๏ธ Tech Stack

  • Frontend: React, Socket.IO Client, React Router
  • Backend: Express.js, Socket.IO, Redis
  • AI Integration: OpenAI GPT-4 API
  • Authentication: GitHub API
  • State Management: Redis
  • Build Tools: Node.js, npm
  • Testing: Jest, Testing Library
  • Deployment: Docker, Docker Compose

๐Ÿ“š Documentation

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 16+
  • Redis server
  • OpenAI API key
  • GitHub API access

Installation

  1. Clone the repository:

    git clone https://github.com/cheeragpatel/quiz-game.git
    cd quiz-game
  2. Run the setup script:

    npm run setup
  3. Configure environment:

    # Update .env with your keys
    OPENAI_API_KEY=your_key_here
    GITHUB_CLIENT_ID=your_client_id
    GITHUB_CLIENT_SECRET=your_client_secret
    REDIS_URL=redis://localhost:6379
  4. Start development servers:

    npm run dev

Docker Setup

  1. Build and start containers:

    docker-compose up --build
  2. Access the application:

๐ŸŽฎ Game Roles

Game Master

  • Access at /game-master
  • Configure game settings
  • Control game flow
  • Monitor player progress

Players

  • Register at root URL
  • Join using GitHub handle
  • Answer questions
  • View scores and rankings

Spectators

  • View at /game-show
  • Watch live gameplay
  • See leaderboard
  • Enjoy host commentary

๐ŸŽจ Customization

Game Settings

  • Question count (5-50)
  • Topic selection
  • Time limits
  • Scoring rules

Display Options

  • Theme customization
  • Font preferences
  • Animation settings
  • Layout options

๐Ÿงช Testing

Run the test suite:

# All tests
npm test

# Backend tests
npm run backend:test

# Frontend tests
npm run frontend:test

๐Ÿ“ฆ Production Deployment

See DEPLOYMENT.md for detailed instructions on:

  • Server setup
  • SSL configuration
  • Environment variables
  • Monitoring
  • Backup procedures

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

๐Ÿ“„ License

This project is licensed under the ISC License.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •