Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freshollie/hqhero
A lightweight and responsive web-based frontend for a quiz prediction robot :crystal_ball: :robot:
https://github.com/freshollie/hqhero
angular frontend prediction trivia
Last synced: about 1 month ago
JSON representation
A lightweight and responsive web-based frontend for a quiz prediction robot :crystal_ball: :robot:
- Host: GitHub
- URL: https://github.com/freshollie/hqhero
- Owner: freshollie
- License: other
- Created: 2018-07-25T18:52:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-01-01T19:53:53.000Z (about 4 years ago)
- Last Synced: 2024-11-11T19:43:11.084Z (3 months ago)
- Topics: angular, frontend, prediction, trivia
- Language: TypeScript
- Homepage: https://hqhero.com
- Size: 4.26 MB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HQhero
Your quiz hero. A lightweight and responsive frontend
for a quiz prediction robot. [Demo](https://hqhero.com/training)## Builds:
Branch | Status
-------|--------
Master | [![Build Status](https://dev.azure.com/hqhero/hqhero/_apis/build/status/freshollie.hqhero?branchName=master)](https://dev.azure.com/hqhero/hqhero/_build/latest?definitionId=1&branchName=master)
Develop | [![Build Status](https://dev.azure.com/hqhero/hqhero/_apis/build/status/freshollie.hqhero?branchName=develop)](https://dev.azure.com/hqhero/hqhero/_build/latest?definitionId=1&branchName=develop)## Running
`yarn` and `lerna` are used to manage the dependencies of HQhero.
`yarn` will install all dependencies (including `lerna`)
Please see [herobrain](https://github.com/freshollie/herobrain) documentation
for further information on connecting herobrain to hqhero### Commands
- `yarn start` to build the client and start the server in development mode
- `yarn watch` is recommeded for development
- `yarn build` to build both the client and server for distribution
- `node packages/hqhero-server/dist/server.js` to run the built server and client## Technicals
HQhero uses Websockets to transmit the information quickly, easily, and efficiently.
It requires a quiz processor to transmit answer predictions and other
information about the game to the service. The processor sends events
to hqhero, where it will then broadcast those events to all connected users.hqhero.com uses [herobrain](https://github.com/freshollie/herobrain) as a processor.
### Input API
Method | URI | Body | Description
--- | --- | --- | ---
POST | /hero/waiting | `{"info": {"prize"?: string, "nextGame"?: string}}` | Waiting for the next game, prize and next game are optional
POST | /hero/starting | `{"info": {}}` | The game is starting
POST | /hero/round | `{"info": {"numRounds": number, "question": {"question": string, "choices": string[]}, "num": number, roundNum: number}}` | Next round has started
POST | /hero/analysis | `{"info": AnalysisObject}` | Analysis of the round. Not used on the frontend, but broadcast.
POST | /hero/prediction | `{"info": {"answers": Dict, "best": string, "speed": number}}` | Prediction of choices
POST | /hero/answers | `{"info": {"eleminated": number, "advancing": number, "answer": string, "answers": Dict}}` | Conclusion of round. `answer` and `answers` are the only implimented data keys. Others are broadcast but not used on the front-end
POST | /hero/ended | `{"info": {}}` | Not implimented, game transisions using `waiting`API response is always `{success: true}` for a successful input
## Deployment
Deploying this webapp as a container is the recommended practice.
[herobrain](https://github.com/freshollie/herobrain) should be pointed
towards your `hqhero` service.HQhero is designed to only have a single service running. It is
designed with a reverse proxy in mind for routing. Multiple HQhero
services can be configured to represent different quiz regions and
then routed to via a reverse proxy.In this example, hqhero is designed for /uk /us and /de.
When deploying, please remove the `gtag` in `main.ts` from your client.
Feel free to add your own.## HQhero.com
hqhero.com is the current host of HQhero. We currently receive 600+ users a day, with a viewership in 80+ countries.
We opensourced HQhero in the hope that it is useful for others to read or take inspiration from
## Contributing
Contributing is welcomed, but not needed. HQhero is a completed project. [herobrain](https://github.com/freshollie/herobrain) is where contribution
should be aimed at to make the quiz prediction better.However, please submit feel free any pull requests with features or bug fixes.
## License
HQhero is released under the MIT license. Logo is Copyright Eddie Reeder
## Credits
- Oliver Bell - Backend, Architecture, DevOps
- Eddie Reeder - Frontend, Design, Animation, Logo