We would like you to create a java based backend application using REST. It should contain the following endpoints;
GET /api/stocks (get a list of stocks) POST /api/stocks (create a stock) GET /api/stocks/1 (get one stock from the list) PUT /api/stocks/1 (update the price of a single stock)
The list of stocks should be created in memory on application startup. The stock object contains at least the fields; id (Number), name (String), currentPrice (Amount) and lastUpdate (Timestamp). Use the frameworks as you see fit to build and test this.
We would also like you to create a front-end which shows the stock list.
*NOTE:* Please do not use a generator (like yeoman), because then it is very difficult for us to determine what you have written yourself and what parts are generated.
Treat this application as a real MVP that should go to production.
-
Backend
- Java 8
- Spring Boot
- Spring Cloud
- Eureka
- Zuul
-
Frontend
- Nodejs v8.9.4
This project is divide in 4 subproject
- service-discovery (based on Eureka)
Java - api-gateway (based on Zuul)
Java - stock-service
Java - web-app
Nodejs
The main reason of this configuration is to show how a microservice oriented architecture should be and how it work, also keeping in mind the goal of this assignment.
It provides an embedded HSQLDB database as in-memory database Also, under the stock-service project you will find a swagger.json file that has the specification of the Rest-API
Checkout this respository
Open 4 terminals
-
Service discovery
$ cd service-discovery$ mvn spring-boot:run
-
API Gateway
$ cd api-gateway$ mvn spring-boot:run
-
Stock Service
$ cd stock-service$ mvn spring-boot:run
-
WebApp
$ cd web-app$ npm run dev- Open in browser the url displayed in the console to access the wep-app interface
-
For java project you can run
$ mvn packagein the root directory of the project, it will generate the respective JAR's for each subproject under the directorytarget/of each java project There is not a specific mechanims to upload the packages to an Artifactory, it can be to a maven repository or wrapped into a docker image. To run the respective modules is enough to execute$ java -jar {path-to-jar}.jarfor example from the root$ java -jar service-discovery/target/payconiq-service-discovery-1.0.0.jar -
For nodejs project:
$ cd web-app$ npm run startto run the server from the source code OR$ npm run generateto generate static content underdist/directory to upload to a static hosting.
- Location Header points to the actual service address instead of the proxy (api-gateway)
- Pagination in the webapp.
- Proper deployment configuration for Continious Delivery (CD), like automatic docker image generation.