This project provide end point for generating user bills for an online e-commerce store Here is an overview of the project's features:
- Leverage Spring Boot framework to build a Monolithic application.
- Uses Spring Data JPA to persist data to h2 database.
- Uses H2, an in-memory database for spring application.
Below is a class diagram for the main entities of the system
This project is a simple spring boot, unauthenticated api for a general online e-commerce store.
Project is created with:
- Install Java JDK 1.8 and ensure it is available in your PATH
- (Optional) Apache Maven is used for an alternate build system. Click for instructions.
In this section run the Spring Boot application on your local workstation. If this works you are in business:
Clone project from its repository into your local machine and navigate into its directory
$ git clone git@github.com:MartinNtlhe/ecommerce-api.git
$ cd ecommerce-api
To build the project one must run the following commands on the project root folder:
mvn clean package
Run the application on localhost:
mvn spring-boot:run
You should be able to read swagger documentation of the application which list all apis of the system.
To run for specific tests, there are 4 test provided and can be executed as follows:
- UserTest run
mvn "-DTest=UserTest" test - UserTypeTest
mvn "-DTest=UserTest" test - ProductServiceTest
mvn "-DTest=ProductServiceTest" test - BillServiceTest
mvn "-DTest=BillServiceTest" test
To generate code coverage report, run in the terminal mvn clean verify. This will generate reports in the the folder report relative to the root project folder. To access the report, open the folder and index.html on the browser.
Api documentation has been done using swagger documents, and can be accessed by clicking on swagger-document to view the api documentation
That's it...
