Giter VIP home page Giter VIP logo

hcchappy / eshoponweb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dotnet-architecture/eshoponweb

0.0 2.0 0.0 55.85 MB

Sample ASP.NET Core 3.1 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.

Home Page: https://docs.microsoft.com/en-us/dotnet/standard/modern-web-apps-azure-architecture/

License: MIT License

C# 75.14% CSS 7.34% JavaScript 0.01% Dockerfile 1.49% HTML 16.03%

eshoponweb's Introduction

Build Status

Microsoft eShopOnWeb ASP.NET Core Reference Application

Sample 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 guide.

A list of Frequently Asked Questions about this repository can be found here.

This reference application is meant to support the free .PDF download ebook: Architecting Modern Web Applications with ASP.NET Core and Azure, updated to ASP.NET Core 3.1. Also available in ePub/mobi formats.

You can also read the book in online pages at the .NET docs here: https://docs.microsoft.com/dotnet/architecture/modern-web-apps-azure/

The eShopOnWeb sample is related to the 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.

The goal for this sample is to demonstrate some of the principles and patterns described in the eBook. 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.

VERSIONS

The master branch is currently running ASP.NET Core 3.1.

Older versions are tagged.

Topics (eBook TOC)

  • Introduction
  • Characteristics of Modern Web Applications
  • Choosing Between Traditional Web Apps and SPAs
  • Architectural Principles
  • Common Web Application Architectures
  • Common Client Side Technologies
  • Developing ASP.NET Core MVC Apps
  • Working with Data in ASP.NET Core Apps
  • Testing ASP.NET Core MVC Apps
  • Development Process for Azure-Hosted ASP.NET Core Apps
  • Azure Hosting Recommendations for ASP.NET Core Web Apps

Running the sample

After cloning or downloading the sample you should be able to run it using an In Memory database immediately.

If you wish to 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, and update the ConfigureServices method in Startup.cs (see below).

You can also run the samples in Docker (see below).

Configuring the sample to use SQL Server

  1. Update Startup.cs's ConfigureDevelopmentServices method as follows:
        public void ConfigureDevelopmentServices(IServiceCollection services)
        {
            // use in-memory database
            //ConfigureTestingServices(services);

            // use real database
            ConfigureProductionServices(services);

        }
  1. Ensure your connection strings in appsettings.json point to a local SQL Server instance.
  2. Ensure the tool EF was already installed. You can find some help here
dotnet tool install --global dotnet-ef
  1. Open a command prompt in the Web folder and execute the following commands:
dotnet restore
dotnet tool restore
dotnet ef database update -c catalogcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj
dotnet ef database update -c appidentitydbcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj

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.

  1. Run the application.

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 [email protected] account.

Note: If you need to create migrations, you can use these commands:

-- create migration (from Web folder CLI)
dotnet ef migrations add InitialModel --context catalogcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj -o Data/Migrations

dotnet ef migrations add InitialIdentityModel --context appidentitydbcontext -p ../Infrastructure/Infrastructure.csproj -s Web.csproj -o Identity/Migrations

Running the sample using Docker

You can run the Web sample by running these commands from the root folder (where the .sln file is located):

    docker-compose build
    docker-compose up

You should be able to make requests to localhost:5106 once these commands complete.

You can also run the Web application by using the instructions located in its Dockerfile file in the root of the project. Again, run these commands from the root of the solution (where the .sln file is located).

Community Extensions

We have some great contributions from the community, and while these aren't maintained by Microsoft we still want to highlight them.

eShopOnWeb VB.NET by Mohammad Hamdy Ghanem

eshoponweb's People

Contributors

ardalis avatar atp-tha avatar cesardelatorre avatar doggy8088 avatar efleming18 avatar hemantkd avatar hutchcodes avatar jvilimek avatar kmasalski avatar lesair avatar lisabii avatar mairaw avatar matthiee avatar michelcedric avatar moientajik avatar mrukas avatar nemi-chand avatar nishanil avatar nrkirby avatar nudemeth avatar octest avatar rafsanulhasan avatar ratanparai avatar robertsandu avatar saschagottfried avatar superusercode avatar timheuer avatar vermapraveen avatar wkalmar avatar yigith avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.