Giter VIP home page Giter VIP logo

ambereggapi's Introduction

Amber Egg Api

This is a starting point (TEMPLATE) for Clean Architecture with ASP.NET Core. Clean Architecture is just the latest in a series of names for the same loosely-coupled, dependency-inverted architecture. You will also find it named hexagonal, ports-and-adapters, or onion architecture.

Summary

This project AmberEggApi cover concepts about:

Learning Path:

DotNetCore

Using .NETCore version 2.2

3rd Party Nuget Packages

  • Autofac
  • AutoMapper
  • FluentAssertiong
  • NUnit
  • Swagger (Swashbuckle)
  • Serilog

Repository

  • MongoDb Drive
  • Mongo2Go (inmemory)

Development Tools

  • Visual Studio (2017 or newer) or Visual Studio Code
  • Azure DevOps ( Backlog and Code Repository)
  • MSSQL Server Management Studio 17
  • Swagger Editor
  • GIT

How to clone this project

cd\
mkdir repo
cd repo
git clone https://github.com/diegosmorf/AmberEggApi.git

Cloning the strucuture using your namespace

powershell .\CopyProject.ps1 "AmberEggApi" "Your.Namespace"
cd ..\Your.Namespace

Restore, Build and Test

dotnet restore
dotnet build
dotnet test


dotnet run --p AmberEggApi.WebApi

you can access this API via browser: http://localhost:5200/swagger

0 - Core

Api.Common.Cqrs.Core is a basic set of interfaces for building a command and event driven CQRS application.

  • Commands are created and dispatched by the application,
  • They are received by command handlers which apply behaviors on the domain model
  • Which generates events
  • Collected by the command handler
  • Then published
  • Received by event handlers which update the read/query model
  • Consumed by the front end of the application via query services.

1 - Domain

Domain commands and handlers specifically affect the domain model's aggregate roots.

Some of the basic premises of CQRS are modeled by these interfaces either explicitly or in their documentation.

  • Commands and events should be immutable
  • The query model should be immutable, except from the event handlers responsible for updating them when triggered by events published from domain model changes
  • Domain commands and handlers should only affect a single aggregate root instance in the domain model - more complex operations should be handled by sagas

2 - Application Service

This project will expose domain features to external world (e.g.: apis, apps, windows services, desktop apps) and it is responsible for business rules as well.

3 - Infrastructure

This project contains implementations of the interfaces defined in the inner layers of the solution. They may be dependent on external libraries or resources. Note that the implementations themselves are internal and should only be used for injection via their implemented interfaces.

4 - Entry Points

API project.

5 - Tests

DomainTest: NUnit will test ApplicationService classes with no external dependencies. All Infrastructure dependencies must be mocked.

IntegrationTests:Longer running, more involved tests that test the integration of multiple components and external dependencies as Database/Email.

AcceptanceTests: SpecFlow acceptance tests project (may modify data, so are meant to run in non-production environments)

You shouldn't find:

  • Binaries committed to source control.
  • Unnecessary project or library references or third party frameworks.
  • Many "try" blocks - code defensively and throw exceptions if something is wrong.
  • Third party APIs exposed via public interfaces.

ambereggapi's People

Contributors

diegodocs 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.