{"id":19033113,"url":"https://github.com/microsoftlearning/eshoponweb","last_synced_at":"2025-04-13T06:15:00.343Z","repository":{"id":62372356,"uuid":"549298066","full_name":"MicrosoftLearning/eShopOnWeb","owner":"MicrosoftLearning","description":"Repository maintained by AZ-400 course and Learn content community. Project used for AZ-400 Labs. Forked from: https://github.com/dotnet-architecture/eShopOnWeb  Sample - ASP.NET Core 8.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. ","archived":false,"fork":false,"pushed_at":"2025-04-01T16:56:52.000Z","size":3798,"stargazers_count":166,"open_issues_count":2,"forks_count":1818,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-13T06:14:56.581Z","etag":null,"topics":["az-400","bicep","devops","github","github-actions","pipelines"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicrosoftLearning.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-11T01:18:49.000Z","updated_at":"2025-04-08T06:01:20.000Z","dependencies_parsed_at":"2024-04-08T16:56:16.055Z","dependency_job_id":"896cec72-b28b-4679-826d-779c7b2286e3","html_url":"https://github.com/MicrosoftLearning/eShopOnWeb","commit_stats":{"total_commits":219,"total_committers":14,"mean_commits":"15.642857142857142","dds":0.3561643835616438,"last_synced_commit":"7ae6ee47c63262c9479483cb3c2d5d791a9db6bc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"MicrosoftLearning/INF99X-SampleCourse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftLearning%2FeShopOnWeb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftLearning%2FeShopOnWeb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftLearning%2FeShopOnWeb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicrosoftLearning%2FeShopOnWeb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicrosoftLearning","download_url":"https://codeload.github.com/MicrosoftLearning/eShopOnWeb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670434,"owners_count":21142904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["az-400","bicep","devops","github","github-actions","pipelines"],"created_at":"2024-11-08T21:35:33.369Z","updated_at":"2025-04-13T06:15:00.317Z","avatar_url":"https://github.com/MicrosoftLearning.png","language":"C#","readme":"[![Build Status](https://github.com/dotnet-architecture/eShopOnWeb/workflows/eShopOnWeb%20Build%20and%20Test/badge.svg)](https://github.com/dotnet-architecture/eShopOnWeb/actions)\n\n# Microsoft eShopOnWeb ASP.NET Core Reference Application\n\nSample ASP.NET Core reference application, powered by Microsoft, demonstrating a single-process (monolithic) application architecture and deployment model. If you're new to .NET development, read the [Getting Started for Beginners](https://github.com/dotnet-architecture/eShopOnWeb/wiki/Getting-Started-for-Beginners) guide.\n\nA list of Frequently Asked Questions about this repository can be found [here](https://github.com/dotnet-architecture/eShopOnWeb/wiki/Frequently-Asked-Questions).\n\n## Overview Video\n\n[Steve \"ardalis\" Smith](https://twitter.com/ardalis) recorded [a live stream providing an overview of the eShopOnWeb reference app](https://www.youtube.com/watch?v=vRZ8ucGac8M\u0026ab_channel=Ardalis) in October 2020. \n\n## eBook\n\nThis reference application is meant to support the free .PDF download ebook: [Architecting Modern Web Applications with ASP.NET Core and Azure](https://aka.ms/webappebook), updated to **ASP.NET Core 8.0**. [Also available in ePub/mobi formats](https://dotnet.microsoft.com/learn/web/aspnet-architecture).\n\nYou can also read the book in online pages at the .NET docs here: \nhttps://docs.microsoft.com/dotnet/architecture/modern-web-apps-azure/\n\n[\u003cimg src=\"https://dotnet.microsoft.com/blob-assets/images/e-books/aspnet.png\" height=\"300\" /\u003e](https://dotnet.microsoft.com/learn/web/aspnet-architecture)\n\nThe **eShopOnWeb** sample is related to the [eShopOnContainers](https://github.com/dotnet/eShopOnContainers) sample application which, in that case, focuses on a microservices/containers-based application architecture. However, **eShopOnWeb** is much simpler in regards to its current functionality and focuses on traditional Web Application Development with a single deployment.\n\nThe goal for this sample is to demonstrate some of the principles and patterns described in the [eBook](https://aka.ms/webappebook). It is not meant to be an eCommerce reference application, and as such it does not implement many features that would be obvious and/or essential to a real eCommerce application.\n\n\u003e ### VERSIONS\n\u003e #### The `main` branch is currently running ASP.NET Core 8.0.\n\u003e #### Older versions are tagged.\n\n## Topics (eBook TOC)\n\n- Introduction\n- Characteristics of Modern Web Applications\n- Choosing Between Traditional Web Apps and SPAs\n- Architectural Principles\n- Common Web Application Architectures\n- Common Client Side Technologies\n- Developing ASP.NET Core MVC Apps\n- Working with Data in ASP.NET Core Apps\n- Testing ASP.NET Core MVC Apps\n- Development Process for Azure-Hosted ASP.NET Core Apps\n- Azure Hosting Recommendations for ASP.NET Core Web Apps\n\n## Running the sample using Azd template\n\nThe store's home page should look like this:\n\n![eShopOnWeb home page screenshot](https://user-images.githubusercontent.com/782127/88414268-92d83a00-cdaa-11ea-9b4c-db67d95be039.png)\n\nThe Azure Developer CLI (`azd`) is a developer-centric command-line interface (CLI) tool for creating Azure applications.\n\nYou need to install it before running and deploying with Azure Developer CLI.\n\n### Windows\n\n```powershell\npowershell -ex AllSigned -c \"Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression\"\n```\n\n### Linux/MacOS\n\n```\ncurl -fsSL https://aka.ms/install-azd.sh | bash\n```\n\nAnd you can also install with package managers, like winget, choco, and brew. For more details, you can follow the documentation: https://aka.ms/azure-dev/install.\n\nAfter logging in with the following command, you will be able to use the azd cli to quickly provision and deploy the application.\n\n```\nazd auth login\n```\n\nThen, execute the `azd init` command to initialize the environment.\n```\nazd init -t dotnet-architecture/eShopOnWeb \n```\n\nRun `azd up` to provision all the resources to Azure and deploy the code to those resources.\n```\nazd up \n```\n\nAccording to the prompt, enter an `env name`, and select `subscription` and `location`, these are the necessary parameters when you create resources. Wait a moment for the resource deployment to complete, click the web endpoint and you will see the home page.\n\n**Notes:**\n1. Considering security, we store its related data (id, password) in the **Azure Key Vault** when we create the database, and obtain it from the Key Vault when we use it. This is different from directly deploying applications locally.\n2. The resource group name created in azure portal will be **rg-{env name}**.\n\nYou can also run the sample directly locally (See below).\n\n## Running the sample locally\nMost of the site's functionality works with just the web application running. However, the site's Admin page relies on Blazor WebAssembly running in the browser, and it must communicate with the server using the site's PublicApi web application. You'll need to also run this project. You can configure Visual Studio to start multiple projects, or just go to the PublicApi folder in a terminal window and run `dotnet run` from there. After that from the Web folder you should run `dotnet run --launch-profile Web`. Now you should be able to browse to `https://localhost:5001/`. The admin part in Blazor is accessible to `https://localhost:5001/admin`  \n\nNote that if you use this approach, you'll need to stop the application manually in order to build the solution (otherwise you'll get file locking errors).\n\nAfter cloning or downloading the sample you must setup your database. \nTo use the sample with a persistent database, you will need to run its Entity Framework Core migrations before you will be able to run the app.\n\nYou can also run the samples in Docker (see below).\n\n### Configuring the sample to use SQL Server\n\n1. By default, the project uses a real database. If you want an in memory database, you can add in the `appsettings.json` file in the Web folder\n\n    ```json\n   {\n       \"UseOnlyInMemoryDatabase\": true\n   }\n    ```\n\n1. Ensure your connection strings in `appsettings.json` point to a local SQL Server instance.\n1. Ensure the tool EF was already installed. You can find some help [here](https://docs.microsoft.com/ef/core/miscellaneous/cli/dotnet)\n\n    ```\n    dotnet tool update --global dotnet-ef\n    ```\n\n1. Open a command prompt in the Web folder and execute the following commands:\n\n    ```\n    dotnet restore\n    dotnet tool restore\n    dotnet ef database update -c catalogcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj\n    dotnet ef database update -c appidentitydbcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj\n    ```\n\n    These commands will create two separate databases, one for the store's catalog data and shopping cart information, and one for the app's user credentials and identity data.\n\n1. Run the application.\n\n    The first time you run the application, it will seed both databases with data such that you should see products in the store, and you should be able to log in using the demouser@microsoft.com account.\n\n    Note: If you need to create migrations, you can use these commands:\n\n    ```\n    -- create migration (from Web folder CLI)\n    dotnet ef migrations add InitialModel --context catalogcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj -o Data/Migrations\n\n    dotnet ef migrations add InitialIdentityModel --context appidentitydbcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj -o Identity/Migrations\n    ```\n\n## Running the sample in the dev container\n\nThis project includes a `.devcontainer` folder with a [dev container configuration](https://containers.dev/), which lets you use a container as a full-featured dev environment.\n\nYou can use the dev container to build and run the app without needing to install any of its tools locally! You can work in GitHub Codespaces or the VS Code Dev Containers extension.\n\nLearn more about using the dev container in its [readme](/.devcontainer/devcontainerreadme.md).\n\n## Running the sample using Docker\n\nYou can run the Web sample by running these commands from the root folder (where the .sln file is located):\n\n```\ndocker-compose build\ndocker-compose up\n```\n\nYou should be able to make requests to localhost:5106 for the Web project, and localhost:5200 for the Public API project once these commands complete. If you have any problems, especially with login, try from a new guest or incognito browser instance.\n\nYou can also run the applications by using the instructions located in their `Dockerfile` file in the root of each project. Again, run these commands from the root of the solution (where the .sln file is located).\n\n## Community Extensions\n\nWe have some great contributions from the community, and while these aren't maintained by Microsoft we still want to highlight them.\n\n[eShopOnWeb VB.NET](https://github.com/VBAndCs/eShopOnWeb_VB.NET) by Mohammad Hamdy Ghanem\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftlearning%2Feshoponweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoftlearning%2Feshoponweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoftlearning%2Feshoponweb/lists"}