Giter Site home page Giter Site logo

ragor11 / hqhero Goto Github PK

View Code? Open in Web Editor NEW

This project forked from freshollie/hqhero

0.0 0.0 0.0 4.34 MB

A lightweight and responsive web-based frontend for a quiz prediction robot :crystal_ball: :robot:

Home Page: https://hqhero.com

License: Other

Dockerfile 2.18% CSS 13.22% HTML 11.44% TypeScript 69.43% JavaScript 3.73%

hqhero's Introduction

icon

HQhero

Your quiz hero. A lightweight and responsive frontend for a quiz prediction robot. Demo

Builds:

Branch Status
Master Build Status
Develop Build Status

Running

yarn and lerna are used to manage the dependencies of HQhero.

yarn will install all dependencies (including lerna)

Please see 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 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<string,number>, "best": string, "speed": number}} Prediction of choices
POST /hero/answers {"info": {"eleminated": number, "advancing": number, "answer": string, "answers": Dict<string,number>}} 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

demo

Deploying this webapp as a container is the recommended practice.

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 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

hqhero's People

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.