Updated 2/28/2017

Setup

MvcCoffee-Baby.png

SQL Server

Make sure that you have an instance of SQL Server (or SQL Server Express) installed on your machine. To obtain a free copy, visit: http://www.microsoft.com/express/sql/‎ . Download the edition that includes the SQL Server Tools. I recommend using SQL Server Management Studio (SSMS) for managing the Mvc Coffee Shop database.
  1. Create the DB MvcCoffeeShop
  2. Run the SQL table script: MvcCoffeeShop_SQL_Tables.sql
  3. Run the SQL stored procedure script: MvcCoffeeShop_SQL_StoredProcs.sql
  4. Run the populate products table script: MvcCoffeeShop_SQL_Products_Data.sql
  5. Run the populate suppliers table script: MvcCoffeeShop_SQL_Suppliers_Data.sql
  6. Make sure to point Entity Framework to your local instance of SQL

The Membership tables will be automatically created the first time that the application is run.

To access the MVC Coffee Shop web site, Set the MvcCoffeeShop web as the start up project. It should land on this location.
  1. http://localhost:port/home/index

Visual Studio

This project uses the MVC 4 template and requires Visual Studio 2010 or 2012.
Visual Studio 2010 users can download MVC 4 at:
http://www.asp.net/mvc/mvc4

To download the free Express Edition visit:
http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-web

NUnit Framework

Once Visual Studio has been setup, install the NUnit framework via the NuGet Package Manager.
You should now be able to run the project. Please write me if you have any problems. Thank you!

Architecture

The MVC Coffee Shop project uses Model View Control (MVC) pattern for the presentation layer. Entity Framework is used by the Data Access layer to query the underlying database.

MvcCoffeeShop-Architecture.JPG

Site Diagram

SiteDiagram.jpg

Use Case Diagram

The Catalog API and Intranet systems are going to be incorporated later on in the project.
MvcCoffeeShop-UseCase.jpg

Getting Started with MVC

Setting Up Global Scripts and Styles

  1. Global JavaScript and CSS styles are managed under the BundleConfig.cs file. In our suite of applications, this file can be found at the following locations:
    • MvcCoffeeShop/AppStart/BundleConfig.cs
    • MvcCoffeeShopBackOffice/AppStart/BundleConfig
  2. Looking at the code, you will see that we have bundles already defined for common libraries such as Jquery.
  3. These bundles are rendered under the Layout.cshtml global page. Once the bundle references are added, they will be rendered and accessible to all pages. The Layout.cshtml file can be found at the following locations:
    • MvcCoffeeShop/Views/Shared/Layout.cshtml
    • MvcCoffeeShopBackOffice/Views/Shared/Layoutcshtml
  4. When adding new JavaScript libraries, I always recommend using the NuGet Package manager. This will ensure that the libraries are properly installed. To access the NuGet Package Manager in Visual Studio, go to TOOLS --> NuGet Package Manager --> Manage NuGet Packages for Solution.
  5. For more information on this topic visit https://weblogs.asp.net/gunnarpeipman/bundling-and-minifying-in-asp-net-mvc

Last edited Mar 1 at 5:57 AM by iortizvictory, version 73

Comments

No comments yet.