The goal of this project is to implement two frontend ReactJS applications, author-book-ui and book-review-ui. They will consume the GraphQL endpoints of the two backend applications present in the project springboot-graphql-databases, author-book-api and book-review-api.
-
ReactJSUI application where staff members can manage authors and books and customers can see the books and read/add book reviews and their rating. Its main backend application isauthor-book-apibut all the reviews information are obtained frombook-review-api. It usesSemantic UI Reactas CSS-styled framework. -
ReactJSUI application where staff members can manage books and customers can see the books and read/add book reviews and their rating. Its backend application isbook-review-api. It usesMaterial UIas CSS-styled framework.
-
-
In a terminal, run the command below to clone
springboot-graphql-databasesprojectgit clone https://github.com/ivangfr/springboot-graphql-databases.git -
Build
author-book-apiandbook-review-apidocker images as described at https://github.com/ivangfr/springboot-graphql-databases#build-applications-docker-images
-
First, you need to start the environment and backend applications. For it, follow the instructions at Start Environment and Running applications with Maven
-
author-book-ui
-
Open a new terminal and go to
react-graphql-databases/author-book-ui -
Execute the command below if you are running
author-book-uifor the first timenpm install -
To start
author-book-uirunnpm start
-
-
book-review-ui
-
Open a new terminal and go to
react-graphql-databases/book-review-ui -
Execute the command below if you are running
book-review-uifor the first timenpm install -
To start
book-review-uirunnpm start
-
-
author-book-ui
In a terminal and inside
react-graphql-databases/author-book-ui, run the following commanddocker build -f Dockerfile -t ivanfranchin/author-book-ui:1.0.0 .Environment Variable Description AUTHOR_BOOK_API_HOSTSpecify host of the author-book-apiservice (defaultlocalhost)AUTHOR_BOOK_API_PORTSpecify port of the author-book-apiservice (default8080)BOOK_REVIEW_API_HOSTSpecify host of the book-review-apiservice (defaultlocalhost)BOOK_REVIEW_API_PORTSpecify port of the book-review-apiservice (default9080) -
book-review-ui
In a terminal and inside
react-graphql-databases/book-review-ui, run the following commanddocker build -f Dockerfile -t ivanfranchin/book-review-ui:1.0.0 .Environment Variable Description BOOK_REVIEW_API_HOSTSpecify host of the book-review-apiservice (defaultlocalhost)BOOK_REVIEW_API_PORTSpecify port of the book-review-apiservice (default9080)
Add the line below to /etc/hosts
127.0.0.1 author-book-api book-review-api First, you need to start the environment and backend applications. For it, follow the instructions at Start Environment and Running Applications as Docker containers
-
In a terminal, make sure you are inside
react-graphql-databasesroot folder -
Run following script
./start-apps.sh
| Application | URL |
|---|---|
| author-book-ui | http://localhost:3000 |
| book-review-ui | http://localhost:3001 |
-
This gif shows a staff member adding a book using the wizard option. First, he looks for the author
josh long. The search is looking for data at openlibrary.org. Then, he picks the bookGetting Started With Roo. As the authorJosh Longis new to the application, he is created. The information of the book is already fulfilled based on the response from openlibrary.org. Finally, the application shows the preview of the book card, as the customer will see it. The checkbox is enabled in order to create the book also inbook-review-ui. -
This another gif shows a customer adding a review about the book
Getting Started With Roo. Once the review is submitted, it is already available for customer checking books inauthor-book-uiapplication.
-
To stop applications
-
If they were started with
Npm, go to the terminals where they are running and pressCtrl+C -
If they were started as a Docker container, go to a terminal and, inside
react-graphql-databasesroot folder, run the script below./stop-apps.sh
-
-
Finally, follow the shutdown steps for backend applications as described at Shutdown
-
To remove the Docker images created by this project, go to a terminal and, inside
react-graphql-databasesroot folder, run the following script./remove-docker-images.sh -
Remove the line below from
/etc/hosts127.0.0.1 author-book-api book-review-api
-
In a terminal, make sure you are inside
react-graphql-databases/author-book-uiorspringboot-react-keycloak/book-review-uifolder -
Run the following commands
npm upgrade npm i -g npm-check-updates ncu -u npm install
- Add confirmation dialog before deleting a book or a author


