This is the code repository for Full Stack Development with Spring Boot 3 and React - Fourth Edition, published by Packt.
Build modern web applications using the power of Java, React, and TypeScript
The author of this book is -Juha Hinkula
Errata: Typos, tool user interface changes, or mistakes in code that would cause an error.
If you’re an existing Java developer who wants to go full stack or pick up another frontend framework, this book is your concise introduction to React. In this three-part build-along, you’ll create a robust Spring Boot backend, a React frontend, and then deploy them together. This new edition is updated to Spring Boot 3 and includes expanded content on security and testing. For the first time ever, it also covers React development with the in-demand TypeScript. You’ll explore the elements that go into creating a REST API and testing, securing, and deploying your applications. You’ll learn about custom Hooks, third-party components, and MUI. By the end of this book, you'll be able to build a full stack application using the latest tools and modern best practices.
- Make fast and RESTful web services powered by Spring Data REST
- Create and manage databases using ORM, JPA, Hibernate, and more
- Explore the use of unit tests and JWTs with Spring Security
- Employ React Hooks, props, states, and more to create your frontend
- Harness the Material UI component library to customize your frontend
- Use the fetch API, Axios, and React Query for networking
- Add CRUD functionality to your apps
- Deploy your apps using AWS and Docker
This fourth edition has been updated to Spring Boot 3. Here are the biggest changes:
- A new chapter introducing TypeScript, and TypeScript code throughout the book
- More modern tooling (Maven -> Gradle, create-react-app -> Vite)
- Expanded content on Spring Security and testing with Vitest
- New content on fetching data with the React Query library
- Backend deployment on AWS Elastic Beanstalk
- Frontend deployment on Netlify
If you’re an existing Java developer who wants to go full stack or pick up another frontend framework, this book is your concise introduction to React. In this three-part build-along, you’ll create a robust Spring Boot backend, a React frontend, and then deploy them together. This new edition is updated to Spring Boot 3 and includes expanded content on security and testing. For the first time ever, it also covers React development with the in-demand TypeScript. You’ll explore the elements that go into creating a REST API and testing, securing, and deploying your applications. You’ll learn about custom Hooks, third-party components, and MUI. By the end of this book, you’ll be able to build a full stack application using the latest tools and modern best practices.
- Chapter 1, Setting Up the Environment and Tools – Backend
- Chapter 2, Understanding Dependency Injection
- Chapter 3, Using JPA to Create and Access a Database
- Chapter 4, Creating a RESTful Web Service with Spring Boot
- Chapter 5, Securing Your Backend
- Chapter 6, Testing Your Backend
- Chapter 7, Setting Up the Environment and Tools – Frontend
- Chapter 8, Getting Started with React
- Chapter 9, Introduction to TypeScript
- Chapter 10, Consuming the REST API with React
- Chapter 11, Useful Third-Party Components for React
- Chapter 12, Setting Up the Frontend for Our Spring Boot RESTful Web Service
- Chapter 13, Adding CRUD Functionalities
- Chapter 14, Styling the Frontend with MUI
- Chapter 15, Testing React Apps
- Chapter 16, Securing Your Application
- Chapter 17, Deploying Your Application
Chapter 1, Setting Up the Environment and Tools – Backend, explains how to install the software needed in this book for backend development and how to create your first Spring Boot application.
Chapter 2, Understanding Dependency Injection, explains the basics of dependency injection and how it is achieved in Spring Boot.
Chapter 3, Using JPA to Create and Access a Database, introduces JPA and explains how to create and access databases with Spring Boot.
Chapter 4, Creating a RESTful Web Service with Spring Boot, explains how to create RESTful web services using Spring Data REST.
Chapter 5, Securing Your Backend, explains how to secure your backend using Spring Security and JWTs.
Chapter 6, Testing Your Backend, covers testing in Spring Boot. We will create a few unit and integration tests for our backend and learn about test-driven development.
Chapter 7, Setting Up the Environment and Tools – Frontend, explains how to install the software needed in this book for frontend development.
Chapter 8, Getting Started with React, introduces the basics of the React library.
Chapter 9, Introduction to TypeScript, covers the basics of TypeScript and how to use it to create React apps.
Chapter 10, Consuming the REST API with React, shows how to use REST APIs with React using the Fetch API.
Chapter 11, Useful Third-Party Components for React, demonstrates some useful components that we’ll use in our frontend development.
Chapter 12, Setting Up the Frontend for Our Spring Boot RESTful Web Service, explains how to set up the React app and Spring Boot backend for frontend development.
Chapter 13, Adding CRUD Functionalities, shows how to implement CRUD functionalities to the React frontend.
Chapter 14, Styling the Frontend with MUI, shows how to polish the user interface using the React MUI component library.
Chapter 15, Testing Your Frontend, explains the basics of React frontend testing.
Chapter 16, Securing Your Application, explains how to secure the frontend using JWTs.
Chapter 17, Deploying Your Application, demonstrates how to deploy an application with AWS and Netlify, and how to use Docker containers.
If you feel this book is for you, get your copy today!
With the following software and hardware list you can run all code files present in the book.
Software required | Link to the software | Hardware specifications | OS required |
---|---|---|---|
Eclipse (latest version) | https://www.eclipse.org/ | Common | Windows, MacOS, Linux |
VS Code (latest version) | https://code.visualstudio.com/ | Common | Windows, MacOS, Linux |
MariaDB version == 10 | https://mariadb.org/ | Common | Windows, MacOS, Linux |
Docker (latest version) | https://www.docker.com/get-started/ | Common | Windows, MacOS, Linux |
Node.js (latest LTS version) | https://nodejs.org/en | Common | Windows, MacOS, Linux |
Installation instructions:
- https://www.eclipse.org/downloads/packages/installer
- https://code.visualstudio.com/docs/setup/setup-overview
- https://mariadb.com/kb/en/getting-installing-and-upgrading-mariadb/
- https://docs.docker.com/engine/install/
- https://nodejs.org/en/download
You can get more engaged on the Discord server for more latest updates and discussions in the community at Discord
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost. Simply click on the link to claim your free PDF. Free-Ebook
We also provide a PDF file that has color images of the screenshots/diagrams used in this book at GraphicBundle
Juha Hinkula is a software development lecturer at Haaga-Helia University of Applied Sciences in Finland. He received an MSc degree in Computer Science from the University of Helsinki and has over 17 years of industry experience in software development. Over the past few years, he has focused on modern full stack development. He is also a passionate mobile developer with Android-native technology, and he uses React Native.