https://github.com/geovanimelo/aspnetcore-ddd
API REST ASP.NET Core 8.0 LTS completa com DDD, CQRS e Event Sourcing.
https://github.com/geovanimelo/aspnetcore-ddd
aspnetcore cqrs csharp ddd design-patterns event-sourcing swagger webapi xunit
Last synced: 24 days ago
JSON representation
API REST ASP.NET Core 8.0 LTS completa com DDD, CQRS e Event Sourcing.
- Host: GitHub
- URL: https://github.com/geovanimelo/aspnetcore-ddd
- Owner: geovanimelo
- License: mit
- Created: 2024-09-16T16:58:36.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-09-22T15:45:23.000Z (7 months ago)
- Last Synced: 2025-03-31T02:53:01.737Z (24 days ago)
- Topics: aspnetcore, cqrs, csharp, ddd, design-patterns, event-sourcing, swagger, webapi, xunit
- Language: C#
- Homepage: https://allianceinformatica.com
- Size: 736 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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 `` at `DDD.Services.Api.csproj` > `UserSecretsId` (Free to change to any GUID/UUID)
+ Windows: `C:\Users\[UserName]\AppData\Roaming\Microsoft\UserSecrets\\secrets.json`
+ Linux / macOS: `~/.microsoft/usersecrets//secrets.json`- `secrets.json` for Windows:
```json
{
"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](https://hub.docker.com/_/microsoft-mssql-server) or [Azure SQL Edge](https://hub.docker.com/_/microsoft-azure-sql-edge) for Linux / macOS
- `secrets.json` for Linux / macOS:
```json
{
"ConnectionStrings": {
"DefaultConnection": "Data Source=,1433;Initial Catalog=aspnetcore-ddd;User ID=SA;pwd=;Integrated Security=False;ConnectRetryCount=0;MultipleActiveResultSets=True"
}
}
```# Como Executar
- For Visual Studio: `Select profile > Run (F5)`
- For VSCode: `Select configuration > Run (F5)`
- For Terminal:```bash
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
```sh
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
```- http://localhost:3000/
```bash
docker compose up -d
docker compose ps
docker compose stop
```- http://localhost:80/
# Podman
```bash
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
```- http://localhost:3000/
```bash
podman-compose up -d
podman-compose ps
podman-compose stop
```- http://localhost:80/
# Swagger (Apenas Dev env)
- http://localhost:5000/swagger# Health check (Apenas Staging & Prod env)
- http://localhost:5000/hc-ui
- http://localhost:5000/hc-json