Giter Site home page Giter Site logo

filipefelice / event-sourcing-castanha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ivanpaulovich/event-sourcing-castanha

0.0 1.0 0.0 6.36 MB

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.

Home Page: http://paulovich.net/castanha/

Shell 0.81% C# 99.19%

event-sourcing-castanha's Introduction

Castanha

Castanha latest Docker build Gitter

Castanha is a Service Template for helping you to build evolvable, adaptable and maintainable Event Sourcing applications. It follows the principles from the Clean Architecture book 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 Castanha from source, clone this repository to your machine, compile and test it:

git clone https://github.com/ivanpaulovich/castanha.git
cd castanha/source/WebAPI/Castanha.UI
dotnet run

The Clean Architecture

The implementation result of the Clean Architecture is a software that encapsulate Business Rules in Use Cases and the Enterprise Rules in Entities. Also the Use Cases are independent from details like User Interface, Data Access, Web Server or any external agency.

Clean Architecture by Uncle Bob

The Clean Architecture Diagram by Uncle Bob.

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.

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 castanha \
	ivanpaulovich/castanha:latest

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

Live Demo on Azure

Castanha Live Demo on Azure

You can play with the latest build of Castanha.

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

event-sourcing-castanha's People

Contributors

ivanpaulovich avatar

Watchers

James Cloos 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.