This is a small-scale fleet management system application where vehicles make deliveries to predetermined locations along a certain route.
- Java 8
- Spring boot 2.5.3
- Spring Data JPA
- H2 in-memory DB
- Restful API
- SwaggerAPI documentation
- JUnit5
- Docker
- Docker compose
- Maven
- Docker
git clone https://github.com/yasinaksu/java-spring-h2database-demo.git
The system can provide test records to the database for a quick start according to the given test case description pdf file. For this, it will be enough to uncomment @Component
annotation above the com.fleetmanagament.dataaccess.dataseeder.InitialDataSeed
class.
There are 3 ways of run & build the fleet-management-system application.
$PORT 9090
To build and run fleet-management-system
service via docker
$ cd fleet-management-system
$ docker build -t fleet-management-system:1.0 .
$ docker run --name fleet-management-system -d -p $PORT:8080 fleet-management-system:1.0
$PORT 9191
To build and run fleet-management-system
service via docker-compose
$ cd fleet-management-system
$ docker-compose up
$PORT 8080
To build and run fleet-management-system
service via maven
$ cd fleet-management-system
$ mvn clean install
$ mvn spring-boot:run
http://localhost:$PORT/swagger-ui.html
http://localhost:$PORT/h2
jdbc url= jdbc:h2:mem:fleetManagementDb
user name= sa
password = there is no password
http://localhost:$PORT/api/v1/vehicles
{
"licensePlate":"34 TL 34"
}
http://localhost:$PORT/api/v1/bags
{
"barcode": "C999800",
"deliveryPointValue": 3
}
http://localhost:$PORT/api/v1/deliverypoints
{
"name": "Branch",
"value": 1
}
http://localhost:$PORT/api/v1/packages
{
"barcode": "P7988000121",
"deliveryPointValue": 1,
"volumetricWeight":5
}
http://localhost:$PORT/api/v1/packages/bag
{
"packageBarcode": "P7988000121",
"bagBarcode": "C725799"
}
http://localhost:$PORT/api/v1/vehicles/shipments
The following Request is copied from test case description pdf file
{
"plate": "34 TL 34",
"route": [
{
"deliveryPoint": 1,
"deliveries": [
{
"barcode": "P7988000121"
},
{
"barcode": "P7988000122"
},
{
"barcode": "P7988000123"
},
{
"barcode": "P8988000121"
},
{
"barcode": "C725799"
}
]
},
{
"deliveryPoint": 2,
"deliveries": [
{
"barcode": "P8988000123"
},
{
"barcode": "P8988000124"
},
{
"barcode": "P8988000125"
},
{
"barcode": "C725799"
}
]
},
{
"deliveryPoint": 3,
"deliveries": [
{
"barcode": "P9988000126"
},
{
"barcode": "P9988000127"
},
{
"barcode": "P9988000128"
},
{
"barcode": "P9988000129"
},
{
"barcode": "P9988000130"
}
]
}
]
}