Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 1.1 KB

File metadata and controls

18 lines (14 loc) · 1.1 KB

API

An API created in SocketIO to manage the state of players, their creation, in-game logic and so much more!

API Structure

  • admin.ts - Manages players, game status, and getting random players.
  • config.ts - Grabs given information on hosting and exposes types used for frontend.
  • contestant.ts - Handles and outputs state of players (join/leave/disconnect) across the application.
  • context.ts - Manages and handles the initial contexts from the frontend and returns updated values if needed.
  • index.ts - The main initializer of the backend, handles hosting of the website and contains inital game variables & functions.
  • list.ts - Handles and sends back lists of players in a given state (Loser, Winner, Contestant, etc.)
  • play.ts - The determinator for players upon playing Rock-Paper-Scissors, returns player state values.
  • sync.ts - Waits for 2 players to press the "Ready" button upon Frontend emit, and changes specific socket state.

Tech Stack

  • ExpressJS for hosting backend
  • SocketIO for communications between Frontend and Backend