Backend Document - UoaWDCC/Stick-Insect GitHub Wiki
Server
The Express server will have middlewares to handle end points specified in REST API Document.
End point handling
Game
Incoming Method |
Endpoint |
Middleware Handling |
POST |
/game |
Save the game data in MongoDB Database (Game Data Collection) |
Email
Incoming Method |
Endpoint |
Middleware Handling |
POST |
/email |
Save the user email in MongoDB Database (User Email Collection) |
Database
- Our database is a MongoDB database which is NoSQL.
- Our database is hosted in a cloud called MongoDB Atlas.
- Login information can be found in our Slack channel 👍
Database Structure
- Our database has ONE cluster, STINS-Cluster
- Within STINS-Cluster, we have TWO collections, games and emails.
Example Data in games collection
- Please note _id field is auto-generated by MongoDB
_id |
isFirstAttempt |
rounds |
ObjectId("dfas132") |
false |
Array |
ObjectId("uhoub124") |
true |
Array |
ObjectId("ak38sdf") |
false |
Array |
Example Data in emails collection
- Please note _id field is auto-generated by MongoDB