Send-IT is a courier service Application that helps users deliver parcels to different destinations. Send-IT provides courier quotes based on weight categories.
- Create a parcel delivery order
- Get all parcel delivery orders
- Get a specific parcel delivery order
- Cancel a parcel delivery order
- Get all parcel delivery orders by a specific user
| 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 |
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-
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>
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 - Python 3.6
- Flask framework
- Unittest for testing
Copyright © Andela 2018