Designing Applications with Spring Boot 2.2 and React JS
eBook - ePub

Designing Applications with Spring Boot 2.2 and React JS

Step-by-step guide to design and develop intuitive full stack web applications

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Designing Applications with Spring Boot 2.2 and React JS

Step-by-step guide to design and develop intuitive full stack web applications

About this book

Let us full stack development with Spring Boot and React JS. Key Features

  • This book has a very specific goal to make developing REST applications easier and focusing on common challenges of the design of the application with best practices.
  • This book is providing practical code examples from real-world experiences.
  • This book is not only about Spring Boot 2.2 and React JS overview but also has an in-depth discussion about adopted REST Architectural pattern and its constraints to create the REST APIs.
  • The book can act as a tool for learning Spring Boot 2.2 and React JS for the first time as well as a guide and reference for those wanting to dig deeper into specific features.


Description
Designing Applications with Spring Boot 2 & React JS is divided into three parts. The first part introduces you to the essentials of the Spring Boot 2.2 Framework and you will learn how to create REST APIs and how to secure REST APIs. Part 2 steps behind the front end application development with React JS and discuss React features and its advantages toward the frontend application development. Part 3 expands on that by showing how to deploy backend and frontend application the PaaS platform and also will discuss how to deploy application container technologies such as Docker. What Will You Learn

  • Exploring Spring Boot 2.2 new features and essential key components such as Starters, Autoconfiguration, CLI, Actuator.
  • Develop a REST application using Spring Boot 2.2 and DevTools.
  • Exploring Spring Boot Auto Configuration and Customization.
  • Creating application profiles based on the environments.
  • Learn to configure backend data using JDBC and Spring Data JPA.
  • Who This Book Is For
    Designing Application with Spring Boot 2.2 & React JS is for all Java developers who want to learn Spring Boot 2.2 and React JS as in the enterprise application. Therefore, enterprise Java developers will find it particularly useful in the understanding of Spring Boot 2.2 and React JS and how to develop a backend RESTful application using the Spring Boot 2.2 and frontend application using React JS framework. They will most fully appreciate the examples presented in this book. Before reading this book, readers should have basic knowledge of core java, spring, servlet, filter, XML, and JavaScript. Table of Contents
  • Getting Started with Spring Boot 2.2
  • Customizing Auto-Configuration
  • Configuring Data and CRUD operations
  • Creating REST APIs with Spring Boot 2.2
  • Securing REST APIs
  • Testing Spring Boot Application
  • Getting Started with React
  • Creating and Styling React Components
  • Consuming the REST API with React JS
  • Deploying and Containerizing Application

  • About the Author
    Dinesh Rajput is a founder of https://www.dineshonjava.com, a blog for Spring and Java techies. He is a Spring enthusiast and a Pivotal Certified Spring Professional. He has written many software design & development books, some of the bestselling books on Amazon. Dinesh's title Spring 5 Design Patterns and Mastering Spring Boot 2.0 are the Amazon #1 best-selling books on Java. He has more than 10 years of experience with various aspects of Spring and cloud-native development, such as REST APIs and microservice architecture.He is currently working as an architect at a leading company. He has worked as a tech lead at Bennett, Coleman & Co. Ltd, and Paytm.He has a master's degree in computer engineering from JSS Academy of Technical Education, Noida, and lives in Noida with his family. His Website: www.dineshonjava.com
    His Blog: www.dineshonjava.com & www.dineshrajput.com
    His LinkedIn Profile: www.linkedin.com/in/rajputdinesh/

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Designing Applications with Spring Boot 2.2 and React JS by Dinesh Rajput in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over one million books available in our catalogue for you to explore.

Chapter 1

Getting Started with Spring Boot 2.2

Spring Boot is a tricky framework to understand. In this chapter, we will discuss Spring Boot 2.2 and the underlying important concepts like starter projects, auto-configuration, and starter parents. We will also discuss how Spring Boot makes software development easy. As a bonus, I will discuss the story behind the success of Spring Boot. This chapter will cover a demo application with Spring Boot and create a REST service.
In this chapter, we will cover the following topics:
  • Introduction to Spring Boot 2.2
  • Essential key components
  • o Starters
  • o Auto-configuration
  • o The Spring Boot CLI
  • o The Spring Boot Actuator
  • System requirements and setting up the Spring Boot workspace
  • Creating a Spring Boot application
  • Introduction to Spring Boot DevTools

Introduction to Spring Boot 2.2

Spring Boot is one of the most popular frameworks used to develop software for any enterprise application. It is useful to develop a modern cloud-based distributed system such as microservices-based application. Spring Boot was one of the very major projects of the Pivotal team and it was launched in 2013.
Spring Boot makes it easy to create standalone, production-grade Spring-based applications that you can run. We take an opinionated view of the Spring platform and third-party libraries so that you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration.
Spring Boot is built on top of the existing Spring framework. So basically, it is not a separate framework, but it is similar to the existing Spring framework with some features. It’s a collection of ready-made things to just pick and use without taking any overhead configuration.
The primary goals of the Spring Boot are as follows:
  • Spring Boot provides faster Spring application development
  • Eliminate a lot of configurations from the application development and provide a new strategy for application development with minimal fuss.
  • You just focus on the application functionality rather than investing a lot of time in meta-configuration.
  • Spring Boot is a very opinionated framework out-of-the-box. It never forces to use auto-configuration for any module. We can easily override 100% configuration for any module if requirements start to diverge from the defaults.
  • Spring Boot does not generate code for you. It provides auto-configuration based on the module’s libraries available on the classpath of the application.
  • Apart from the auto-configurations, Spring Boot also provides a range of non-functional features that are common to large classes of projects (such as embedded servers, security, metrics, health checks, and externalized configuration).
  • Spring Boot reduces friction of project dependency management in the spring application. As we know that the dependency management and deciding versions of depending libraries are very hectic work for any software engineer.
  • Spring Boot allows you to create a Java application such as JAR and WAR artifact.
The Spring team is continuously working on the Spring framework and provides very interesting features till now. Spring Boot is one of the main projects of the Spring team. Spring Boot is not a separate framework or code generation library. It is a Spring framework by heart that means Spring Boot is on top of the Spring framework with some auto-configuration for modules based on the libraries available on the classpath of the Spring application. Let’s see the following diagram:
Figure 1.1: The Spring Boot framework representation
In the preceding diagram, you can see the Spring Boot framework on the top of the Spring framework with all the modules such as Spring MVC, Security, JDBC, ORM, Batch, JPA, and so on. Internally, Spring Boot uses the Spring framework to provide core functionality of Spring such as bean creation, providing bean’s scopes, etc. Let’s suppose you want to develop an application with Spring MVC and Spring Security, so you just need to add the libraries of these modules to the classpath of the application. You do not need to add configurations of Spring MVC and Spring Security to your application. Spring Boot adds this configuration by default in your application based on the libraries available in the classpath of the application. You can still override the default configuration of these modules. Spring Boot never forces you to use the default configuration. Further, let’s discuss the key components of Spring Boot in the next section.

Essential key components of Spring Boot

Spring Boot simplifies the Spring application development, so some magical components are behind this. The four essential key components of Spring Boot are as follows:
  • Spring Boot Starters
  • Auto-configuration
  • Spring Boot CLI
  • Spring Boot Actuator
Let’s discuss these key components in detail.

Spring Boot Starters

Starters in Spring Boot are like small Spring projects for each module with all the required configurations such as Spring Web MVC, Spring JDBC, ORM, JPA, Security, Spring Batch, and so on.
According to the Spring Boot documentation, Starters are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all Spring and related technologies that you need, without having to hunt through sample code and copy-paste loads of dependency descriptors.
In your Spring Boot application, add the starters of the respective modules to the classpath of your application and Spring Boot will ensure that all dependencies and transitive dependencies of the modules is using Maven or Gradle.
Let’s suppose you want to develop a REST web application to expose RESTful web services. For this REST application, you need to add the Spring web MVC module to your REST web application by includ...

Table of contents

  1. Cover
  2. Designing Application with Spring Boot 2.2 and React JS
  3. Copyright
  4. Dedication
  5. About the Author
  6. Acknowledgements
  7. Preface
  8. Downloading the Code Bundle and Colored Images
  9. Table of Contents
  10. Chapter 1 : Getting Started with Spring Boot 2.2
  11. Chapter 2 : Customizing Auto-configuration
  12. Chapter 3 : Configuring Data and CRUD operations
  13. Chapter 4 : Creating REST APIs with Spring Boot 2.2
  14. Chapter 5 : Securing REST APIs
  15. Chapter 6 : Testing a Spring Boot Application
  16. Chapter 7 : Getting Started with React JS
  17. Chapter 8 : Creating React JS Components
  18. Chapter 9 : Consuming REST API with React
  19. Chapter 10 : Deploying and Containerizing Applications
  20. Index