Skip to content

mathieu-pousse/go-dart

 
 

Repository files navigation

go-dart

Build Status codecov

Authors

  • Guillaume GERBAUD
  • Mathieu POUSSE
  • Erwann THEBAULT

Build

First of all, ensure you have checked out the project in ${GOPATH}/github.com/gocaine/go-dart.

Simply run the command make binary

As the build process relies on docker, please first configure it on your local.

If you don't want to use docker, simply run make dev binary rely on your local version of go and npm.

If you want to prepare a binary for ARM, run make arm binary

To deploy on the rpi run make deploy. In order, you must add the rpi host name and its associated ip to your network configuration (DNS or /etc/hosts)

If you want to build the binary without rebuilding the frontend, run make binary-noui. It will ship the previously built version.

Running on a raspberry pi

After you publish the binary on your rpi (default deploy is in the home directory of the pi user), you can run the following commands:

  • ./clean-i2c.sh: this will clean up and reset the GPIO ports direction and status
  • sudo ./go-dart hardware -b <board-id>: this will start the software responsible to listenning the hardware and propagating the dart events to the server
  • ./go-dart server: this starts a game server

API

  • Create a game
    • POST "/api/games"
    • return game ID
  • Get the current game state
    • GET "/api/games/{id}"
    • return a GameState
  • Create player
    • POST "/api/games/{id}/players"
    • return User ID
  • Player state
    • GET "/api/games/{id}/players/{id}"
  • Dart state
    • POST "/api/{id}/dart"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 78.0%
  • JavaScript 14.3%
  • Shell 3.9%
  • Makefile 2.2%
  • Other 1.6%