Skip to content

MUGABA/Send-IT-Api-v1

 
 

Repository files navigation

Send-IT

Send-IT is a courier service Application that helps users deliver parcels to different destinations. Send-IT provides courier quotes based on weight categories.

forthebadge made-with-python GitHub license Build Status Coverage Status

The required API Endpoints that enable one:

  1. Create a parcel delivery order
  2. Get all parcel delivery orders
  3. Get a specific parcel delivery order
  4. Cancel a parcel delivery order
  5. Get all parcel delivery orders by a specific user

The list of the functioning API Endpoints

Method EndPoint Functionality
POST api/v1/user/registter Creates a user
POST api/v1/parcels Create a parcel delivery order
GET /api/v1/parcel Gets all parcel delivery orders
GET /api/v1/parcel/ Get a specific parcel delivery order
PUT /api/v1/parcels//cancel Cancel the specific parcel delivery order
GET /api/v1/users//parcels Fetch all parcel delivery orders by a specific user

Installation

Make sure you have Python3 installed on your machine

  • Start by creating a directory on your machine and Switch to the directory you created
$ mkdir Send-IT-Api-v1
$ cd Send-IT-Api-v1
  • Install git in your directory
$ git init
  • Clone this repo Switch to it
$ git clone https://github.com/munniomer/Send-IT-Api-v1.git 
$ cd Send-IT-Api-v1
  • Install a virtual Environment and activate it
$ python -m venv venv 	
$ source venv/bin/activate
  • Install the dependencies using the requirements file
$ pip install -r requirements.txt
  • Run the app
$ export FLASK_ENV=development
$ export FLASK_APP=run.py
$ flask run

Testing the endpoints

  • Install postman to test the endpoints

  • Open postman and navigate to the localhost and add the enpoint route you are testing

http://localhost:5000/api/v1/<endpoint>

Running tests

To Run the tests you have to use the terminal, switch to the project folder and activate the venv.

  • To check if all tests pass
$ pytest 
  • To check the test Coverage
$ pytest --cov app  

Technologies used

  • Python 3.6
  • Flask framework
  • Unittest for testing

Author: Munira Omar

Copyright © Andela 2018

About

This repository contains the API endpoints of the V1 of the Send-IT App which is build using flask-restful and stores data on data structures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%