E-commerce application
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).
The index and layout templates are translated to Japanese thanks to Google
translate (Most likely not too accurate).
Filter catalog-items by brand and/or format.
Displays cart items with the abilities to update, clear, and checkout.
Checking out the cart publishes a domain notification to send customer emails.
Displays your detailed order history.
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.
With docker:
docker-compose build
docker-compose up
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:
webpack build
dotnet restore
dotnet ef database update -c ApplicationDbContext
dotnet ef database update -c IdentityDbContext
dotnet run
Go to http://localhost:5000
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.
docker-machine create --driver digitalocean --digitalocean-access-token
$DOTOKEN machine-name
eval (docker-machine env machine-name)
docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
eval (docker-machine env -u)
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.
configure webpack (for production)
Add more unit tests
Add Serverside sorting by price
Fix AJAX remove cart-items (low priority)