Coder Social home page Coder Social logo

dsikorska / e-shop-engine Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 7.0 2.12 MB

ASP.NET MVC 5 application. It's my implemntation of e-commerce shop. Only for educational purposes!

C# 40.15% ASP 0.01% CSS 0.12% JavaScript 45.52% HTML 14.20%
aspnet mvc5 sorting paging entity-framework automapper autofac dependency-injection eshop-engine iis

e-shop-engine's Introduction

E-Shop Engine

The application was created for educational purposes. The project implements Repository and Dependency Injection patterns.

It shouldn't be use for any real business. I don't take any reposibility if you decide to use it for real transactions. Before you do it, make sure the application fulfill security standards.

Features

  • Searching / paging / sorting.
  • Category and Subcategory system for Products.
  • Shopping Cart
  • Ordering system
  • Payment system (only dotPay available at the moment)
  • Individual profile creation
  • Profile confirmation system (email unique code)
  • Administrators panel
  • CRUD operations
  • Logging Errors system

Getting Started

Prerequisites

  • .NET Framework 4.7+
  • SQL Server
  • IIS 8.0+

Installation guide

Development

  • Clone / download repo.
  • Run E-Shop-Engine.sln file in VS.
  • In folder E-Shop-Engine.Website/App_Data/app.config set your SMTP credentials.
  • In folder E-Shop-Engine.Website/App_Data/connectionString.config set your connection string.
  • In Package Manager Console run at E-Shop.Engine.Services command: update-database
  • Build and run the solution.
  • Login at default admin account: login: [email protected] password: Qwerty1! You can change it at "Your Account" tab. Do it after you set up your SMTP settings at "Admin Panel" - the step below.
  • Go to "Admin Panel" and at tab Settings update data for your needs.

Application errors are logging in App_Data/logs.

Built With

  • .NET Framework 4.7
  • ASP.NET MVC 5
  • Entity Framework 6
  • ASP.NET Identity 2
  • AutoMapper
  • AutoFac
  • NLog
  • X.PagedList
  • Bootstrap 4
  • jQuery
  • AJAX
  • There is example DotPay payment implemented.

How to implement more payment methods:

  • Go to E-Shop-Engine.Services -> Services -> Payment and create new folder.

  • There are 2 model classes that payment can inherit from: PaymentDetails (intended to send data to external server) and PaymentResponse (intended to receive data from external server).

  • Create interface for service that inherit from IPaymentService. Then create the implementation.

      public class DotPayPaymentService : IDotPayPaymentService
      {
          private static Settings settings;
    
          public DotPayPaymentService(ISettingsRepository settingsRepository)
          {
              settings = settingsRepository.Get();
          } 
      
          // The implementation...
      }
    
  • Now go to E-Shop-Engine.Website -> Controllers -> Payment and create new Controller.

  • The controller should inherit from BasePaymentController.

      public class DotPayController : BasePaymentController
      {
          public DotPayController(
              IOrderRepository orderRepository,
              ICartRepository cartRepository,
              ISettingsRepository settingsRepository,
              IMailingService mailingService,
              IDotPayPaymentService paymentService,
              IAppUserManager userManager,
              IUnitOfWork unitOfWork)
              : base(
                    orderRepository,
                    cartRepository,
                    settingsRepository,
                    mailingService,
                    paymentService,
                    userManager,
                    unitOfWork)
          {
              //
          }
    
  • Register new payment method in AutoFac (E-Shop-Engine.Website -> App_Start -> AutoFacConfig) builder.RegisterType<DotPayPaymentService>().As<IDotPayPaymentService>().InstancePerRequest();

  • Go to Views -> Payment -> Select and add new payment. Remember to set input element value the same as Controller name <div class="custom-control custom-checkbox form-control-lg"> <input type="radio" name="paymentMethod" class="custom-control-input" id="dotpay" value="DotPay"> <label class="custom-control-label" for="dotpay"> <img src="~/Content/payment/dotpay_logo.jpg" class="payment-img" /> </label> </div>

License

This project is licensed under MIT License.

e-shop-engine's People

Contributors

dsikorska avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.