Skip to content

Showcase of ASP.NET Core Web API and Angular-based SPA using Domain-Driven Design, CQRS, and Event Sourcing.

License

Notifications You must be signed in to change notification settings

ucrengineer/EcommerceDDD

 
 

Repository files navigation

Build License

Welcome to Ecommerce DDD

This project is a showcase of a full-stack application I use to combine several cutting-edge technologies and architectural patterns. It is based on Domain-Driven Design at its core for implementing a clean-architectured API that powers up an Angular-based SPA application.

Thanks for getting here! please give a ⭐ if you liked the project. It motivates me to keep improving it.

Screenshots






Architecture

Domain

This is where the business logic resides, with a structured implementation of the domain through aggregates, entities, value objects, domain services, repository definitions, and domain events.

Domain SeedWork

It defines the domain building blocks, such as entities, value objects, aggregate root, repositories, services and so on.

Application

It orchestrates the interactions between the external world (API/SPA) and the domain. It is concerned with defining the jobs needed to be done to accomplish a certain application task. Since the project is based on CQRS/EventSourcing architecture, it defines and handles commands, queries and events.

Infrastructure

It takes care of the application's infrastructure and issues not related to the business itself. It is responsible for database mapping (ORM), domain repository implementation, identity authentication and user claims, JWT authentication, tooling for processing and publishing messages, Inversion of Control and everything needed to support the upper layers.

Presentation

  • Web API: A restful API providing endpoints with secured routes based on user claims. It also implements and host a Background Service for processing and publishing stored events.
  • SPA: A lightweight Angular-based application providing a functional and user-friendly UI.

Technologies used

  • ASP.NET Core and C# 10 for cross-platform back-end with:
    • .NET 6
    • Entity Framework Core 6
    • ASP.NET Core Web API
    • ASP.NET Core Identity
    • SignalR Core
    • JWT Bearer Authentication
    • MediatR
    • Fluent Validation
    • Automapper
    • NSubstitute
    • Swagger
    • Docker Compose
  • Angular 12 and TypeScript for the front-end with:
    • NgBootstrap
    • Font Awesome
    • Toastr
    • Angular JWT

What do you need to run

Running the WebAPI

Set EcommerceDDD.Api as the Startup project and run

 $ docker-compose up --build

Running the Angular SPA

Using a terminal, navigate to EcommerceDDD.Spa and run for the node packages and serving the SPA on http:https://localhost:4200 respectively:

 $ npm install
 $ ng serve

Notes:

  • The docker-compose.yml is targeting the OS to Linux and setting up the with SQL Server 2019 for Ubuntu
  • When registering your first customer, it will create the database structure automatically. DataSeeder will add some products for you if the Products table is empty.

About

Showcase of ASP.NET Core Web API and Angular-based SPA using Domain-Driven Design, CQRS, and Event Sourcing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • C# 67.5%
  • TypeScript 21.1%
  • HTML 5.8%
  • CSS 3.5%
  • SCSS 1.2%
  • JavaScript 0.5%
  • Dockerfile 0.4%