SendIT is a courier service that helps users deliver parcels to different destinations. SendIT provides courier quotes based on weight categories.
-
Install postgres CREATE A USER - senditdb WITH A PASSWORD - s3ndIt2m3
-
Python 3.6
- Clone the repository
$ git clone https://github.com/patrickf949/SendIT.git
- Set up virutal environment
$ virtualenv venv
-
Activate virtual environment
FOR LINUX
$ source venv/bin/activate
FOR WINDOWS
$ .\venv\Scripts\activate
- Inside the application folder, install all the requirements
$ pip install -r requirements.txt
- Run Application
$ python run.py
Html & Css - w3schools
Our backend is a work-in-progress Application programming interface that emulates the functionality of the application.
- Client can add a parcel delivery order providing details, such a
- parcel description
- recipient
- recipient's contact
- pickup location
- destination
- Client can cancel a delivery order
- Admin can provide further details for a parcel delivery order such as,
- weight, which automatically generates the price of parcel delivery order
- status of parcel, whether pending, in transit, or delivered
- Admin can view all parcel delivery orders of all clients
- Admin can view a specific parcel delivery order
| URL | HTTP Method | Description |
|---|---|---|
/api/v2/auth/signup |
POST |
Sign up user |
/api/v2/auth/login |
POST |
Login user |
/api/v2/parcels |
GET |
Fetch all parcel delivery orders-admin |
/api/v2/users |
GET |
Fetch all users-admin |
/api/v2/parcels/<int:parcelId> |
GET |
Fetch a specific parcel delivery order-admin |
/api/v2/parcels |
POST |
Create a parcel delivery order - client |
/api/v2/parcels/<int:parcel_id>/destination |
PUT |
Update destination of parcel delivery order-client |
/api/v2/parcels/<int:parcel_id>/presentLocation |
PUT |
Update present location of parcel delivery order-client/admin |
/api/v2/users/<int:user_id>/parcels |
GET |
Get parcel delivery orders by user - admin |
Use POSTMAN FOR CONSUMING THE API
Feel free to change the variables to test validation
{
"username":"meltodsfdsdslo8989e",
"email":"anoioisdioi@oorewgmdsail.com",
"password":"andyfofofo2",
"contact":"vtbuyiguoijpk,l"
}
-
As a user You can only login after signup
{ "username":"meltodsfdsdslo8989e", "password":"andyfofofo2" }
NB:
-
Copy the access token on user login
-
TO CONSUME OTHER ENDPOINTS:
- In POSTMAN, go to the Authorisation tab
- Set the authorisation type to Bearer Token
- Paste the access token as the 'Token'
{
"parcel_description":"Beerbongs",
"recipient":"Mama Rhoda",
"contact":"0773489238",
"pickup_location":"Kawempe",
"destination":"Kwagala, Kivumbo side"
}
{
"destination":"Kwagala, Kivumbo side"
}
{
"status":"pending"
}
{
"current_location":"Kampala"
}
{
"username":"Admin1",
"password":"doNot2114"
}