The server for a science project to improve the Laser Quest experience
This project uses Feathers. An open source web framework for building modern real-time applications.
Getting up and running is as easy as 1, 2, 3.
-
Install your dependencies
cd path/to/laser-quest; npm install -
Fill in the placeholder fields in both files in the
configdirectory -
Run
npm run setupand follow the commands to set up your first user account. -
Start your app
npm start
Simply run npm test and all your tests in the test/ directory will be run.
Feathers has a powerful command line interface. Here are a few things it can do:
$ npm install -g feathers-cli # Install Feathers CLI
$ feathers generate service # Generate a new Service
$ feathers generate hook # Generate a new Hook
$ feathers generate model # Generate a new Model
$ feathers help # Show all commands
For more information on all the things you can do with Feathers visit docs.feathersjs.com.
0.1.0
- Initial release
Copyright (c) 2016
Licensed under the MIT license.
As an example, to open a new franchise, you would send a POST request to localhost:3030/locations. All requests MUST be authenticated with a token you can get by sending a POST request to /auth/local with properly filled out email and password fields in the request body. This token can be given as an Authorization header, token field in a request body or token query parameter.
Hires a new employee
name (required): (String) Their name
email (required): (String) Their laserquest.com email address
password (required): (String) Their password in plain text. Ensure this route is encrypted before sending a password. The database will hash it before saving and hide the hash in further responses, so do not expect to get it back.
location (required): (String) The location the employee will work at
Returns a JSON list of all employees
Returns a Location object
Replaces the employee with the data you send
name: (String) Their name email: (String) Their laserquest.com email address password: (String) Their password in plain text. Ensure this route is encrypted before sending a password. The database will hash it before saving and hide the hash in further responses, so do not expect to get it back. location: (String) The location the employee will work at
Updates each field you send with the values you send
name: (String) Their name
email: (String) Their laserquest.com email address
password: (String) Their password in plain text. Ensure this route is encrypted before sending a password. The database will hash it before saving and hide the hash in further responses, so do not expect to get it back.
location: (String) The location the employee will work at
Deletes the employee
Opens up a new Laser Quest franchise
address (required): (String) The street address
Returns a JSON list of all locations
Returns a Location object
Updates the location's address
name (required): (String) The location's name
Deletes the location, along with ANY DATA EVER COLLECTED while it was open. Players, games, tags, etc. are destroyed. Employees will have to change their work location the next time they sign back in
Creates a player
name (required): (String) The player's name
location (required): (String) The id of the Location they are in
games (optional): A list of all game ids the player is in
Returns a JSON list of all players
Returns a Player object
Updates the player's name to the contents of the name field
name (required): (String) The player's name games (optional): A list of all game ids the player is in
Deletes the player with the given id and removes them from any games they played
Send out a tag
sender (required): (String) The id of the player that shot it
game (required): (String) The id of the game it was shot in
time (required): (String) ISO-8601 date string of the time the tag was sent, can be generated with Date.prototype.toJSON()
List all tags/laser beams/shots that have been taken
Returns a Tag object
Updates a tag
receiver: (String) The id of the player who was shot by it
sensor: (String) Either front, back or shoulder. The sensor the laser hit.
Create a new game
location (required): (String) The id of the location the game will take place in
start_time: (String) ISO-8601 date string of the game's start time, can be generated with Date.prototype.toJSON()
end_time: (String) ISO-8601 date string of the game's end time, can be generated with Date.prototype.toJSON()
List all games
Returns the Game object with the corresponding id
Edits the Game object with the corresponding id
players: A list of all players in the game
start_time: (String) ISO-8601 date string of the game's start time, can be generated with Date.prototype.toJSON()
end_time: (String) ISO-8601 date string of the game's end time, can be generated with Date.prototype.toJSON()
Removes all traces of the Game object with the corresponding id. Warning: it also deletes ALL tags sent in the game, disassociates all Players from the game and DELETES any players who are not in any other game