Git Product home page Git Product logo

cards_against_humanity's Introduction

Unofficial Cards Against Humanity, Online

An unofficial online version of the Cards Against Humanity game. Pairs well with friends, booze and video chat.

Click here to play.

Put together by Kevin Bongart so he could play his beloved game with friends during tough times. Not affiliated with the official Cards Against Humanity company, but you should absolutely buy their game because it's a lot more fun in person. Remixed under Creative Commons BY-NC-SA 2.0 license.

The cards were imported from json-against-humanity.

Development setup

This is a Ruby on Rails application that requires Ruby, PostgreSQL and Redis.

  1. Install Ruby, preferrably with rbenv
  2. Install dependencies:
$ gem install bundler
$ bundle install
$ yarn install
  1. Create, migrate and populate the database:
$ bundle exec rails db:create db:migrate db:seed
  1. Start the web server and the background job processor:
$ bundle exec rails server
$ bundle exec sidekiq

Streaming game updates to clients goes through background jobs, so Sidekiq is required (otherwise, players need to refresh the page manually).

Alternatively, you can use an application process manager to start both the web server and background job processor. Foreman is a good Ruby-based option, but there are many alternatives to suit your needs:

$ gem install foreman
$ foreman start web=1,worker=1
  1. Open a browser to http://localhost:3000

Running the test suite

bundle exec rspec

cards_against_humanity's People

Contributors

davidopluslau avatar dependabot-preview[bot] avatar dependabot[bot] avatar kevinbongart avatar khord avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cards_against_humanity's Issues

Ensure unique game slugs

Game slugs are being generated once when creating a game, but the logic doesn't check that its unique before sending it to the database (which does enforce uniqueness). There is no logic rescuing from a non-unique slug.

A loop should generate a slug, check for uniqueness, attempt to store it and rescue (and retry) if it fails.

Fix "spread your cards" issue, players cannot scroll through or select cards

If a player clicks "spread your cards", they cannot read any card except the top card. They also cannot scroll through the cards or select one to play.

There was an older "spread your cards" variant where each of the player's ten cards was displayed individually and the player could select whichever card they wanted. This worked very well.

Problem with sockets / cable

hey man!
Great stuff, Im actually doing a similar thing to be able to have a beer and a game with friends in a side-by-side webinar grid.
your game would fit perfectly - best cah clone ive found.
but im having a hard time getting the signalling up and running. i have to manually refresh the page to see the updated changes from db ingame.

Read up on puma and actioncable which looks to be the culprit. Websockets isnt giving any errors, and neither is the console, however it is listening on localhost:3000 and :::1:3000 instead of what im used to.

Im running a very basic nginx reverse proxy to puma and ssl via haproxy on ubuntu 18.04.
Ive tried a whole ton of variations of nginx confs, puma binds and ports.

ruby is completely new to me so any pointers are greatly appreciated and i really wouldnt ask so early but.. beer. isolation..

edit
cable gets stuck at 101 during upgrade. any ideas?

Roomcreator

Heya,
pushing forward and i see a need for a moderator-ish role. the room creator for example which should get permission to kick other users and force-end rounds. gonna try and edit the schema to add creatorid and see if i cant migrate or whatever its called in ruby.

integrated kick user function, so to prevent trollmayhem it would be great, but ive no idea how to do a pull request.

How to select a different deck?

I can see full.json has a selection of decks, eg. c-admin, base, base-uk etc.

How do select a different deck, and what is the default deck used?

Warn Card Czar if not all players have submitted answers before 'pick a winner'

Right now, if the Card Czar clicks 'pick a winner', any players who haven't submitted answers yet are prevented from doing so. While this might be on purpose, sometimes it's a mistake and there's no way to re-invite a player to submit an answer after the CC has clicked 'pick a winner'.

A warning notice that 'not all players have submitted answers, are you sure you want to pick a winner?' would probably be enough to 'fix' it...? It just feels like a bug if you're not expecting it.

Build issue on Ubuntu 20.04

The command "yarn install" give the following error, anyone offer any advice?

jp@DESKTOP-L4S9AIU:/app/cards_against_humanity$ yarn install
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'

jp@DESKTOP-L4S9AIU:/app/cards_against_humanity$ sudo yarn install
[sudo] password for jp:
00h00m00s 0/0: : ERROR: [Errno 2] No such file or directory: 'install'

This seems to fix the issue
sudo apt-get -o Dpkg::Options::="--force-overwrite" install yarn

Ubuntu 20.04 create DB errors.

I have installed Postgres on my local ubuntu box via these instructions.
https://help.ubuntu.com/community/PostgreSQL

I am now at this command.. "bundle exec rails db:create db:migrate db:seed"

I get the following error...

jp@DESKTOP-L4S9AIU:/app/cards_against_humanity$ bundle exec rails db:create db:migrate db:seed FATAL: role "jp" does not exist Couldn't create 'cards_against_humanity_development' database. Please check your configuration. rails aborted! PG::ConnectionBad: FATAL: role "jp" does not exist bin/rails:9:in

'
Tasks: TOP => db:create
(See full trace by running task with --trace)`

Any advice?

jp is my local user.

Handle reconnects

Someone who hit back on their browser, and reconnected, was added as a separate player.

If someone was kicked, they shouldn't be able to rejoin though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.