Skip to content

morganebridges/myRetailServerApp

Repository files navigation

myRetailApp

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.

REST API:

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.

JSON Specification

The services for this application communicate through the default Spring Boot Jackson specification. Here is an example product:

{ "id" : 1, "name" : "Product_Name", "price": { "value" : 14.99, "currency_code" : "USD" } }

The endpoint specifications follow:

{host}/products/{sequence} :

Http method: GET

This 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.

{host}/products/getlist :

Http method: GET

This 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.

{host}/products/update

(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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published