Skip to content

This project written in Java language and Spring Framework, represent Implementation of a Delivery API containing few functionalities

Notifications You must be signed in to change notification settings

itsmechelly/delivery-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

delivery-application

To view the preview page please CLICK HERE.

🤔 What is the purpose of this application?

This project written in Java language and Spring Framework, represent Implementation of a Delivery API containing the following functionality:

💬 Timeslot

A delivery window containing start time, end time and supported addresses.

👉 The two sources below will be fetched in parallel in order to validate the resulted timeslots:
• A local static json file named 'courierAPI.json' is loaded when the program is starting. This file contains the available timeslots for the upcoming week.
• Courier timeslots that fall on holidays will be excluded. For this part I have used HolidayAPI (https://holidayapi.com/docs).

👉 Each timeslot can be used for 2 deliveries.

💬 Delivery

Contains status & selected timeslot. Business capacity - the system supports up to 10 deliveries per day. To make sure that the system supports 10 deliveries per day, I used Github's library named Bucket4j.

💬 Address

I have used Geoapify API to locate correct addresses (https://www.geoapify.com/geocoding-api) into an object that holds the address data (such as: street, line1, line2, country, postcode, etc...).

Extra Details

NOTE: This program is really simple, at this moment the program does not support concurrent requests. These days I am working on a new project to upgrade this one by using Spring WebFlux To handle concurrent requests.

External API I have used in this project

Geoapify (https://www.geoapify.com/geocoding-api)
        To locate correct addresses.

HolidayAPI (https://holidayapi.com/docs)
        To exclude holidays from timeslots.

Bucket4j Github's library
        To manage system delivery capacity per day.

Endpoints

👉 TimeslotController:

POST: retrieveAllAvailableTimeslots (Address address)

Parameter Type
address Address
 http://localhost:8080/api/timeslots

👉 AddressController:

POST: resolveAddress(String searchTerm)

Parameter Type
searchTerm String
 http://localhost:8080/api/resolve-address

👉 DeliveryController:

POST: bookDelivery(CreateDeliveryDto createDeliveryDto)

Parameter Type
createDeliveryDto CreateDeliveryDto
 http://localhost:8080/api/deliveries

POST: completeDelivery(Long deliveryId)

Parameter Type
deliveryId Long
 http://localhost:8080/api/deliveries/{deliveryId}/complete

DELETE: cancelDelivery(Long deliveryId)

Parameter Type
deliveryId Long
 http://localhost:8080/api/deliveries/{deliveryId}

GET: getAllDailyDeliveries()

Parameter Type
none none
 http://localhost:8080/api/deliveries/daily

GET: getAllWeeklyDeliveries()

Parameter Type
none none
 http://localhost:8080/api/deliveries/weekly

🛠 Tech Stack

Language & Framework:
        Java
        Spring Framework

Database:
        SQL
        MySQL
        Spring Hibernate JPA (SQL)

Libraries and External API’s:
        Geoapify (https://www.geoapify.com/geocoding-api)
        HolidayAPI (https://holidayapi.com/docs)
        Bucket4j Github's library

Caching & Scheduling Mechanisms:
        Spring Scheduling
        Spring Hibernate JPA + MySQL as a local cache memory

Client-Side UI:
        HTML
        CSS
        Bootstrap 5
        JavaScript


Thanks for reading,
Chelly 👩🏻‍💻

About

This project written in Java language and Spring Framework, represent Implementation of a Delivery API containing few functionalities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages