How nahuelhds/cards-against-humanity-web works
Project type and purpose
• This is a single-page web application built with Create React App that lets friends play Cards Against Humanity online.
• It combines a React-based UI with Boardgame.io’s client/server game engine to manage multiplayer state and turns.
• Tailwind CSS is used for styling; auxiliary services include local storage (“lobby” service) and Bugsnag for error monitoring.
File structure
• Top-level files:
• expose.js – likely a small Node.js entrypoint to expose the Boardgame.io server or serve the built app
• package.json, .env.example, configuration files for linting/prettier, CI, changelog
• public/ – static HTML, manifest, robots.txt
• src/
• App.js, index.js – React entry points
• assets/decks/… – JSON and text for black/white card decks (ES locale)
• components/ – React UI organized by feature:
— CardsAgainstHumanity/Board (game board views)
— GameAuthContainer, LobbyContainer, GameCreateComponent, etc. (lobby and game flow)
• services/ – wrappers around Bugsnag, localStorage (“storage.js”), and “lobby.js” for room management
• game.js, moves.js, constants.js – Boardgame.io game logic and rules
• styling: Tailwind config, PostCSS, CSS modules
• No separate “backend” folder implies the Boardgame.io server is either embedded in expose.js or runs as a remote service.
README for additional insights
• Confirms use of Boardgame.io, React, Tailwind CSS.
• No explicit multi-service architecture beyond client ↔ Boardgame.io server.
Essential elements
– User → Browser → React App
– React App ↔ Boardgame.io Client ↔ Boardgame.io Server
– Server → Game Logic → Server → Client
– React App → Services (storage, Bugsnag)
– Blue for UI components
– Green for game engine and logic
– Orange for services (storage, Bugsnag, lobby)
– Gray for static assets (decks)