https://github.com/fmalcher/nobodysperfect-frontend
https://github.com/fmalcher/nobodysperfect-frontend
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fmalcher/nobodysperfect-frontend
- Owner: fmalcher
- Created: 2020-04-03T23:32:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-07T09:54:53.000Z (about 6 years ago)
- Last Synced: 2024-10-06T06:20:14.008Z (over 1 year ago)
- Language: TypeScript
- Size: 1.72 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nobody is Perfect Frontend Application
Frontend for the board game ["Nobody is perfect"](https://www.ravensburger.de/produkte/spiele/erwachsenenspiele/nobody-is-perfect-27225/index.html) to make it virtually playable via video conference.
Be aware that this is a rather hacky solution that's supposed to "just work" and nothing more.
## Installation and run
* Clone this repo.
* Install and run an instance of the [backend server](https://github.com/fmalcher/nobodysperfect-backend).
* Configure your backend host and port in the environment files in `src/environments`.
```
npm i
ng serve
```
Open your browser: http://localhost:4200
## Deployment
Build and deployment have to be done manually, there is no CI involved at the moment.
To publish to GitHub Pages:
```
npm run deploy
```
It will do a prod build and push to the `ghpages` branch of the repo.
## Architecture
For the sake of simplicity, data transfer between backend and frontend works with polling.
The server persists all state in a static JSON file `data.json`.
The frontend can poll this JSON file to get the current data.
All calls from frontend to backend are HTTP POST calls that change data on the server.
We are aware of the limitations of this approach, however with HTTP caching it should be quite tolerable to use polling.
## Game States
The phases of the game are determined by a state index.
| State | Description | Player | Moderator |
|---|---|---|---|
| `0` | `idle` | | enter question |
| `1` | `giveAnswer` | enter answer | |
| `2` | `waitForResults` | | edit answers |
| `3` | `chooseAnswer` | choose answer | |
| `4` | `resultsFull` | see results anonymized | |
| `5` | `resultsFullWithAuthor` | see results and round score full | |
| `6` | `showFullScore` | see full score | |