
Build an app with ASP.NET Core and React using clean architecture and practical, hands-on lessons. Learn authentication with social logins, real-time chat via SignalR, pagination, maps, and profile features.
Install the .NET SDK and latest stable .NET 9, install Node.js (prefer Node Version Manager), and set up VS Code, Visual Studio, or Rider with Postman and Git.
Install and configure essential Visual Studio Code extensions for .NET development, including the C Sharp Dev Kit, material icon theme, NuGet, and SQLite Viewer.
Download and organize course assets, images, and a postman collection from the resources, then browse the repository code and commit history to manage versions across sections.
Build a walking skeleton for a .net core and React app by creating a minimal API that retrieves seeded data via entity framework, demonstrates domain-centric architecture, and tests with Postman.
Create a multi-project .NET solution named reactivities with a web api, a controllers folder, and domain, application, and persistence libraries, then wire project references in VS Code.
Run the api project with dotnet run, explore launch settings and ports, verify the weather forecast endpoint, and simplify the project by removing unused files and configuring the request pipeline.
Create a domain entity class named activity in the domain project, with id, title, date, description, category, isCancelled, and location properties mapped to a database table via entity framework.
Define and integrate the AppDbContext class to manage database sessions with Entity Framework Core, configuring SQLite with a default connection string in startup and exposing an Activities DbSet.
Install the .NET EF tool and create an initial migration for the persistence and API projects, then apply it to create the SQLite activities table and review migrations history.
Seed the database by creating a db initializer, checking for existing activities, and populating with predefined activities from seeddata.txt using AppDbContext, migrations, and save changes asynchronously.
Create an api controller to query the database and return activities via an async http get, using dependency injection with a base api controller and proper not-found handling.
Test api endpoints with Postman by sending get requests to localhost:5001/api/activities, inspect request and response headers and json payload in the console, and use the pre-created collection to streamline testing.
Initialize a git repository in the project and prune noise with a gitignore. Commit only your code and push the branch to a public GitHub repository.
Wrap up section 2 by recapping the four .NET projects and the clean architecture dependencies among API, application, domain, and persistence. Preview client-side shift as we prepare a React app.
Build the walking skeleton part two client side to fetch API data with Axios and display activity titles in the browser using React, Vite, TypeScript, and Material UI.
Create a React project with Vite, a fast build tool, using TypeScript. Run the development server to view live output and the default template with a counter.
Explore the React project structure, adjust the Vite config for port 3000, upgrade to React 19, manage dependencies with npm, and set up JSX, ESLint, and VS Code snippets.
Learn to fetch data from an API in a React app using useState and useEffect, store activities, and render them as a mapped list with proper keys.
Configure cors in the api to allow requests from localhost:3000, enabling any header and method, and observe fetches from the api again after restarting the server.
Define an activity type in TypeScript, use JSON2TS to generate definitions from the API JSON, and apply useState with a typed Activity array.
Master debugging and performance insights by using React Dev Tools in Chrome to inspect components, state hooks, useEffect, and props, and prepare for styling with Material UI.
Install and configure Material UI in a React app by adding MUI Material, Emotion React, and Emotion Style, then Roboto fonts and Material Icons, and implement Typography and List components.
Learn to serve your client app over https in development by installing the veet-plugin-mkcert and creating a local trusted certificate. Update veetconfig.ts to enable https in your dev environment.
Switch to axios for data fetching, using its promise-based API, automatic JSON handling, and TypeScript support with axios.get and response.data to retrieve activity arrays.
Review section three explores building a React app with Vite, using TypeScript and Axios, and introducing Material UI, while clarifying desktop-focused styling and the upcoming .NET CRUD architecture.
Explore building a CRUD app with CQRS and the mediator pattern inside clean architecture, moving business logic to the application layer for scalable .NET Core and React applications.
Explore clean architecture, the dependency rule, and layered rings from entities to use cases and API controllers, showing how mediator-driven CRUD flows keep business logic isolated from UI and databases.
Explore cqrs concepts by distinguishing commands that modify state from queries that return values, and compare single-database versus two-database architectures, including eventual consistency and denormalization for scalable reads.
Implement a mediator-driven application layer to fetch a list of activities via a get activity list query and handler. Wire the mediator into the API controller to keep controllers thin.
Implement a mediator-based get activity details query and handler using app db context, handle missing activity with an exception, and slim down controllers for clean separation.
Slim down api controllers by moving mediator access to a base api controller and exposing a protected mediator for derived controllers like activities.
Implement a mediator create activity command with a handler using the database context, add the activity, save changes asynchronously, and return the server-generated id via a post endpoint.
Implement a mediator handler to edit an activity with an EditActivity command and handler, update the entity via db context, and return 204 no content for put requests; consider automapper.
Inject iMapper and add Automapper to the project, configure a mapping profile to map activity to activity, register automapper in program, and use it to update the activity before saving.
Learn to implement a mediator-based delete handler for activities in a .net core app, including command, handler, dbcontext removal, and an http delete endpoint.
Explore how cancellation tokens propagate from API requests through the mediator to cancel long-running database queries, and see a demo that delays and handles cancellation, though fast queries limit usefulness.
Use the VS Code .NET debugger to set breakpoints, attach to a running API, and configure launch.json to inspect controllers, handlers, and seed methods through a Postman workflow.
Wraps up section 4 by reinforcing clean architecture with four project layers, and explains CQRS and mediator flow for CRUD operations through API controllers and handlers.
Implement the API on the React client by creating, editing, and deleting activities in a grid with client-side state. Structure the app with TypeScript, Material UI, and basic forms.
Learn how to structure a React project by grouping by features, establishing app and features folders, consolidating CSS into a single styles.css, and using the public folder for assets.
Create a navbar component in React using a functional component and JSX, then implement a Material UI AppBar with icons and a CSS Baseline to stretch to the edges.
Style the navbar with a gradient background using Material UI Box and Sx, arrange items with display flex and space-between, and set a max-width XL container.
Create an ActivityDashboard component to display the activities list using grid2 12-column layout, passing activities via props from the app. Destructure props for cleaner code and groundwork for activity cards.
Create activity cards to display detailed activity information, organize dashboard assets, and build an activity list using Material UI cards and props typing.
Create an activity details view as a dedicated React component, pass the activity as a prop, and render a Material UI card with image, title, date, and description on dashboard.
Select an activity from the list by clicking the view button, which updates the selected activity and displays its details via prop drilling with useState and passed handlers.
Create an activity form on the right side that opens from the create activity button to add a new activity, using activity form.tsx with Material UI fields and actions.
Open and close the activity form using useState, lift the edit mode to app.tsx, and pass controls through nav, dashboard, and detail components to enable create and edit workflows.
Explore form basics in React, comparing controlled and uncontrolled inputs, using default value, and handling submit with preventDefault, form data extraction, and input names.
Submit form data locally in a React app to update the activity list, using handleSubmitsForm to differentiate create versus update and to assign temporary IDs.
Add delete functionality to the React app by filtering the activities list, pass the delete handler through props, and commit changes locally before syncing with GitHub.
Explore section five's CRUD operations in a React client-side app, embracing TypeScript, Material UI, and forms, while resolving prop drilling with React Query and MobX toward API integration.
Explore React Query (Tanstack Query) for data fetching and asynchronous state management, using Axios interceptors and custom hooks to share a cached, synchronized client–server state across components.
Learn to fetch and sync client data with the server using React Query, including installing the library, creating a query client, and using useQuery with caching, de-duplication, and background updates.
Install and use React Query DevTools to monitor queries, data, loading, and pending states, then set a 100vh minimum height and prepare a custom hook for activities.
Create a custom hook useActivities that encapsulates React Query logic with useQuery. Return activities and isPending for use in app.tsx to centralize data handling.
Create a centralized axios instance with interceptors and a global base URL, exposing an agent for API calls, and configure it via a .env.development file to avoid hard-coded URLs.
Explore updating an activity on the client with a React Query mutation, persisting changes via the API, and on success invalidating the activities query to sync server and UI.
Fix date population and state synchronization by using React Query to drive selected activity from use activities, replacing props with the hook, and manage mutations and validation errors.
Learn to implement a React Query mutation to create an activity using a post request, update the useActivities hook, and reflect the new activity in the list.
Learn to delete an activity using a React Query mutation, update the UI by invalidating the activities query, and persist changes across the app with a focused delete flow.
Configure React Query with a custom hook, use Axios interceptors for loading states, and connect API requests to support asynchronous state across the app, setting up routing next.
Set up a browser router with a root route and child routes in a React app, using outlet and route params to load activity details or create activity.
Learn how to add routing to a single-page React app by installing react-router, creating a router with browser router and routes.tsx, using outlet, and wiring a router provider in main.tsx.
Learn to add routes in a React app, create a homepage, and set up nested routes with outlets while cleaning props and preparing navigation for an activity dashboard.
Configure navigation links with React Router’s nav link, route home and create activity using forward slashes, and style active links via a custom menu item component.
Route to an activity details page using React Router, passing the activity ID to load an individual activity and demonstrate navigation from the activities list to details.
Fetch an individual activity from the API using the route id with React Router, update the useActivity hook, and enable the query only when an id exists, handling loading.
Add a route for editing an activity, load the activity form via the activity id, and navigate to the updated or newly created activity after saving, with loading states managed.
Give the activity form a key in routes.tsx to force React to unmount and remount when switching between create and edit, updating the header accordingly.
Explore why a router is essential in a React app and why this course uses React Router as the routing solution, with upcoming styling focus.
Enhance the user interface by laying out main components with Material UI on the home and activities pages, including cards with avatars, filters, overlays, and activity details.
Style the activity card in a React app by adding host/going status, placeholders, and a polished layout with Material UI elements like avatar, header, dividers, and a view button.
Breaks the activity details page into components, including header with image, information on date, time, and venue, chats, and attendees sidebar, using grid2 layout from material ui.
Build the activity details page with Material UI components and content snippets, including header, info, chat, and the attendees sidebar; populate with activity data and outline host and attendee actions.
Create and style a right-side filters component that lets users filter activities by attending, hosting, or date, using react calendar, material UI components, and custom CSS.
Style the homepage to fill the screen, hide the navigation bar, and include a button that takes users to the activities dashboard.
Learn to format dates in a React app using date-fns, create a reusable util function, and apply consistent formatting across activity cards and details with a responsive layout.
Conclude section 8 of the .NET Core and React guide by refining the UI with Material UI and styled components, and introduce MobX for client-side state.
Explore MobX for client side state management, MobX React Lite, and React Context; compare with React Query for asynchronous state and implement navbar loading indicators.
Learn the core of MobX: observables, actions, and computed properties, and how to manage a global store with makeObservable or makeAutoObservable, React context, and observer components.
Set up MobX by creating a global store with React context, installing MobX and MobX-React-Lite, and providing the store via a context provider in main.tsx for observable state management.
Wire a counter store into a React component, observe its title and count with MobX Observer, and prepare actions to update the observable values.
Configure a MobX counter store with increment and decrement actions (default amount one) using arrow functions for class binding, then observe changes to re-render the React component.
Explore an alternative MobX approach by wrapping a React component with a higher-order Observer to reduce boilerplate, and use makeAutoObservable to simplify stores.
Derive state with MobX computed properties from the store, updating eventCount as the events array changes. Build a counter component that logs events and updates on increment or decrement.
Create a UIStore to track an isLoading flag with isBusy and isIdle, updated via a request interceptor, and display a loading indicator under the nav bar with MobX React Lite.
Explore how React Query handles caching and staleness, configure stale time, and use router location and enabled flags to conditionally fetch activities only on the activities route.
Implement client-side state with MobX and MobX React Lite to power loading indicators, using React Context to access store, and compare with Redux and React Query for asynchronous state handling.
Learn centralized error handling and validation across domain entities and api controllers with custom middleware and Axios interceptors, using a result object in a clean architecture to return http errors.
Explore improving API validation with data annotations in a .NET Core and React app, using a create activity DTO, AutoMapper, and clear HTTP 400 validation responses.
Apply fluent validation in the application layer by creating CreateActivityValidator for the CreateActivity command, ensuring title and description are not empty. Integrate via dependency injection to enable validator-based checks.
Implement mediator middleware to auto-validate requests with FluentValidation, injecting IValidator into a ValidationBehaviour that runs validateAsync and throws a validation exception, while registering validators from the assembly.
Implement a custom exception handling middleware in the mediator pipeline to convert FluentValidation validation exceptions into a 400 bad request with detailed errors.
Learn to handle API error responses with a result-based approach by introducing a generic Result<T> class for success and failure and moving error handling to the application layer.
Refactor GetActivityDetails to return a result object with success and failure states, centralize error handling in a base API controller using a handle results method, and standardize 404 responses.
Learn robust API error handling in .NET core by returning a unified results object from delete, edit, and create activity handlers, using the mediator Unit type and checking save changes.
Implement a custom AppException and exception middleware to return camelCase JSON, log errors with ILogger, and show stack traces only in development.
Enhance the create activity dto validation by chaining validators to enforce required fields, maximum lengths, and future dates, and validate latitude and longitude within geographic ranges.
Explore validation architecture in the .NET Core and React course, using a base activity DTO and a generic base validator to support create and edit flows with fluent validation.
Set up client-side error handling with a test-errors component and a buggy API controller, integrate React Query and toast notifications, and plan an Axios interceptor for errors.
Use an Axios interceptor to centralize error handling, replacing try-catch with a switch on response status, and display toasts for 400, 401, 404, and 500 errors.
Create a not found component to handle 404 errors and redirect users to a dedicated not found page in the React client of the .Net Core and React app.
Explore how to differentiate and handle 400 bad request errors, including validation errors versus plain bad requests, by inspecting interceptor responses, mapping data.errors to modelStateErrors, and rendering toast or alerts.
Handle server errors by redirecting to a server error page, displaying details in development and a safe message in production, using router state and location for error data.
Explore error handling, validation, and centralized exception management with custom middleware and axios interceptors, reinforcing a clean architecture where business logic stays separate from presentation.
***Course has now been updated for .Net 10 and React 19***
Have you learnt the basics of ASP.NET Core and React? Not sure where to go next? This course should be able to help with that. In this course we learn how to build a multi-project ASP.NET Core solution that is built using Clean Architecture and the CQRS and Mediator pattern that makes our code easy to understand, reason about and extend.
Both ASP.NET Core and React are hot topics and this course will enhance your knowledge of both, simply by building an application from start to finish. In each module we learn something new, whilst incrementally adding features to the application. Building an application is significantly more rewarding than building yet another Todo List from the documentation!
Every line of code is demonstrated and explained and by the end of this course you will have the skills and knowledge to build your own application using the techniques taught in this course.
Here are some of the things you will learn about in this course:
Setting up the developer environment
Creating a multi-project solution using the the ASP.NET Core WebAPI and the React app using the DotNet CLI and the create-react-app utility.
Clean Architecture and the CQRS + Mediator pattern
Setting up and configuring ASP.NET Core identity for authentication
Using React with Typescript
Adding a Client side login and register function to our React application
Using React Router
Using React Query for async state management
Using AutoMapper in ASP.NET Core
Building a great looking UI using Semantic UI
Adding Photo Upload widget and creating user profile pages
Using React Hook Form and Zod to create re-usable form inputs with validation
Paging, Sorting and Filtering
Using SignalR to enable real time web communication to a chat feature in our app
Publishing the application to Azure
Many more things as well
Tools you need for this course
In this course all the lessons are demonstrated using Visual Studio Code, a free (and fantastic) cross platform code editor. You can of course use any code editor you like and any Operating system you like... as long as it's Windows, Linux or Mac
Is this course for you?
This course is very practical, about 90%+ of the lessons will involve you coding along with me on this project. If you are the type of person who gets the most out of learning by doing, then this course is definitely for you.
On this course we will build an example social network application that allows users to sign up to events (similar to MeetUp or Facebook), completely from scratch. All we start with is an empty terminal window or command prompt.
All you will need to get started is a computer with your favourite operating system, and a passion for learning how to build an application using ASP.NET Core and React