Book description
Build fully functional, cloud-ready, and professional web applications using the latest features in the .NET 5 framework and React.js with Microsoft Azure
Key Features
- Explore the new features of .NET 5 with this updated edition of ASP.NET Core 5 and React
- Discover strategies for adopting a full-stack development approach, clean architecture techniques, and development best practices
- Learn how to manage data, design and package applications, and secure your web apps
Book Description
Microsoft's .NET framework is a robust server-side framework, now even more powerful thanks to the recent unification of the Microsoft ecosystem with the .NET 5 framework. This updated second edition addresses these changes in the .NET framework and the latest release of React.
The book starts by taking you through React and TypeScript components for building an intuitive single-page application and then shows you how to design scalable REST APIs that can integrate with a React-based frontend. Next, you'll get to grips with the latest features, popular patterns, and tools available in the React ecosystem, including function-based components, React Router, and Redux. As you progress through the chapters, you'll learn how to use React with TypeScript to make the frontend robust and maintainable and cover key ASP.NET 5 features such as API controllers, attribute routing, and model binding to build a sturdy backend. In addition to this, you'll explore API security with ASP.NET 5 identity and authorization policies and write reliable unit tests using both .NET and React, before deploying your app on Azure.
By the end of this book, you'll have gained the knowledge you need to enhance your C# and JavaScript skills and build full-stack, production-ready applications with ASP.NET 5 and React.
What you will learn
- Build RESTful APIs with .NET 5 using API controllers
- Secure REST APIs with identity and authorization policies
- Create strongly typed, interactive, and function-based React components using Hooks
- Understand how to style React components using Emotion.js
- Perform client-side state management with Redux
- Run a range of automated tests on the frontend and backend
- Implement continuous integration and continuous delivery (CI/CD) processes in Azure using Azure DevOps
Who this book is for
If you're a web developer looking to get up to speed with full-stack web application development with .NET Core and React, this book is for you. Although the book does not assume any knowledge of React, a basic understanding of .NET Core will help you to get to grips with the concepts covered.
Publisher resources
Table of contents
- ASP.NET Core 5 and React — Second Edition
- Why subscribe?
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Section 1: Getting Started
- Chapter 1: Understanding the ASP.NET 5 React Template
- Chapter 2: Creating Decoupled React and ASP.NET 5 Apps
- Section 2: Building a Frontend with React and TypeScript
- Chapter 3: Getting Started with React and TypeScript
- Chapter 4: Styling React Components with Emotion
- Chapter 5: Routing with React Router
- Chapter 6: Working with Forms
- Chapter 7: Managing State with Redux
- Section 3: Building an ASP.NET Backend
-
Chapter 8: Interacting with the Database with Dapper
- Technical requirements
- Implementing the database
- Understanding what Dapper is and its benefits
- Installing and configuring Dapper
-
Reading data using Dapper
- Creating the repository class
- Creating a repository method to get questions
- Creating a repository method to get questions by a search
- Creating a repository method to get unanswered questions
- Creating a repository method to get a single question
- Creating a repository method to check whether a question exists
- Creating a repository method to get an answer
- Writing data using Dapper
- Managing migrations using DbUp
- Summary
- Questions
- Answers
- Further reading
-
Chapter 9: Creating REST API Endpoints
- Technical requirements
- Creating an API controller
-
Creating controller action methods
- Creating an action method for getting questions
- Extending the GetQuestions action method for searching
- Creating an action method for getting unanswered questions
- Creating an action method for getting a single question
- Creating an action method for posting a question
- Creating an action method for updating a question
- Creating an action method for deleting a question
- Creating an action method for posting an answer
- Adding model validation
- Removing unnecessary request fields
- Summary
- Questions
- Answers
- Further reading
- Chapter 10: Improving Performance and Scalability
- Chapter 11: Securing the Backend
-
Chapter 12: Interacting with RESTful APIs
- Technical requirements
- Using fetch to interact with unauthenticated REST API endpoints
-
Interacting with Auth0 from the frontend
- Installing the Auth0 JavaScript client
- Recapping the sign-in and sign-out flows
- Creating the sign-in and sign-out routes
- Implementing a central authentication context
- Implementing the sign-in process
- Implementing the sign-out process
- Configuring Auth0 settings in our frontend
- Testing the sign-in and sign-out processes
- Controlling authenticated options
- Using fetch to interact with authenticated REST API endpoints
- Aborting data fetching
- Summary
- Questions
- Answers
- Further reading
- Section 4: Moving into Production
- Chapter 13: Adding Automated Tests
- Chapter 14: Configuring and Deploying to Azure
- Chapter 15: Implementing CI and CD with Azure DevOps
- Other Books You May Enjoy
Product information
- Title: ASP.NET Core 5 and React - Second Edition
- Author(s):
- Release date: January 2021
- Publisher(s): Packt Publishing
- ISBN: 9781800206168
You might also like
video
React Front to Back 2022
This course includes exposure to the MERN stack as well as Firebase, which provides a real-world …
video
Beginning Data Structures and Algorithms in C#
Explore the possibilities of C# for developing a variety of applications About This Video Master array …
book
ASP.NET Core 3 and React
Build modern, scalable, and cloud-ready single-page applications using ASP.NET Core, React, TypeScript, and Azure Key Features …
video
The Complete Guide to ASP.NET Core MVC (.NET 6)
This is a beginner to an advanced-level course on .NET 6 that will take you from …