Planning board https://github.com/te4umea2019/appetize/projects/1
Admin site and API https://appetize.umea-ntig.se/
Prerequisites
- NodeJS
- MySQL
- Clone this project
git clone https://github.com/te4umea2019/appetize && cd appetize
- Configure
config.json
- Import database
mysql -u username < appetize.sql
- Install packages
cd server && npm i
- Start the project
node index.js
NOTE Inserting the mock data can take 1-30 minutes depending on what computer the server is running on. Restrict the amount of days of mock data and students depending on needs.
- Generate
cd server && node GenerateMockData.js
- Insert
mysql -u username -p appetize < MockData.sql
Submit your profile form for today. "vote" is how much you liked the food, from 0 (bad) to 3 (good). "comments" is an array of optional comments added by the user. "id" is the users APPETIZE_ID that is unique to them and can be acquired via POST /api/register.
REQUEST {
"vote": 3,
"comments": ["Kall mat", "Lรฅng kรถ"],
"id": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F"
}
RESPONSE {
"success": true,
"text": "Success!"
}
Get your profile from the server. Basically a login.
REQUEST {
"id": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F"
}
RESPONSE {
"success": true,
"text": "Success!",
"profile": {
"class": "TE17",
"restaurant": "Greek",
"vote": 3,
"comments": ["Kall mat", "Lรฅng kรถ"],
"messages": [
{
"content": "Message content goes here",
"id": 9842384732
}
]
}
Register an APPETIZE account
REQUEST {
"code": "ABCD"
}
RESPONSE {
"success": true,
"text": "Success!",
"id": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F"
}
Login as an admin
REQUEST {
"username": "admin",
"password": "admin"
}
RESPONSE {
"success": true,
"token": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F",
"text": "Wrong password"
}