Skip to content

Kasulejoseph/fast-food-fast-db

Repository files navigation

fast-food-fast-db

Database to hold data the api

The app is hosted here on heroku

Build status

Build Status Maintainability Coverage Status

Prerequisites

   - Flask
   - Flask_restful
   - Virtualenv - A tool to create isolated virtual environment
   - Pytest - python web testing frame work

Installation

Clone this repo to your local machine

   - $ https://github.com/Kasulejoseph/fast-food-fast-db.git
   - $ cd fast-food-fast-db

Install virtual environment

  - On linux
   $ virtualenv env -to create virtual environment
   $ source env/bin/activate -- to activate the virtual environment
  - On windows
    https://programwithus.com/learn-to-code/Pip-and-virtualenv-on-Windows/
 - In the virtual environment install the requirement
   $ pip freeze -r requirements.txt

Install all the necessary dependencies by

$ Install PostgreSQL
$ sudo -i -u postgres
$ CREATE DATABASE food_db
$ CREATE TABLE users
$ CREATE TABLE menu
$ CREATE TABLE orders

Start the server

- $ python run.py

Running the tests

To run tests run this command below in your terminal

coverage run --source=. -m unittest discover

API End Points

End Point Resource Accessed Access Requirements
api/v1/auth/signup POST Register a user PUBLIC username, email, password
api/v1/auth/login POST Login a user PUBLIC username, password, role
api/v1/users/orders POST Place an order for food. PUBLIC user_id, menu_id
api/v1/users/orders GET Get the order history for a particular user. PUBLIC user_id
api/v1/orders GET Get all orders ADMIN user_id, menu_id, order_id
api/v1/orders/order_id GET Fetch a specific order ADMIN order_id
api/v1/orders/order_id PUT Update the status of an order ADMIN order_id
api/v1/menu GET Get available menu PUBLIC menu_id
api/v1/menu POST Add a meal option to the menu. ADMIN menu_id

End points as on swagger swagger

User registration and screenshot signup

Login details token generation login

About

PostgreSQL database to back end the fast food fast api

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages