
Build a real world ecommerce website with .net core 7 2024. Create a demo app showing home page with best selling products, shop, product details, cart, and authentication and authorization.
Kick off building a real-world ecommerce website with NET Core 7 by exploring web development fundamentals and gaining hands-on experience building your own web applications from scratch.
Master web development fundamentals with ASP.NET Core and understand prerequisites, including basic HTML, as you prepare to build a real world ecommerce project from scratch.
Install Visual Studio 2022 for the eCommerce project, download from the official site, select ASP.NET and Web development plus data storage and processing workloads, then install and launch.
Create a .NET Core MVC web app named Coffee Shop in Visual Studio by selecting the MVC template, opting out of authentication and docker, and noting the chosen .NET version.
Explore the dotnet core project structure with solution explorer, connected services, dependencies, and the settings json file, then organize static assets and the controllers, models, and views folders for mvc.
Explore the mvc pattern with its model, view, and controller. See how the controller handles http requests, talks to models like order and shopping cart, and renders product lists.
Create a product model class in the models folder with id, name, detail, image URL, price, and is trending, and handle nullability for future repository classes.
Implement the repository pattern to separate business logic from data access using repository interfaces and a concrete class, enabling loose coupling and easy data store changes via dependency injection.
Implement the repository pattern in a .NET Core 7 ecommerce app by creating a product repository interface with methods for all, trending, and by-id products, plus a dummy-data repository.
Register dependencies to the built-in IoC container by adding the product repository interface and its concrete class to the service collection, enabling constructor injection and automatic resolution of repository instances.
Create a products controller using dependency injection via the inversion of control container to inject IProductRepository, fetch all products with GetAllProducts, and prepare the shop view.
Organize the views by creating a products subfolder under the views folder and add the shop view for the shop action, using a Razor (.cshtml) file.
Pass the product list from the controller to the view; declare the model as IEnumerable of product and render image, name, and price in a foreach loop.
Explore how Entity Framework Core streamlines database work with an object-relational mapping and an object oriented data model. Install two NuGet packages to enable SQL Server connectivity for your application.
Explore the code-first approach with entity framework by defining a coffee shop db context and a products db set, then configure options and the connection string.
Learn how to add a database connection string in app settings, set up coffee shop db context with entity framework, and access the string through builder configuration.
Modify the repository class to use Entity Framework with the coffee shop db context and products db set, implementing get all, trending, and get by id with null checks.
Install the Microsoft.EntityFrameworkCore.Tools package, create a migration named initial create, and apply it with update-database to build the database and products table.
Seed the products table by using the data method in the model creating method, add a seed migration, update the database, and verify data via the product shop endpoint.
Explore how routing maps web addresses to controllers and actions, guiding the browser to pages like /home/index or /products/shop. See how routing middleware intercepts requests using the default route.
Learn how to build a product detail page in a .NET Core 7 ecommerce app by loading a product by id and rendering its image, name, and price.
Enable tag helpers to power navigation in ASP.NET Core apps and generate links to the products controller detail action, passing the product id as a route parameter.
Discover how to build a shared layout in views/shared, apply _layout and RenderBody for consistent headers and dynamic content, and optimize with view start and view imports.
Explore the course template, opening the index and shop pages, and review the assets folder with CSS, Bootstrap, and JS, and images to power a .NET Core 7 e-commerce site.
Integrate a downloaded template into a .NET Core MVC project by updating the layout with a shared header and footer, wiring the index view, and fixing asset paths with tilde.
Retrieve trending products from the database via the product repository and display them on the index page. Bind image, name, and price from the product model.
Connect the home page to the shop action in the products controller, render shop data from the database, and use a tag helpers loop to link to product details.
Navigate from the show page to the product detail page to display database-driven product details, and refine the styling by updating markup and linking names to detail pages.
Reuse a partial view in .NET Core to consolidate shared design for index and shop pages, avoiding duplicate code by using the shared folder and the partial tag helper.
Create a shopping cart model and repository using session-based user IDs, add a cart items table, and implement add, get, clear, and total methods for the cart.
Learn to manage user sessions and implement shopping cart methods including add, remove, clear, and total calculations via session-stored cart id and a repository pattern using a db context.
Create a shopping cart controller that injects a cart repository and a product repository, supports adding and removing items, and redirects to the cart index after updates.
Add the shopping cart index view using a base template, display a cart item and a total price, and set up future data retrieval from the database.
Display data in the shopping cart by loading a list of cart items in the index view, showing product name, image, quantity, price, and the total price.
Compute the shopping cart total with the repository’s get shopping cart total method, pass the decimal result via view bag, and display the dynamic total price in the cart.
Remove items from the shopping cart by clicking the delete icon, which passes the product id to the remove from shopping cart action in the shopping cart controller.
Display an empty shopping cart view by showing a no-items message when the cart is empty, using model.count. Provide a start shopping link that redirects to the shop page.
Display a real-time shopping cart counter in the navigation bar by storing the cart item count in session and retrieving it in the layout via HTTP context accessor.
Define the order model with id, user first name, last name, email, phone, address, order total, and placed date; add order detail with product, quantity, price; register in context.
Define an order repository interface with a void place order method, then implement it to create order and order details from the shopping cart and save to the database.
Register services for the order repository, generate a migration to add the order and order details tables, and update the database to reflect the new schema.
Create an orders controller that injects IOrderRepository and IShoppingCartRepository, implements checkout via a post method, places orders, clears the cart, and redirects to a checkout complete page.
Add a checkout view to the orders controller, render the order form from a custom template with a shared navigation bar, preparing for model binding.
Apply model binding to map form fields to the order model and perform type conversion during checkout. Place the order via the checkout form and reset the cart count.
Integrate ASP.NET Core Identity to add login, signup, authentication, and authorization; configure identity db context, install identity packages, set up authentication middleware, and run migrations to create identity tables.
Add authentication with scaffolding identity, enabling user registration, login, and logout using the coffee shop context and Entity Framework, and integrate Razor Pages for sign-in flows.
Improve the register and login pages by center aligning controls with bootstrap, updating navigation to the identity area, and configuring the login partial for sign in and sign out.
Authorize the orders controller to ensure only registered users can place orders by adding an authorization attribute, enforcing login before checkout.
Create an Azure web app by selecting the web app template, configuring a resource group, unique name, dotnet runtime, region, and pricing plan, then deploy and download the publish profile.
Create an Azure SQL database and server in the Azure portal, configure the admin login and pricing tier, set the firewall to allow Azure services, and publish the web app.
Publish your .NET Core 7 e-commerce web app to Azure. Update the app settings with the Azure SQL Database connection string and publish using the published profile.
Welcome to the Complete Real World Web Development course with .NET Core 7, where you will learn how to create a fully functional coffee shop e-commerce web application using Asp .NET Core and C#.
This comprehensive course covers everything you need to know to create a web application from scratch, including the latest version of .NET Core 7.0, as well as the previous version, .NET Core 6.
In this course, you'll
Develop a web app in .NET Core using Entity Framework Code First Approach
Use advanced features such as Dependency Injection and Repository Pattern
Implement Routing and Navigation Tag Helpers
Learn how to use Render Body, View Imports, View Start & _Layout File
Add Migrations in Web Application
Integrate Custom Theme or Template in Asp .NET Core Web Application
Create a Shopping Cart for your application
Implement Session Management
Learn how to implement Authentication and Authorization with Identity
Create a Coffee Shop ECommerce Web App From Scratch
By the end of this course, you will have the skills and knowledge to create a web app in .NET Core, connect it to an MSSQL database, deploy a web API on Microsoft Azure, and create a real-world coffee shop e-commerce web app from scratch.
With carefully thought-out and edited content, you can rest assured that you're getting a high-quality course. The course is designed for both beginners and experienced developers who want to improve their skills in .NET Core web development.
Remember, you will receive all the source code and links for the web application, as well as helpful material for the course. To launch your web application, you will need a personal Azure Portal.
If you're a busy developer who wants to quickly learn web development from scratch, this is the perfect course for you. Click the buy now button and join the world's First Complete Web Development Course with Asp .NET Core and C#.