Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .context/docs/tooling.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

## Database tooling
- **RavenDB Management Studio**: Accessible at `http://localhost:8080` for local dev.
- **Docker & Docker Compose**: Used to orchestrate the local database environment (RavenDB and RabbitMQ).
- **Docker & Docker Compose**: Optional, for local services.

## Messaging & Email
- **CloudAMQP**: Managed RabbitMQ for production messaging.
- **RabbitMQ (Local)**: Runs via Docker for development.
- **SendGrid**: Transactional email service for production.
## Email
- **Resend**: Transactional email service for production.
- **Mailtrap**: SMTP sandbox for testing emails in development without sending real messages.

17 changes: 0 additions & 17 deletions ClientManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientManager.Api.Tests", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientManager.Domain.Tests", "tests\ClientManager.Domain.Tests\ClientManager.Domain.Tests.csproj", "{A88C2EB6-8A7B-4B04-A94E-44E91429F604}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientManager.Infrastructure.Messaging", "src\ClientManager.Infrastructure.Messaging\ClientManager.Infrastructure.Messaging.csproj", "{07AF7C49-BC46-4B46-8C0F-209B11E3E219}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -159,18 +155,6 @@ Global
{A88C2EB6-8A7B-4B04-A94E-44E91429F604}.Release|x64.Build.0 = Release|Any CPU
{A88C2EB6-8A7B-4B04-A94E-44E91429F604}.Release|x86.ActiveCfg = Release|Any CPU
{A88C2EB6-8A7B-4B04-A94E-44E91429F604}.Release|x86.Build.0 = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|x64.ActiveCfg = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|x64.Build.0 = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|x86.ActiveCfg = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Debug|x86.Build.0 = Debug|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|Any CPU.Build.0 = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|x64.ActiveCfg = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|x64.Build.0 = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|x86.ActiveCfg = Release|Any CPU
{07AF7C49-BC46-4B46-8C0F-209B11E3E219}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -180,7 +164,6 @@ Global
{362A9030-55F9-429F-8314-B4712F534B21} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{98846CF7-5D38-4F51-B716-5CEC4C79C3F3} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{A88C2EB6-8A7B-4B04-A94E-44E91429F604} = {0AB3BF05-4346-4AA6-1389-037BE0695223}
{07AF7C49-BC46-4B46-8C0F-209B11E3E219} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {367C61BC-A677-42E5-B2AD-79754550DF13}
Expand Down
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A REST API for managing customers and their documents, built with .NET 9 followi
- **Soft Delete** on all main entities
- **Client verification status** (Verified, Attention, Pending) based on documents
- **Multi-profile support** for PF (individual) and PJ (company)
- **Asynchronous email notifications** via RabbitMQ + Resend (production) or Mailtrap (development)
- **Email notifications** via Resend (production) or Mailtrap (development)
- **Code quality infrastructure** with centralized build configuration and analyzers
- **Comprehensive unit tests** (114 tests, 0 failures)

Expand All @@ -30,8 +30,7 @@ ClientManager/
│ ├── ClientManager.Api/ # Entry layer (Controllers, Middlewares, DI)
│ ├── ClientManager.Application/ # Business orchestration (DTOs, FluentValidation, Mappers)
│ ├── ClientManager.Domain/ # Rich Domain Model (Entities, Interfaces, Rules)
│ ├── ClientManager.Infrastructure/ # Technical details (RavenDB, JWT, Email, RabbitMQ)
│ └── ClientManager.Infrastructure.Messaging/ # RabbitMQ messaging layer
│ └── ClientManager.Infrastructure/ # Technical details (RavenDB, JWT, Email, PDF)
└── tests/
├── ClientManager.Domain.Tests/
├── ClientManager.Application.Tests/
Expand Down Expand Up @@ -59,8 +58,7 @@ ClientManager/
| Authentication | JWT (JSON Web Token) |
| Authorization | Role-based (Admin, Manager, Viewer) |
| Password Hashing | BCrypt |
| Messaging | [RabbitMQ](https://www.rabbitmq.com/) (CloudAMQP in production) |
| Email | Resend (production) / Mailtrap (development) |
| Email | [Resend](https://resend.com/) (production) / Mailtrap (development) |
| Testing | xUnit, Moq, FluentAssertions |
| Code Quality | .editorconfig, Directory.Build.props, NetAnalyzers |
| CI/CD | GitHub Actions |
Expand All @@ -73,23 +71,17 @@ ClientManager/
### Prerequisites

- [.NET 9 SDK](https://dotnet.microsoft.com/download/dotnet/9.0)
- [Docker Desktop](https://www.docker.com/) (for local RabbitMQ)
- [Docker Desktop](https://www.docker.com/) (optional, for local services)
- RavenDB instance (local Docker or cloud)

### 1. Start Local Services

```bash
# Start RabbitMQ for development
docker-compose up -d
```

### 2. Configure Environment

Set up user secrets for development:

```bash
# In src/ClientManager.Api directory
dotnet user-secrets set "ConnectionStrings:RabbitMQ" "amqp://guest:guest@localhost:5672"
dotnet user-secrets set "Smtp:Username" "your_mailtrap_username"
dotnet user-secrets set "Smtp:Password" "your_mailtrap_password"

Expand Down Expand Up @@ -183,9 +175,8 @@ For production deployment (Render):
```bash
# Required environment variables
ConnectionStrings__RavenDB # RavenDB cloud URL
ConnectionStrings__RabbitMQ # CloudAMQP URL
SendGrid__ApiKey # Resend API key
SendGrid__FromEmail # Verified sender email
Resend__ApiKey # Resend API key
Resend__FromEmail # Verified sender email
Jwt__Key # JWT signing key
```

Expand Down
11 changes: 0 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,5 @@ services:
volumes:
- ravendb_data:/opt/RavenDB/Server/RavenData

rabbitmq:
image: rabbitmq:3-management
container_name: clientmanager-mq
restart: unless-stopped
ports:
- "5672:5672" # Porta do Protocolo AMQP
- "15672:15672" # Porta da Interface de Gerenciamento (Management UI)
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest

volumes:
ravendb_data:
7 changes: 2 additions & 5 deletions render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ services:
envVars:
- key: ASPNETCORE_ENVIRONMENT
value: Production
- key: ConnectionStrings__RabbitMQ
sync: false # CloudAMQP URL
# Email: Resend
- key: Resend__ApiKey
sync: false
- key: Resend__FromEmail
sync: false
- key: Resend__FromName
sync: false
# RavenDB

# RavenDB
- key: RavenDbSettings__Url
sync: false
- key: RavenDbSettings__Database
Expand All @@ -27,5 +26,3 @@ services:
sync: false
- key: RavenDbSettings__CertificatePassword
sync: false

# Worker removido - agora roda in-process na API como MessageBusWorker
1 change: 0 additions & 1 deletion src/ClientManager.Api/ClientManager.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<ItemGroup>
<ProjectReference Include="..\ClientManager.Infrastructure\ClientManager.Infrastructure.csproj" />
<ProjectReference Include="..\ClientManager.Infrastructure.Messaging\ClientManager.Infrastructure.Messaging.csproj" />
</ItemGroup>

</Project>
34 changes: 0 additions & 34 deletions src/ClientManager.Api/Consumers/CustomerCreatedConsumer.cs

This file was deleted.

74 changes: 0 additions & 74 deletions src/ClientManager.Api/Consumers/DocumentUploadedConsumer.cs

This file was deleted.

4 changes: 0 additions & 4 deletions src/ClientManager.Api/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ClientManager.Api;
using ClientManager.Api.Consumers;
using ClientManager.Api.Middlewares;
using ClientManager.Api.Workers;
using ClientManager.Infrastructure.Messaging.DependencyInjection;
using Scalar.AspNetCore;
using System.Text.Json.Serialization;

Expand Down Expand Up @@ -56,7 +53,6 @@
builder.Services.AddApplicationServices();
builder.Services.AddValidators();
builder.Services.AddInfrastructureServices(builder.Configuration);
builder.Services.AddMessaging();
builder.Services.AddJwtAuthentication(builder.Configuration);

builder.Services.AddCors(options =>
Expand Down
38 changes: 0 additions & 38 deletions src/ClientManager.Api/Workers/MessageBusWorker.cs

This file was deleted.

4 changes: 1 addition & 3 deletions src/ClientManager.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"RabbitMQ": "amqp://guest:guest@localhost:5672"
},
"ConnectionStrings": {},
"Smtp": {
"Host": "sandbox.smtp.mailtrap.io",
"Port": "2525",
Expand Down
3 changes: 0 additions & 3 deletions src/ClientManager.Api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"RabbitMQ": "amqps://user:password@hostname/vhost"
},
"Resend": {
"ApiKey": "YOUR_RESEND_API_KEY",
"FromEmail": "onboarding@resend.dev",
Expand Down
Loading
Loading