Welcome to SWIFT SEND, a delivery application designed to make sending and receiving packages simple, fast, and reliable. Whether you're shipping across the city or across the country, SWIFT SEND ensures your package gets there swiftly and safely.
SWIFT SEND is developed using FastAPI, a modern and high-performance web framework for Python. This API supports comprehensive delivery management operations including user authentication, address management, package creation, and delivery tracking, making it ideal for any delivery-based application.
Shout Out to Altschool!
A big shout-out to Altschool for providing an exceptional platform that nurtures and develops tech talents. Their comprehensive and extensive training program equips aspiring developers with the necessary skills and knowledge to excel in the tech industry. Altschool's commitment to hands-on learning, mentorship, and community support has prepared us to confidently tackle any challenges and resolve complex issues within the tech space. We are proud to be a part of this vibrant learning community that fosters innovation, creativity, and a passion for technology. This API was built by Godprevail Eseh and Olalere Sherifdeen Abiodun, two dedicated developers from the Altschool community..
To set up and run the SWIFT SEND API locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/your-username/swift-send.git cd swift-send -
Set Up Virtual Environment:
python -m venv env `env\Scripts\activate` # on Mac source env/bin/activate
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
uvicorn app.main:app --reload
Access the API documentation at http://127.0.0.1:8000/docs.
Below is an overview of the endpoints provided by the SWIFT SEND API.
-
Signup: Register a new user.
- User Endpoint:
POST /signup - Admin Endpoint:
POST /signup/admin - Courier Endpoint:
POST /signup/courier
- User Endpoint:
-
Login: Authenticate a user and provide an access token.
- Endpoint:
POST /login
- Endpoint:
-
Create Address: Add a new address for deliveries.
- Endpoint:
POST /addresses
- Endpoint:
-
Get Address: Retrieve details of an address.
- Endpoint:
GET /addresses/{address_id}
- Endpoint:
-
Update Address: Modify existing address information.
- Endpoint:
PUT /addresses/{address_id}
- Endpoint:
-
Delete Address: Remove an address.
- Endpoint:
DELETE /addresses/{address_id}
- Endpoint:
-
Create Package: Register a new package for delivery.
- Endpoint:
POST /packages
- Endpoint:
-
Get Package: Retrieve details of a specific package.
- Endpoint:
GET /packages/{package_id}
- Endpoint:
-
Update Package: Update details of a package.
- Endpoint:
PUT /packages/{package_id}
- Endpoint:
-
Delete Package: Remove a package from the system.
- Endpoint:
DELETE /packages/{package_id}
- Endpoint:
-
Create Delivery: Schedule a new delivery for a package.
- Endpoint:
POST /deliveries
- Endpoint:
-
Get Delivery: Retrieve delivery details including status and addresses.
- Endpoint:
GET /deliveries/{delivery_id}
- Endpoint:
-
Update Delivery Status: Update the status of a delivery (admin/courier priviledge only) - (e.g., PENDING, DELIVERED).
- Endpoint:
PUT /deliveries/{delivery_id}/status
- Endpoint:
-
Cancel Delivery: Cancel a scheduled delivery.
- Endpoint:
DELETE /deliveries/{delivery_id}
- Endpoint:
-
Assign Delivery Fee: Assign a fee to a scheduled delivery (admin/courier priviledge only).
- Endpoint:
DELETE /deliveries/{delivery_id}
- Endpoint:
Enums are used to define a set of named values that represent different statuses or methods in the API. Here are the enums used in SWIFT SEND:
Defines the current state of a delivery.
class DeliveryStatus(str, Enum):
PENDING = "pending" # The package is awaiting pickup.
PICKED_UP = "picked_up" # The package has been picked up by the courier.
IN_TRANSIT = "in_transit" # The package is on its way to the delivery address.
DELIVERED = "delivered" # The package has been delivered to the recipient.
CANCELLED = "cancelled" # The delivery has been cancelled.Specifies the payment method for the delivery service.
class PaymentMethod(str, Enum):
DEBIT_CARD = "debit_card" # Payment will be made using a debit card.
PAYSTACK = "paystack" # Payment will be processed through Paystack, an online payment platform.
BANK_TRANSFER = "bank_transfer" # Payment will be made via a direct bank transfer.
CASH_ON_DELIVERY = "cash_on_delivery" # Payment will be made in cash when the package is delivered.Developed by Godprevail Eseh and Olalere Sherifdeen Abiodun.
A big thank you to Altschool for their support and educational platform that made this project possible.
Feel free to explore, test, and provide feedback! THANKS