This application was developed as a technical sample. The server application itself is created from Spring Boot, the data source is the Spring Boot MongoDB integration. I built the frontend app (which is stored in the /resources/static folder) with AngularJS version 1 and Bootstrap CSS for styling.
In order to use this project, you will need the following applications available through your path: Gradle 2.9+ MongoDB available through the CLI.
The Application.properties file is under src/main/resources, and can be used to set configuration settings for the app. Things including server port (default 8686), logging file, and logging levels can be set there.
To build and launch this project, use this command from the project root directory:
mvn clean install;java -jar build/libs/myRetailApp-0.1.0.jar
Once the application is built, it can be visited by browsing to : {host}:{port}, and the angular JS app is there. Static content is being served from the src/resources/static folder, and this is where the index.html file is being served from.
The rest API of this application is made available both through the origin of the server app as well as through a RESTful communication cross-origin, because CORS is enabled through the Spring-Boot application.
The services for this application communicate through the default Spring Boot Jackson specification. Here is an example product:
The endpoint specifications follow:
Http method: GETThis endpoint is to load the JSON document that represents a product within the database. the "sequence" field is set by the Spring application and is a unique integer. It is visibile from client and server applications throughout the system.
Http method: GETThis endpoint exists for the purpose of requesting a full list of products within the system. With the current version of the version, no filtering is available, but this feature would certainly be considered for a future improvement.
(also aliased at {host}/products/ with a ProductDTO request body) Http method: PUT
Given a valid existing product Model, this endpoint will update name and price fields for that instance.