xlambein / rust-against-humanity

A web version of Cards Against Humanity, made in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Against Humanity

A web version of Cards Against Humanity, made in Rust with Yew (frontend) and warp (backend).

How to Run

From the root of the repository, start the backend with:

cargo run -p back

and the frontend with:

npm start --prefix front

You can join a game by opening the http://0.0.0.0:7777 URL. This should also work on your LAN, if the port is open.

Directory Structure

  • /schema/ is the common crate between the front- and backend
  • /back/ is the backend
  • /front/ is the frontend
  • /assets/ contains the data for the "prompt" and "answer" cards

To-Do

  • Load cards from file/database

  • Handle client (dis)connection

  • Client name selection

  • Limit number of players in game

  • Automatic "_" expansion

  • Better judgement screen

  • Improve the design of everything

  • Cycle Czars

  • Shuffle prompts at start

  • If player joins during judgement, they shouldn't be able to play

  • Minimum number of players

  • Sort scores

  • Notifications for events (player (dis)connection)

  • Who's online?

  • Display "You won" instead of "{username} won" :P

  • Log-in with HTTP, and then only connect via websocket

  • Remember scores

  • Serve frontend with the backend

  • End of game

  • Lobby

  • Shuffle jugement cards before displaying

  1. Client opens web app. They select a user name.
  2. They click "join" and are added to the current game.
  3. They play the game.
  4. If they are disconnected:
    • If they're a player, they simply leave the game. Their score is kept.
    • If they're the Czar, the round ends. Players get their cards back. New round starts
  5. If they re-join with the same username, they get their score back.

About

A web version of Cards Against Humanity, made in Rust

License:MIT License


Languages

Language:Rust 94.2%Language:CSS 4.0%Language:JavaScript 1.2%Language:HTML 0.6%