Code Monkey home page Code Monkey logo

appetize's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.