Hands-On Full Stack Development with Spring Boot 2 and React - Second Edition

Book description

A comprehensive guide to building full stack applications covering frontend and server-side programming, data management, and web security

Key Features

  • Unleash the power of React Hooks to build interactive and complex user interfaces
  • Build scalable full stack applications designed to meet demands of modern users
  • Understand how the Axios library simplifies CRUD operations

Book Description

React Hooks have changed the way React components are coded. They enable you to write components in a more intuitive way without using classes, which makes your code easier to read and maintain. Building on from the previous edition, this book is updated with React Hooks and the latest changes introduced in create-react-app and Spring Boot 2.1.

This book starts with a brief introduction to Spring Boot. You’ll understand how to use dependency injection and work with the data access layer of Spring using Hibernate as the ORM tool. You’ll then learn how to build your own RESTful API endpoints for web applications. As you advance, the book introduces you to other Spring components, such as Spring Security to help you secure the backend. Moving on, you’ll explore React and its app development environment and components for building your frontend. Finally, you’ll create a Docker container for your application by implementing the best practices that underpin professional full stack web development.

By the end of this book, you’ll be equipped with all the knowledge you need to build modern full stack applications with Spring Boot for the backend and React for the frontend.

What you will learn

  • Create a RESTful web service with Spring Boot
  • Grasp the fundamentals of dependency injection and how to use it for backend development
  • Discover techniques for securing the backend using Spring Security
  • Understand how to use React for frontend programming
  • Benefit from the Heroku cloud server by deploying your application to it
  • Delve into the techniques for creating unit tests using JUnit
  • Explore the Material UI component library to make more user-friendly user interfaces

Who this book is for

If you are a Java developer familiar with Spring, but are new to building full stack applications, this is the book for you.

Downloading the example code for this ebook: You can download the example code files for this ebook on GitHub at the following link: https://github.com/PacktPublishing/Hands-On-Full-Stack-Development-with-Spring-Boot-2-and-React-Second-Edition. If you require support please email: customercare@packt.com

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Full Stack Development with Spring Boot 2 and React Second Edition
  3. Dedication
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Section 1: Backend Programming with Spring Boot
  8. Setting Up the Environment and Tools - Backend
    1. Technical requirements
    2. Setting up the environment and tools
      1. Installing Eclipse
      2. The basics of Eclipse and Maven
      3. Creating a project with Spring Initializr
      4. How to run the project
      5. Spring Boot development tools
      6. Logs and problem solving
      7. Installing MariaDB
    3. Summary
    4. Questions
    5. Further reading
  9. Dependency Injection
    1. Technical requirements
    2. Introducing DI
      1. DI in Spring Boot
    3. Summary
    4. Questions
    5. Further reading
  10. Using JPA to Create and Access a Database
    1. Technical requirements
    2. Basics of ORM, JPA, and Hibernate
      1. Creating the entity classes
      2. Creating CRUD repositories
      3. Relationships between tables
      4. Setting up the MariaDB database
    3. Summary
    4. Questions
    5. Further reading
  11. Creating a RESTful Web Service with Spring Boot
    1. Technical requirements
    2. Basics of REST
      1. Creating a RESTful web service
      2. Using Spring Data REST
    3. Summary
    4. Questions
    5. Further reading
  12. Securing and Testing Your Backend
    1. Technical requirements
    2. Spring Security
    3. Securing your backend using JWT
    4. Testing in Spring Boot
    5. Creating unit tests
    6. Summary
    7. Questions
    8. Further reading
  13. Section 2: Frontend Programming with React
  14. Setting Up the Environment and Tools - Frontend
    1. Technical requirements
    2. Installing Node.js
    3. Installing VS Code
      1. VS Code extension
    4. Creating and running a React app
      1. Modifying a React app
    5. Summary
    6. Questions
    7. Further reading
  15. Getting Started with React
    1. Technical requirements
    2. Basic React components
    3. Basics of ES6
      1. Understanding constants
      2. Arrow functions
      3. Template literals
      4. Classes and inheritance
    4. JSX and styling
    5. Props and the state
    6. Component life cycle methods
    7. Stateless components
    8. React hooks
    9. Handling lists with React
    10. Handling events with React
    11. Handling forms with React
    12. Summary
    13. Questions
    14. Further reading
  16. Consuming the REST API with React
    1. Technical requirements
    2. Using promises
    3. Using the fetch API
    4. Using the axios library
    5. Practical examples
    6. Summary 
    7. Questions
    8. Further reading
  17. Useful Third-Party Components for React
    1. Technical requirements
    2. Using third-party React components
    3. React Table
    4. Material-UI component library
    5. Routing
    6. Summary
    7. Questions
    8. Further reading
  18. Section 3: Full Stack Development
  19. Setting Up the Frontend for Our Spring Boot RESTful Web Service
    1. Technical requirements
    2. Mocking up the UI
    3. Preparing the Spring Boot backend 
    4. Creating the React project for the frontend
    5. Summary 
    6. Questions
    7. Further reading
  20. Adding CRUD Functionalities
    1. Technical requirements
    2. Creating the list page
    3. The delete functionality
    4. The add functionality
    5. The edit functionality
    6. Other functionalities
    7. Summary
    8. Questions
    9. Further reading
  21. Styling the Frontend with React Material-UI
    1. Technical requirements
    2. Using the Button component
    3. Using the Grid component
    4. Using the TextField components
    5. Summary
    6. Questions
    7. Further reading
  22. Testing Your Frontend
    1. Technical requirements
    2. Using Jest
    3. Snapshot testing
    4. Using Enzyme
    5. Summary
    6. Questions
    7. Further reading
  23. Securing Your Application
    1. Technical requirements
    2. Securing the backend
    3. Securing the frontend
    4. Summary
    5. Questions
    6. Further reading
  24. Deploying Your Application
    1. Technical requirements
    2. Deploying the backend
    3. Deploying the frontend
    4. Using Docker containers
    5. Summary
    6. Questions
    7. Further reading
  25. Best Practices
    1. What to learn next
      1. HTML 
      2. CSS
      3. HTTP
      4. JavaScript
      5. A backend programming language
      6. Some frontend libraries and frameworks
      7. Databases
      8. Version control
      9. Useful tools
      10. Security
    2. Best practices
      1. Coding conventions
      2. Choosing the proper tools
      3. Choosing the proper technologies
      4. Minimizing the amount of coding
    3. Summary
    4. Questions
    5. Further reading
  26. Assessments
    1. Chapter 1
    2. Chapter 2
    3. Chapter 3
    4. Chapter 4
    5. Chapter 5
    6. Chapter 6
    7. Chapter 7
    8. Chapter 8
    9. Chapter 9
    10. Chapter 10
    11. Chapter 11
    12. Chapter 12
    13. Chapter 13
    14. Chapter 14
    15. Chapter 15
    16. Chapter 16
  27. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Hands-On Full Stack Development with Spring Boot 2 and React - Second Edition
  • Author(s): Juha Hinkula
  • Release date: May 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781838822361