Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.
/ appetize Public archive

๐Ÿ” + ๐Ÿ“Š = ๐Ÿ“ˆ School-food feedback app

Notifications You must be signed in to change notification settings

TE4-Umea/appetize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

75 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Appetize, School-food feedback app

Links

Planning board https://github.com/te4umea2019/appetize/projects/1

Admin site and API https://appetize.umea-ntig.se/

Installation and setup

Server installation

Prerequisites

  • NodeJS
  • MySQL
  1. Clone this project git clone https://github.com/te4umea2019/appetize && cd appetize
  2. Configure config.json
  3. Import database mysql -u username < appetize.sql
  4. Install packages cd server && npm i
  5. Start the project node index.js

Generate and insert mock data

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.

  1. Generate cd server && node GenerateMockData.js
  2. Insert mysql -u username -p appetize < MockData.sql

Systems description

API

POST /api/profile

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 /api/profile

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
            }
        ]
    }

POST /api/register

Register an APPETIZE account

REQUEST {
    "code": "ABCD"
}

RESPONSE {
    "success": true,
    "text": "Success!",
    "id": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F"
}

POST /api/login

Login as an admin

REQUEST {
    "username": "admin",
    "password": "admin"
}

RESPONSE {
    "success": true,
    "token": "APPETIZE_9CE5C3ECFF28354878AA51592797E37F",
    "text": "Wrong password"
}

About

๐Ÿ” + ๐Ÿ“Š = ๐Ÿ“ˆ School-food feedback app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •