how to open an online store on azure with nopcommerce

17
How to open an online store on Azure with nopCommerce

Upload: boyko-bonev

Post on 22-Jan-2018

1.067 views

Category:

Software


0 download

TRANSCRIPT

Page 1: How to open an online store on Azure with nopCommerce

How to open an online store on Azure with nopCommerce

Page 2: How to open an online store on Azure with nopCommerce

Boyko Stanev11+ years .NET Developer 7+ years SnowboarderCo-founder Nop-Templates.com

Page 3: How to open an online store on Azure with nopCommerce

Bulgarian company founded 4+ years ago – www.Nop-Templates.com

We develop nopCommerce themes and plugins.

25+ themes and 30+ plugins.

Trusted by 4000+ paid customers in 100+ countries.

Team of 15+ people - designers, front-end and web developers.

Page 4: How to open an online store on Azure with nopCommerce

Agenda

What is nopCommerce?

Let's create a nopCommerce store and publish it to Azure

What is the nopCommerce architecture?

What are themes and plugins in nopCommerce?

How to extend nopCommerce with themes and plugins?

Page 5: How to open an online store on Azure with nopCommerce

What is nopCommerce?

The most popular .NET eCommerce platform Won the Best eCommerce for SMB for 2015 1.5M+ downloads 25K+ live stores like Reebok Australia, The North Face, Volvo etc. Based on ASP.NET 4.5 – .NET Framework 4.5.1, MVC5, EF6, SQL Server 2008 or above. Free Open source on GitHub Love it because it always uses the latest technologies and the code is very clean

Page 6: How to open an online store on Azure with nopCommerce

What you need to know about nopCommerce

Managed by a team in Russia – founder Andrei Mazulnitsyn 1.0 released in 2008 – Web Forms (.aspx) 2.0 released in 2011 – MVC, extensible via plugins/themes 3.7 released December 2015 100+ themes and 1000+ plugins 1st nopCommerce conference - October 2015 Amsterdam Will be another conference in October 2016 Amsterdam Will move to ASP.NET vNEXT aka ASP.NET Core for version 4.0 NopCommerce.com – designed by Nop-Templates.com

Page 7: How to open an online store on Azure with nopCommerce

Create and publish a store to Azure

Azure marketplace – just search for “nopCommerce” and follow the wizard

Page 8: How to open an online store on Azure with nopCommerce

Create and publish a store to Azure

Create a store locally and then publish it to Azure from Visual Studio Download nopCommerce source code. Open nopCommerce.sln and run the Nop.Web project to install nopCommerce Point the Azure SQL database Publish the Nop.Web project to Azure Remember to manually upload 2 files from the App_Data folder: InstalledPlugins.txt – it keeps the installed plugins Settings.txt – it keeps the database connection string

Page 9: How to open an online store on Azure with nopCommerce

nopCommerce architecture – 3 layers

ASP.NET MVC – Models, Views and Controllers Jquery included in public store KendoUI included in admin store

Services that return entities

Repositories that access the database Entity Framework

SQL Server 2008 or above

Page 10: How to open an online store on Azure with nopCommerce

nopCommerce presentation layer

Controllers – MVC controllers that inherit either BasePublicController and BaseAdminController Views – .cshtml Razor views that inherit from the WebViewPage that allows some handy features like easy access to resources in the views - @T(“HomePage.Products”) Models – BaseNopModel and BaseNopEntityModel Model mappings from Entities – Automapper Model Validation – Fluent Validation Front End – responsive mobile first, Jquery is included on every page and Kendo UI is included in the administration

Page 11: How to open an online store on Azure with nopCommerce

nopCommerce business layer

Entities – Product, Category, Picture all inherit from the BaseEntity class Services – each service has an interface IProductService, IPictureService etc. IoC and Dependency Injection – Autofac and Autofac.Integration.Mvc - Example IDependencyRegister – allows you to register classes into the IoC container NopEngine – singleton e.g EngineContext.Current.Resolve<IProductService>() Scheduled Tasks – ITask e.g Send Emails, Update Currency Exchange Rates etc. IEventPublisher<T> – call Publish method with the T event data e.g OrderPlacedEvent IConsumer<T> – handles the published events e.g OrderPlacedConsumer : IConsumer<OrderPlacedEvent> Settings – ISettings interface e.g MediaSettings Localized Resources – Key/Value - “homepage.products” / “Featured Products”

Page 12: How to open an online store on Azure with nopCommerce

nopCommerce data layer

Repositories – IRepository<T> where T : BaseEntity EF - EfRepository<T> : IRepository<T> where T : BaseEntity EfRepository – has a dependency to IDbContext Uses fluent code API to customize the persistence mapping - Example

Page 13: How to open an online store on Azure with nopCommerce

nopCommerce projects

NopCommerce.sln – the nopCommerce solution Libraries – Core, Data and Services Plugins – all the default plugins Tests – all the tests Presentation – Framework, Admin and Web Nop.Web is the actual website and should be your StartUp project

Page 14: How to open an online store on Azure with nopCommerce

nopCommerce Themes

Used to isolate any changes from the default views ThemeableViewEngine – first searches in the Themes/CurrentTheme/Views folder and then in the default Views folder. Help for smoother upgrades Beautiful themes Demo – Create our own theme

Page 15: How to open an online store on Azure with nopCommerce

nopCommerce Plugins

Use to isolate the changes in the source code IPlugin, IWidgetPlugin, IAdminMenuPlugin BasePlugin IPaymentMethod, IShippingRateComputationMethod, ITaxProvider PreApplicationStartMethod assembly attribute PluginManager – loads all plugins in the AppDomain IRouteProvider – allows the plugins to register their own routes Demo – Create our own plugin

Page 16: How to open an online store on Azure with nopCommerce

Contribute to nopCommerce

Open Source is a great way to learn https://github.com/nopSolutions/nopCommerce Master branch is the latest stable version Develop branch is the work in progress

Page 17: How to open an online store on Azure with nopCommerce