Cover Page....2
Table of Contents....3
Preface....4
Chapter 1: Understanding the Architecture of React Applications....12
Benefits of having a good application architecture....13
Exploring the architectural challenges of React applications....15
Understanding architectural decisions when building React applications....21
Planning our application....24
Summary....32
Chapter 2: Setup and Project Structure Overview....33
Technical requirements....33
Next.js application overview....35
TypeScript setup overview and usage....38
ESLint setup overview....45
Prettier setup overview....46
Pre-committing checks setup overview....47
Project structure overview....49
Summary....54
Chapter 3: Building and Documenting Components....55
Technical requirements....55
Chakra UI....57
Building components....59
Storybook....69
Documenting components....72
Summary....76
Chapter 4: Building and Configuring Pages....77
Technical requirements....77
Next.js routing....79
Next.js rendering strategies....80
Next.js SEO....83
Layouts....84
Building the pages....87
Summary....104
Chapter 5: Mocking the API....105
Technical requirements....105
Why is mocking useful?....107
Introduction to MSW....108
Configuring data models....115
Configuring request handlers for API endpoints....119
Summary....127
Chapter 6: Integrating the API into the Application....129
Technical requirements....129
Configuring the API client....131
Configuring React Query....132
Defining the API layer for the features....136
Consuming the API in the application....141
Summary....146
Chapter 7: Implementing User Authentication and Global Notifications....148
Technical requirements....148
Implementing the authentication system....150
Implementing notifications....159
Summary....167
Chapter 8: Testing....169
Technical requirements....169
Unit testing....171
Integration testing....172
End-to-end testing....185
Summary....191
Chapter 9: Configuring CI/CD for Testing and Deployment....192
Technical requirements....192
What is CI/CD?....194
Using GitHub Actions....195
Configuring the pipeline for testing....197
Configuring the pipeline for deploying to Vercel....201
Summary....208
Chapter 10: Going Beyond....209
Feature improvements....209
Technical improvements....215
Appendix....223
Summary....226
Index....227
Why subscribe?....243
Other Books You May Enjoy....244
Packt is searching for authors like you....245
Share Your Thoughts....245
Download a free PDF copy of this book....245
Building large-scale applications in production can be overwhelming with the amount of tooling choices and lack of cohesive resources. To address these challenges, this hands-on guide covers best practices and web application development examples to help you build enterprise-ready applications with React in no time.
Throughout the book, you’ll work through a real-life practical example that demonstrates all the concepts covered. You’ll learn to build modern frontend applications—built from scratch and ready for production. Starting with an overview of the React ecosystem, the book will guide you in identifying the tools available to solve complex development challenges. You’ll then advance to building APIs, components, and pages to form a complete frontend app. The book will also share best practices for testing, securing, and packaging your app in a structured way before finally deploying your app with scalability in mind.
By the end of the book, you’ll be able to efficiently build production-ready applications by following industry practices and expert tips.
This book is for intermediate-level web developers who already have a solid understanding of JavaScript, React, and web development in general and want to build large-scale React applications effectively. Beginner-level TypeScript experience, along with JavaScript and React, will be beneficial.