Giter Club home page Giter Club logo

query-it's Introduction

Query It!

This repository houses the Query It! experience.

##Important You need a valid Google Cloud Platform project to run this experience. Be aware, if you are not using a free trial, you will be charged for running the queries in this experience.

###Screenshots Query It! Intro Screen Query It! Question Screen Query It! Top 10 Answer Screen Query It! Player Points Screen

###Generate Cert Token

  1. Visit Credentials in GCP console
  2. Click Manage Service Accounts
  3. Create a new service account
  4. Create a directory named cert
  5. Download certificate and rename it service_account.json.
  6. Put service_account.json in the /cert directory.

This project uses:

To run this locally you'll need to:

npm install
npm run dev
cd querysrv
node querysrv.js

Vagrant

To use Vagrant to run the stack:

  1. cd deploy
  2. vagrant up
  3. vagrant ssh
  4. cd /vagrant/
  5. npm run dev

You may need to run Salt again to set everything up:

  1. vagrant up
  2. vagrant ssh
  3. sudo salt-call --local state.highstate

##SocketTalk

To start the socket server, run node server.js.

After running this server, you need to start the clients for both Player 1 and Player 2 (see below).

When input is entered either locally or through a Pi, the data that is sent to the server is in JSON format.

{
	"running": "", // String for running answer, wiped down to an empty string when Enter is pressed
	"submitted": boolean, // true if Enter button was pressed, false otherwise
	"client": integer, // Should be either 1 or 2, depending on player identity
}

####Local

The inputs for Query It! are streamed through websockets.

Including an instance of SocketDebugger (currently in app.js), will allow you to enter input for either player. Simply typing will send input to Player 1, where holding shift and typing will send input to Player 2.

This functionality can also be tested with the client.js app by running using the following command in a seperate Terminal window.

node client.js --host=localhost --port=8095 --id=1

Using --id=1 and --id=2 will input the query into either Player 1 or Player 2's field. Using neither will give a pipeline for playing all sounds for the experience.

If you have two extra windows open, you can run a version of both ids and switch between them to closely approximate the game.

Remember that you have to type into the Terminal window, not the browser.

####Raspberry Pi

The Pis are currently configured to be on static IPs of 172.20.2.150 for Player 1 and 172.20.2.151 for Player 2. In order to update the computer that they automatically connect to on boot, you'll need to ssh in and change their boot address.

For example, if the computer running the experience has an address of 172.20.6.144, follow these steps for the Player 1 Pi.

  1. ssh [email protected] (use Pi default password)
  2. sudo nano /home/pi/www/client.shl
  3. Edit line 3 to read /usr/bin/node /home/pi/www/client.js --host=172.20.6.144 --port=8095 --id=1
  4. sudo reboot

Follow these steps for Player 2 Pi, only use ssh [email protected] and --id=2.

query-it's People

Contributors

kanocarra avatar

Watchers

 avatar

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.