The goal of this project is to implement two frontend React 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.
On ivangfr.github.io, I have compiled my Proof-of-Concepts (PoCs) and articles. You can easily search for the technology you are interested in by using the filter. Who knows, perhaps I have already implemented a PoC or written an article about what you are looking for.
- [Medium] Implementing and Securing a Spring Boot GraphQL API with Keycloak
- [Medium] Implementing and Securing a Spring Boot GraphQL API with Okta
-
ReactUI 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 review information is obtained frombook-review-api. It usesSemantic UI Reactas CSS-styled framework. -
ReactUI 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-databasesproject:git 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 time:npm install
-
To start
author-book-uirun:npm 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 time:npm install
-
To start
book-review-uirun:npm start
-
In a terminal and inside react-graphql-databases root folder, run the following script:
./build-docker-images.sh-
author-book-ui
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
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 and inside react-graphql-databases root 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 book information is already filled in 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 to also create the book inbook-review-ui. -
This other gif shows a customer adding a review for the book
Getting Started With Roo. Once the review is submitted, it is immediately available for customers viewing books in theauthor-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/hosts:127.0.0.1 author-book-api book-review-api
-
In a terminal, make sure you are inside the
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
book-review-ui is still using React 17 because it's depending on material-ui to support React 18. For more information see material-ui issue #32074.


