项目作者: maikeulb

项目描述 :
E-commerce application
高级语言: C#
项目地址: git://github.com/maikeulb/RolleiShop.git
创建时间: 2017-12-10T22:11:30Z
项目社区:https://github.com/maikeulb/RolleiShop

开源协议:

下载


RolleiShop

E-commerce application where users may browse the catalog, manage their
shopping cart, submit orders (dummy or through stripe), and browse through
their order history. Admin users may manage the catalog (add and edit catalog
items). Features include distributed caching for the catalog items (via Redis),
in-memory catching for the catalog types and brands, localization, server-side
filtering (via specification pattern), and emails (via MailKit).

Architecture is vertically sliced, CQRS, with a rich, encapsulated
domain1 (private collections and setters) with domain notifications
(for sending emails and product price changes) to explicitly implement side
effects. The application IO is fully-asynchronous and the errors are handled
with command results (similar to F#’s Option Type or Haskell’s Maybe monad).

  1. The only exception to this (as far as I’m aware) is the ApplicationUser
    class which references Identity Framework.

Technology

  • ASP.NET Core 2.0
  • PostgreSQL
  • Redis
  • Identity 2.0
  • Entity Framework Core 2.0
  • MediatR
  • FluentValidation
  • NLog
  • CSharpFunctionalExtensions
  • Semantic UI
  • Stripe API
  • Noty
  • Rellax
  • Google Maps API

Screenshots

Index

The index and layout templates are translated to Japanese thanks to Google
translate (Most likely not too accurate).
index


japanese

Catalog

Filter catalog-items by brand and/or format.
catalog

Cart

Displays cart items with the abilities to update, clear, and checkout.
Checking out the cart publishes a domain notification to send customer emails.
cart


mail

Orders - Details

Displays your detailed order history.
order

Admin

Admin users may manage the catalog (and inventory). Updating the product price publishes
a domain notification to reflect the price change in the customer’s cart.
admin


add

Run

With docker:

  1. docker-compose build
  2. docker-compose up
  3. Go to http://localhost:5000

Alternatively, you will need .NET Core 2.0 SDK. If you have the SDK installed,
then open appsettings.Development.json and point the connection strings to
your PostgreSQL and Redis servers. Install the javascript dependencies (e.g.
npm install). You may optionally fill out the credentials for the mail
server.

cd into ./src/RolleiShop (if you are not already); then run:

  1. webpack build
  2. dotnet restore
  3. dotnet ef database update -c ApplicationDbContext
  4. dotnet ef database update -c IdentityDbContext
  5. dotnet run
  6. Go to http://localhost:5000

Deploy (Dockerized hosts)

This process is more thoroughly explained
here,
but I’ll summarize the steps required (mostly for my own reference).

Prerequisites: Docker Machine installed on your local machine and DigitalOcean
API token.

  1. Create Dockerized hos
    1. docker-machine create --driver digitalocean --digitalocean-access-token
    2. $DOTOKEN machine-name
  2. Activate Dockerized host
    1. eval (docker-machine env machine-name)
  3. Build and run containers
    1. docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
    2. docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
  4. Unset Dockerized host
    1. eval (docker-machine env -u)

NOTE

The resources I use to create this project were plentiful, coming from several
projects and tutorials provided by Microsoft (mostly eShopOnWeb,
eShopOnContainers, MVCMusicStore, and ContosoUniversity), Pluralsight, Jimmy
Bogards Contoso University remake, and several blogs.

TODO

configure webpack (for production)
Add more unit tests
Add Serverside sorting by price
Fix AJAX remove cart-items (low priority)