/Fastchop

Fastchop is a food delivery service app for a restaurant.

Primary LanguageJavaScript

Fastchop

Maintainability Test Coverage Coverage Status Build Status

Fastchop is a food delivery service app for a restaurant.

Template

Template hosted at https://emmygozi.github.io/Fastchop/UI/

API hosted on

API Hosted on https://fastchop.herokuapp.com/api/v1/

Table of Contents

Pivotal Tracker Stories

Find relevant Pivotal Tracker stories at [https://www.pivotaltracker.com/projects/2196733)

Getting Started

Installation

  • git clone Fastchop
  • Run npm install or yarn install to install packages
  • Run npm run createtables or yarn createtables to setup local database
  • Run npm run start or yarn start to start the server
  • Navigate to localhost:8000 in browser to access the application

Testing

Prerequisites

Testing with Postman

Testing with Coverage Data

  • After installing as shown

  • Run npm test or yarn test

  • It will run test and display coverage data as generated by Istanbul's nyc

Development

You can run npm run start:dev or yarn start:dev in development to use Nodemon

Nodemon watches for file changes and restarts your code.

Features

Admin

  • Sign Up
  • Sign In
  • Create fast-food items
  • Modify fast-food items
  • Delete fast-food items
  • Accept orders
  • Reject orders

Users

  • Sign Up
  • Sign In
  • Make orders
  • View order history

API Endpoints

HTTP VERB ENDPOINT FUNCTIONALITY EXPECTED RESPONSE
POST / /api/v1/auth/signup signup to application request { "name": "your name", "email": "yourmail@something.com", "password": "yourpassword", "address": "your address here", "phone": "1029283746" }
POST / /api/v1/auth/login login to application request { "email": "yourmail@something.com", "password": "yourpassword" }
GET / /api/v1/orders Fetch all orders { "state": "Succesful", "message": "Retrieved all orders", "rows": [ { "id": 11, "dateadded": "2018-09-28T11:22:50.139Z", "name": "Chicken and Chipddddysyyyss", "description": "Chow bellyful", "price": 1500, "quantity": 13 }, { "id": 10, "dateadded": "2018-09-27T11:18:21.470Z", "name": "Chicken and Chipddddysyyyss", "description": "Chow bellyful", "price": 1500, "quantity": 13 }, { "id": 9, "dateadded": "2018-09-26T18:10:45.686Z", "name": "Chicken and Chips", "description": "Chow bellyful", "price": 1500, "quantity": 39 }, { "id": 8, "dateadded": "2018-09-26T18:09:49.076Z", "name": "Chicken and Chips", "description": "Chow bellyful", "price": 1500, "quantity": 39 }, { "id": 7, "dateadded": "2018-09-26T18:08:44.089Z", "name": "Chicken and Chips", "description": "Chow bellyful", "price": 1500, "quantity": 39 } ] }
GET /:id /api/v1/users/:id/orders Fetch a specified order { "state": "Succesful", "message": "Retrieved your order", user: { "id": 7, "dateadded": "2018-09-26T18:08:44.089Z", "name": "Chicken and Chips", "description": "Chow bellyful", "price": 1500, "quantity": 39 } }
GET /:id /api/v1/orders/:id Fetch a specified order "state": "Succesful", "message": "Retrieved an order", "rows": [ { "id": 11, "dateadded": "2018-09-28T11:22:50.139Z", "name": "Chicken and Chipddddysyyyss", "description": "Chow bellyful", "price": 1500, "quantity": 13 },
POST / /api/v1/orders Make an order { "mealid": 6, "quantity": 3, }
PUT /:id /api/v1/orders/:id Modify an order { "status": "processing" }
GET / /api/v1/menu Fetch all food item { "message": "Retrieved all food items", "menu": [ { "id": 1, "name": "Extra large pizza", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1500, "imageurl": "http://imagesavedhere1" }, { "id": 2, "name": "Burger and soda", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1500, "imageurl": "http://imagesavedhere2" }, { "id": 3, "name": "Fried Chicken", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1000, "imageurl": "http://imagesavedhere3" } ] }
GET /:id /api/v1/menu/:id Fetch a specified food item { "state": "successfull", "message": "Retrieved your menu", "id": 3, "name": "Fried Chicken", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1000, "imageurl": "http://imagesavedhere3" }
POST / /api/v1/menu Make an food item { "state": "successfull", "message": "Retrieved all food items", "id": 7, "name": "Fried Chicken", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1000, "imageurl": "http://imagesavedhere3" }
PUT /:id /api/v1/menu/:id Modify an food item { "state": "successfull", "message": "update menu" "id": 3, "name": "Fried Chicken", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1000, "imageurl": "http://imagesavedhere3" }
DELETE /:id /api/v1/menu/:id Delete an food item { "state": "successfull", "message": "deleted menu", "id": 3, "name": "Fried Chicken", "description": "Get your meals on the go in the most efficient manner. Our snacks are very tasty", "price": 1000, "imageurl": "http://imagesavedhere3" }

Technologies

  • NodeJS - Runtime Environment
  • ExpressJs - Web Application Framework
  • Yarn - Dependency Manager
  • Npm - Dependency Manager

Supporting Packages

Linter(s)

Compiler

  • Babel - Compiler for Next Generation JavaScript

Test Tools

  • Mocha - JavaScript Test Framework for API Tests
  • Chai - TDD/BDD Assertion Library for Node
  • Istanbul(nyc) - Code Coverage Generator