Real-world project from Java Web Developer Nanodegree at Udacity.
This backend implements a Vehicles API that serves as an endpoint to track vehicle inventory.
While the primary Vehicles API performs CRUD operations related to vehicle details, it can consume information from the separate Boogle Maps and Pricing Service APIs, and return that information as part of the vehicle information for a single vehicle.
demo.mov
The backend is composed of vehicles list services, pricing services, and location services as mentioned below:
- Vehicles API - a REST API to maintain vehicle data and to provide a complete view of vehicle details including price and address.
- Pricing Service - a REST WebService that simulates a backend that would store and retrieve the price of a vehicle given a vehicle id as input.
- Location API - a Mock that simulates a Maps WebService where, given a latitude longitude, will return a random address.
- Implement a
REST-based
Vehicles API that communicates with a location and pricing service usingSpring Boot
andHTTP WebClient
. - Convert the existing Pricing Service API to a microservice registered on a
Eureka
server. - Use
Swagger
to customize error messages and efficiently create documentation for the Vehicles API. - Implement tests that cover the
CRUD
operations for Vehicles API and Pricing Service usingSpring Test
,JUnit
andMockito
.
Note that the Boogle Maps, Pricing Service and Vehicles API applications must all be running for all operations to perform correctly, although they should be able to launch on their own.
You can either use these in separate windows in your favorite IDE, or use the below commands:
$ mvn clean package
(run this in each directory containing the separate applications)- Boogle Maps:
$ java -jar target/boogle-maps-0.0.1-SNAPSHOT.jar
- The service is available by default on port
9191
. You can check it on the command line by using$ curl http://localhost:9191/maps\?lat\=20.0\&lon\=30.0
- The service is available by default on port
- Pricing Service:
$ java -jar target/pricing-service-0.0.1-SNAPSHOT.jar
- Vehicles API:
$ java -jar target/vehicles-api-0.0.1-SNAPSHOT.jar
- The Swagger API documentation is available at: http://localhost:8080/swagger-ui.html