To get started with fast food api you will have clone this repo.
Mac OS/Unix:
$ git clone https://github.com/tesh254/3f.git
Windows:
-
You will have to download git tool in this url https://git-scm.com/download/win
-
Ensure you follow the recommended settings
-
Open git bash and type this command
$ git clone https://github.com/tesh254/3f.git
HTTP VERB | API ROUTE | FUNCTION |
---|---|---|
GET | /api/v1/orders |
Get all orders |
POST | /api/v1/orders |
Place an order |
PUT | /api/v1/orders/<identifier> |
Update an order status |
DELETE | /api/v1/orders/<identifier> |
Delete a specific order |
DELETE | /api/v1/orders |
Delete all orders created |
In post and put http requests respond with json data
HTTP VERB | API ROUTE | FUNCTION | USER ROLE |
---|---|---|---|
POST | /api/v2/auth/signup |
Signup into the site | user |
POST | /api/v2/auth/login |
Login into the site | user/admin |
POST | /api/v2/auth/logout |
Logout of the site | user/admin |
GET | /api/v2/user/orders |
Get orders you have ordered | user |
GET | /api/v2/orders |
Get all orders made by users | admin |
GET | /api/v2/orders/<identifier> |
Get a specific order by id | admin |
PUT | /api/v2/orders/<identifier> |
Update an order status with the id provided | admin |
POST | /api/v2/menu |
Add a meal to the catalog | admin |
GET | /api/v2/menu |
Get the menu | user/admin |
GET | /api/v2/categories |
Get meal categories | user/admin |
POST | /api/v2/categories |
Create a meal category | user/admin |
For everything to work perfectly as shown in the screen shots you need to install a couple of dependencies.
All OS:
-
Install Postman from this url Postman
-
Open your terminal
-
$ cd [to your project directory]
-
-
If installed python type this command on your terminal
$ pip install -r requirements.txt
- Type this coommand after installation
$ python run.py
- Open postman, in the {{url}} variable enter your flask url i.e. localhost:5000/api/v1/orders
Go on testing the apis you can deploy your app to heroku, share the link, test, collaborate.
- v1
- This versions data is stored in memory only if the server closes then all data is deleted.
- v2
- All data in this version is stored in a postgres database
- User authentication.
Name Erick Wachira
Twitter @wachira_dev
Instagram @i.am.wachira
Email ewachira254@gmail.com
This project is under an an MIT LICENSE
so feel free to contribute.
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (git checkout -b feature/something)
- Commit your changes (git commit -am 'Add some something')
- Push to the branch (git push origin feature/something)
- Create a new Pull Request