https://github.com/anoff/mobcards
cardgames made for smartphones
https://github.com/anoff/mobcards
card cards-against-humanity game mobcards socket-io vue webdev websocket
Last synced: 2 months ago
JSON representation
cardgames made for smartphones
- Host: GitHub
- URL: https://github.com/anoff/mobcards
- Owner: anoff
- License: other
- Created: 2018-04-11T18:21:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T00:37:29.000Z (about 5 years ago)
- Last Synced: 2025-01-28T13:43:53.240Z (over 1 year ago)
- Topics: card, cards-against-humanity, game, mobcards, socket-io, vue, webdev, websocket
- Language: JavaScript
- Size: 2.68 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# mobcards 📱🃏
> Play cards with your friends even if you didn't bring any 🚫 🃏 — but everyone got a smartphone right? 📱
## description
A mobile first (maybe only) web application that lets you play cards against humanity with friends without having a deck of cards handy.
Although it works fully remote it is most fun if played in a IRL group.
Matchmaking is done via a serverless backend where clients are connected using a **session token** that gets shared from the host to its friends/players.
## usage
Run node server on port `3000` and webpack dev server on `8080` to develop both with hot reloading and open [localhost:8080](http://localhost:8080)
```sh
# start dev server
npm run dev-server
# start webpack-dev-server in ./web directory
npm run dev-client
```
## game design

> use cases and interactions

> game states
## socket events
All communication between clients and the server happens over websockets and is therefore eventbased. Clients fire an event and the reaction is triggered once the server responds. With high latencies this event driven approach _might_ feel unnatural.
There are two different state machine definitions one from the server viewpoint that describes the progress of a single game and one from a client view that describes the current client (UI) state.


Payloads updates of type `Array` are always in the form of:
```javascript
{ add: [], remove [], status: [] }
```
where `add` is a list of players/votes/cards that were added, `remove` resources that have to be removed from local state and `status` is a complete update of the state that should overwrite local state.
A special `ACK` event is emitted by the server in response to a client message that modifies state, e.g. voting on start, choosing a card.
## License
Cards taken from [crhallbergs collection of decks](https://github.com/crhallberg/json-against-humanity). The originals, his collection as well as all derivatives within this project are licensed under [CC BY-NC-SA 2.0](https://creativecommons.org/licenses/by-nc-sa/2.0/).
Any code in this project is licensed under [MIT](https://opensource.org/licenses/MIT)