Skip to content

API REST ASP.NET Core 8.0 LTS completa com DDD, CQRS e Event Sourcing.

License

Notifications You must be signed in to change notification settings

geovanimelo/AspNetCore-DDD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diagrama

Visão Geral

Arquitetura

Dependências

Dependências do Projeto

Fluxo de código

Repositório e Unidade de Trabalho

Stacks Técnicas

  • ASP.NET Core 8.0 (with .NET 8.0)
  • ASP.NET WebApi Core
  • ASP.NET Identity Core
  • Entity Framework Core
  • .NET Core Native DI
  • AutoMapper
  • FluentValidation
  • MediatR
  • Swagger UI
  • MSSQL
  • xUnit
  • Moq
  • FluentAssertions
  • Polly
  • Refit
  • DbUp
  • NPOI
  • Quartz
  • StyleCop

Design Patterns

  • Domain Driven Design
  • Domain Events
  • Domain Notification
  • CQRS
  • Event Sourcing
  • Unit Of Work
  • Repository & Generic Repository
  • Inversion of Control / Dependency injection
  • ORM
  • Mediator
  • Specification Pattern
  • Options Pattern

Pré-Configuração

  • Config User Secret:

    • Find <user_secrets_id> at DDD.Services.Api.csproj > UserSecretsId (Free to change to any GUID/UUID)
    • Windows: C:\Users\[UserName]\AppData\Roaming\Microsoft\UserSecrets\<user_secrets_id>\secrets.json
    • Linux / macOS: ~/.microsoft/usersecrets/<user_secrets_id>/secrets.json
  • secrets.json for Windows:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=DDD;Trusted_Connection=True;MultipleActiveResultSets=true"
  }
}
  • LocalDB is a packaging mechanism for SQL Server Express Edition, and is only available for Windows, use Microsoft SQL Server or Azure SQL Edge for Linux / macOS

  • secrets.json for Linux / macOS:

{
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=<ip_address>,1433;Initial Catalog=aspnetcore-ddd;User ID=SA;pwd=<YourNewStrong@Passw0rd>;Integrated Security=False;ConnectRetryCount=0;MultipleActiveResultSets=True"
  }
}

Como Executar

  • For Visual Studio: Select profile > Run (F5)
  • For VSCode: Select configuration > Run (F5)
  • For Terminal:
dotnet build Src/DDD.Services.Api/DDD.Services.Api.csproj
dotnet run --project Src/DDD.Services.Api/DDD.Services.Api.csproj --launch-profile Dev
dotnet watch --project Src/DDD.Services.Api/DDD.Services.Api.csproj run

Testando

  • Terminal: dotnet test

Docker

docker build -t aspnetcore-docker-image .
docker run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
docker run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
docker compose up -d
docker compose ps
docker compose stop

Podman

podman build -t aspnetcore-docker-image .
podman run -it --rm -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
podman run -d -p 3000:80 --name aspnetcore-docker-container aspnetcore-docker-image
podman-compose up -d
podman-compose ps
podman-compose stop

Swagger (Apenas Dev env)

Health check (Apenas Staging & Prod env)

Releases

No releases published

Packages

No packages published