• Stars
    star
    459
  • Rank 95,377 (Top 2 %)
  • Language
    C#
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Hexagonal Architecture service template with DDD, CQRS, TDD and SOLID using .NET Core 2.0. All small features are testable and could be mocked. Adapters could be mocked or exchanged.

Acerola Acerola: Hexagonal Architecture

Acerola latest Docker build Gitter

Acerola is a Service Template for helping you to build evolvable, adaptable and maintainable applications with Hexagonal Architecture. It follows the principles from the Alistair Cockburn blog post. and has a Domain built on Domain-Driven Design. It is easy for you to start your new microservice based on its guidelines and patterns.

Compiling from source

To run Acerola from source, clone this repository to your machine, compile and test it:

git clone https://github.com/ivanpaulovich/acerola.git
cd acerola/source/WebAPI/Acerola.UI
dotnet run

The Architecture

Hexagonal Architecture

Allow an application to equally be driven by users, programs, automated test or batch scripts, and to be developed and tested in isolation from its eventual run-time devices and databases.

As events arrive from the outside world at a port, a technology-specific adapter converts it into a usable procedure call and passes it to the application. The application is blissfully ignorant of the nature of the input device. When the application has something to send out, it sends it out through a port to an adapter, which creates the appropriate signals needed by the receiving technology (human or automated). The application has a semantically sound interaction with the adapters on all sides of it, without actually knowing the nature of the things on the other side of the adapters.

Concept Description
DDD The Use Cases of the Account Balance are the Ubiquitious Language designed in the Domain and Application layers, we use the Eric Evans terms like Entities, Value Object, Aggregates Root and Bounded Context.
TDD From the beginning of the project we developed Unit Tests that helped us to enforce the business rules and to create an application that prevents bugs intead of finding them. We also have more sophisticated tests like Use Case Tests, Mapping Tests and Integration Tests.
SOLID The SOLID principles are all over the the solution. The knowledge of SOLID is not a prerequisite but it is highly recommended.
Entity-Boundary-Interactor (EBI) The goal of EBI architecture is to produce a software implementation agnostic to technology, framework, or database. The result is focus on use cases and input/output.
Microservice We designed the software around the Business Domain, having Continous Delivery and Independent Deployment.
Logging Logging is a detail. We plugged Serilog and configured it to redirect every log message to the file system.
Docker Docker is a detail. It was implemented to help us make a faster and reliable deployment.
MongoDB MongoDB is a detail. You could create new Data Access implementation and setup it with Autofac.
.NET Core 2.0 .NET Core is a detail. Almost everything in this code base could be ported to other versions.
CQRS CQRS is an acronym for Command Query Responsibility Segregation. This pattern allow splitting our conceptual business model into two representations. The main representation resides on the Command Stack, to perform creates, updates and deletions. The display model resides inside the Query stack, where we can build a Query Model that make easier to aggregate information to display to clients and UI.

Flow of Control: The Register Use Case

Flow of Control: Customer Registration

Requirements

Prerequisites Setup

The only one prerequisite to run the Web API is a valid connection string to MongoDB. To help you run it without hard work follow the steps on prerequisites setup page.

Running the latest Docker Build

You can run the Docker container of this project with the following command:

$ docker run -d -p 8000:80 \
	-e modules__2__properties__ConnectionString=mongodb://10.0.75.1:27017 \
	--name acerola \
	ivanpaulovich/acerola:latest

Then navigate to http://localhost:8000/swagger and play with de Swagger.

Live Demo on Azure

Acerola Live Demo on Azure

You can play with the latest build of Acerola.

This source code and website should be used only for learning purposes and all data will be erased weekly.

More Repositories

1

clean-architecture-manga

πŸŒ€ Clean Architecture with .NET6, C#10 and React+Redux. Use cases as central organizing structure, completely testable, decoupled from frameworks
C#
3,951
star
2

dotnet-new-caju

Learn Clean Architecture with .NET Core 3.0 πŸ”₯
C#
250
star
3

FluentMediator

πŸ”€ FluentMediator is an unobtrusive library that allows developers to build custom pipelines for Commands, Queries and Events.
C#
192
star
4

event-sourcing-jambo

An Hexagonal Architecture with DDD + Aggregates + Event Sourcing using .NET Core, Kafka e MongoDB (Blog Engine)
C#
189
star
5

ddd-tdd-rich-domain-model-dojo-kata

DDD patterns implemented following TDD
C#
145
star
6

clean-architecture-webapi-ef-core

❀️ The simplest Clean Architecture demo on how to implement a Web Api using .NET Core and Entity Framework
C#
134
star
7

todo

βœ… Commad-Line Task management with storage on your GitHub πŸ”₯
C#
123
star
8

event-sourcing-castanha

An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
C#
82
star
9

clean-architecture-video-tutorials

Live Streaming and Video Tutorials on Clean Architecture, DDD, TDD using .NET Core every week on Paulovich.NET Youtube channel.
C#
51
star
10

webapi-backgroundworker-rabbitmq

Sample implementation of a WebApi that publishes messages to RabbitMQ and consume them using a BackgroundWorker.
C#
25
star
11

clean-architecture-kata-dojo

⭐ Kata to learn Clean Architecture and Hexagonal Architecture styles, you start with two use cases already implemented and the final solution has six use cases. ⭐
C#
23
star
12

TechTalks

Download the high-resolution slides from my past talks to easy your learning into Clean Architecture.
23
star
13

amora-angular-app

An Angular App with Material Design and client of the Microservices Acerola and Manga
TypeScript
16
star
14

CleanArchitectureVSCodeSnippets

Clean Architecture C# Snippets for Visual Studio Code
TypeScript
10
star
15

mfa

DDD + Aggregates + Event Sourcing com .NET Core, Kafka e MongoDB (School Management)
C#
9
star
16

IdentityServer4Sample

C#
7
star
17

betsson-meetup-ddd-tdd

Building Rich Domain Models with DDD and TDD - Presentation
C#
7
star
18

MrRobot

A programmatically Cleaning Robot that informs the number of places cleaned after each execution.
C#
5
star
19

ivanpaulovich

Tech Lead, Software Engineer, 20+ GitHub projects about Clean Architecture, SOLID, DDD and TDD. Speaker/Streamer. Microsoft rMVP.
4
star
20

software-craftsmanship-study-plan

3
star
21

goat-ecs

Goat-ECS is an Entity-Component System with a friendly API to build objects with dynamic components.
C++
3
star
22

dotfiles

Shell
3
star
23

dotnet-new-on-the-web

Run dotnet new command on demand in an Web App
C#
2
star
24

tdd-practices

Practicing TDD
C#
1
star
25

openhackC4H

Classify Jobs description accordingly to a Natural Language then translate the results into Emoji!
C#
1
star
26

lapland

C#
1
star