-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10e3332
commit a209588
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
!coverage.py: This is a private format, don't read it directly!{"lines":{}} | ||
!coverage.py: This is a private format, don't read it directly!{"lines":{"/home/kasule/Desktop/foodAPI/api/app/api/__init__.py":[1,2,3],"/home/kasule/Desktop/foodAPI/api/app/__init__.py":[1,2,3,5,6,7],"/home/kasule/Desktop/foodAPI/api/run.py":[],"/home/kasule/Desktop/foodAPI/api/app/api/views/routes.py":[1,2,3,4,6,7,8,10,13,14,15,16,18,19,20,21,23,24,25,27,28,30,31,33,34,36,37,39,41,42,45,48,49,50,51,54,56,57,58,60,61,62,64,65,66,68,69,72,73,74,76,77,79,80,82,83,86,87,88,90,91,92,95,96,97,100,101,102,103,106,107,108,109],"/home/kasule/Desktop/foodAPI/api/tests/test_base.py":[1,2,3,4,7,9,16,17,18,19,20,21,22,25,26,28,30,32,34,35,36,38,39,40,42,43,44,46,47,48,49,51,52,53,54],"/home/kasule/Desktop/foodAPI/api/app/api/models/orders.py":[64,1,2,67,4,69,70,7,8,9,11,13,14,15,17,19,20,21,24,68,28,29,31,32,34,38,39,42,46,47,48,50,53,54,55,56,57,58,59,60,61],"/home/kasule/Desktop/foodAPI/api/app/api/models/dish.py":[1,3,4,7,8,9,10,11,12,13,15,20,21,22,23,24,28,32,33,35,39,40],"/home/kasule/Desktop/foodAPI/api/tests/__init__.py":[1],"/home/kasule/Desktop/foodAPI/api/tests/test_routes.py":[1,2,4,5,7,12,14,16,17,18,19,21,23,25,26,27,28,29,31,32,34,38,39,40,41,42,44,45,47,53,54,55,56,57,58,61,62,63,64,66,67,68,71,72,73,74,76,77,80,81,82,83,85,86,88,90,91,92,93,95,96,98,100,101,102,103,104,107,108,110,113,114,115,116,118,119,120,121,123,124,125,126,127,128,130,135,136,137,138,139,141,142,143,145,150,151,152,153,155,156,158,163,164,165,166,167,169,170,172,174,175,176,177,179,180,182,186,187,188,189,190,192,193,194,195,197,198,199,201,203,204,205,206,209,210,211,212,214,219,220,221,222,224,225,227,233,234,235,236,237,240,241,242,243,246,247,248,251,252,253,254,257,258,259,261,266,267,268,269,270,273,274,275,276,279,280,281,282,285,286,287,288,291,292,293,295,296,297,298,299,300,302,303,304,305,307,308,309,311,315,316,317,318,319,320,321,322,323,326,327,328,333,334,335,336,337,338,339,340,341,344,345,346,347,348],"/home/kasule/Desktop/foodAPI/api/tests/test_order.py":[1,2,3,5,6,8,9,11,12,13,14,16,18,19,20,21,24,25,27,28],"/home/kasule/Desktop/foodAPI/api/app/config.py":[1,4,5,6,7,9,10,11,13,14,15,16,18,19,20,21,25,26,27]}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
repo_token: GsWA9CD1dpKdXlXdhLv2LEJ0hqtaqXETH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: python | ||
|
||
python: | ||
- "3.6" | ||
|
||
# install dependency | ||
install: | ||
- pip install -r requirements.txt | ||
- pip install pytest | ||
- pip install pytest-cov | ||
|
||
|
||
script: | ||
- pytest -v --cov api --cov-report term-missing | ||
|
||
after_success: | ||
- coveralls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: gunicorn -w 4 app:app | ||
web: gunicorn -w 4 run:app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# fast-food-fast | ||
Fast-Food-Fast is a food delivery service app for a restaurant. | ||
- This repo contains the api for the above application | ||
## Build status | ||
[![Build Status](https://travis-ci.com/Kasulejoseph/fast-food-fast.svg?branch=develop)](https://travis-ci.com/Kasulejoseph/fast-food-fast) | ||
[![Maintainability](https://api.codeclimate.com/v1/badges/3a96327f2825ea0ab3bd/maintainability)](https://codeclimate.com/github/Kasulejoseph/fast-food-fast/maintainability) | ||
[![Coverage Status](https://coveralls.io/repos/github/Kasulejoseph/fast-food-fast/badge.svg?branch=develop)](https://coveralls.io/github/Kasulejoseph/fast-food-fast?branch=develop) | ||
## Prerequisites | ||
``` - Python3.6 - A Programming language that is convienient for this app. version3.6 is highly recommended | ||
- Flask - A most powerful Python web framework. Flask==1.0.2 is the recommended version | ||
- 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.git | ||
- $ cd fast-food-fast | ||
``` | ||
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/ | ||
``` | ||
Start the server | ||
``` | ||
- $ cd api | ||
- $ python run.py | ||
``` | ||
## End Points | ||
|Method | End-Point | Functionality| | ||
| ---| --- | ---| | ||
| POST |api/v1/orders| Place an order | | ||
| GET |api/v1/orders/id | Get a specific order by id. | | ||
| PUT |api/v1/orders/id | Updates order status. | | ||
| GET |api/v1/orders/ | Get all orders available. | | ||
| DELETE |api/v1/orders/id | Admin delete a specific order. | | ||
|
||
## Versioning | ||
The url versioning for this API startS, with the letter “v”. As you can see in the endpoints above | ||
``` | ||
For example | ||
POST >> https://127.0.0.1:5000/api/v1/orders/ | ||
PUT >> https://127.0.0.1:5000/api/v1/orders/7 | ||
``` | ||
## Automated Tests | ||
``` | ||
- make sure the server is runing | ||
- install a test client like Postman or restman to your machine | ||
- copy paste the url of the local server to the test client you chose | ||
- for every request method you perform append a necessary end point to its equivalent | ||
to your request method | ||
- comfirm data is returned for every request made | ||
``` | ||
## Units Tests | ||
Install pytest and run | ||
``` | ||
$ pytest -v --cov api --cov-report | ||
``` | ||
## Deployment | ||
The app is hosted on [heroku](https://fast-food-fast-api-kasule.herokuapp.com/api/v1/orders/) | ||
## Author | ||
[Kasule Joseph](https://github.com/Kasulejoseph) | ||
## Acknowlegments | ||
- [Andela](https://andela.com/) | ||
|
||
|
||
|
||
|