The server for Deeper Blue, an assistive chess-playing robot. Developed for the System Design Project, a 3rd year course offered at the School of Informatics, University of Edinburgh.
Adds in code for the /getgame and /creategame endpoints. In the process of adding these, it also incorporates Firestore access.
Changes
/getgame has been implemented
Two environment variables FIREBASE_SERVICE_ACCOUNT_JSON and GOOGLE_APPLICATION_CREDENTIALS have been added.
FIREBASE_SERVICE_ACCOUNT_JSON is the JSON containing the private key for Firestore and GOOGLE_APPLICATION_CREDENTIALS is the location of the file that we write out with the contents of FIREBASE_SERVICE_ACCOUNT_JSON. The reason we do this is because to authenticate with Firestore we need this JSON to be saved as a file on the server, but Heroku doesn't have a permanent file system, so we need to store the JSON as an environment variable and then write it to a file every time we start the server.
Tests for /creategame are in place
/creategame passes all milestone 2 tests
Adds in libraries firebase-admin and google-cloud-firestore
Game IDs are now strings because we store game objects in Firebase and IDs there are strings.
What needs to happen
[X] /creategame needs to create and save a game object
[ ] ~The server needs some concept of board IDs~ (Coming in milestone 3)
[x] README.md needs updating with the environment variables.
[x] .gitignore needs to have the filename of the temporary JSON we write just in case someone accidentally commits our private key :laughing:
[ ] ~Would be nice to have tests for /getgame~ Nice? We're not nice
Adds in code for the
/getgame
and/creategame
endpoints. In the process of adding these, it also incorporates Firestore access.Changes
/getgame
has been implementedFIREBASE_SERVICE_ACCOUNT_JSON
andGOOGLE_APPLICATION_CREDENTIALS
have been added.FIREBASE_SERVICE_ACCOUNT_JSON
is the JSON containing the private key for Firestore andGOOGLE_APPLICATION_CREDENTIALS
is the location of the file that we write out with the contents ofFIREBASE_SERVICE_ACCOUNT_JSON
. The reason we do this is because to authenticate with Firestore we need this JSON to be saved as a file on the server, but Heroku doesn't have a permanent file system, so we need to store the JSON as an environment variable and then write it to a file every time we start the server./creategame
are in place/creategame
passes all milestone 2 testsfirebase-admin
andgoogle-cloud-firestore
What needs to happen
/creategame
needs to create and save a game objectREADME.md
needs updating with the environment variables..gitignore
needs to have the filename of the temporary JSON we write just in case someone accidentally commits our private key :laughing:/getgame
~ Nice? We're not nice