How aminbagherinezhad/clean-architecture works
This is a notification API with endpoints to set the default channel, send notifications, and retrieve history. Requests enter through the controller; the application service selects a sender, persists notification state, and returns DTOs. The graph also shows configuration and history operations, plus the repository/database and channel-sender layers. Relationships are based on the controller, service, repository, context, and dependency-registration excerpts or SOURCE INDEX references; unsampled startup wiring and sender internals are not inferred.
Main entry points: NotificationService.cs Notification service · DependencyInjection.cs Infrastructure registration · NotificationController.cs Notification endpoints · NotificationRepository.cs Notification repository
Components 16
API
- Notification endpoints
Notification.Api/Controllers/NotificationController.cs
Application
- Notification service
Notification.Application/Services/NotificationService.cs - Send request
Notification.Application/DTOs/SendNotificationRequest.cs - Notification DTO
Notification.Application/DTOs/NotificationDto.cs - Service contract
Notification.Application/Interfaces/INotificationService.cs - Repository contract
Notification.Application/Interfaces/INotificationRepository.cs - Sender contract
Notification.Application/Interfaces/INotificationSender.cs
Domain
- Notification record
Notification.Domain/Entities/Notification.cs - Channel configuration
Notification.Domain/Entities/NotificationConfig.cs
Infrastructure
- Notification repository
Notification.Infrastructure/Repositories/NotificationRepository.cs - Database context
Notification.Infrastructure/Data/AppDbContext.cs - PostgreSQL database
- Email sender
Notification.Infrastructure/NotificationSenders/EmailNotificationSender.cs - SMS sender
Notification.Infrastructure/NotificationSenders/SmsNotificationSender.cs - Infrastructure registration
Notification.Infrastructure/Extensions/DependencyInjection.cs
Other components
- API client
Connections 15
- API client → Notification endpoints: calls endpoints
Notification.Api/Controllers/NotificationController.cs - Notification endpoints → Notification service: delegates requests
Notification.Api/Controllers/NotificationController.cs - Notification endpoints → Send request: accepts
Notification.Api/Controllers/NotificationController.cs - Notification service → Send request: reads
Notification.Application/Services/NotificationService.cs - Notification service → Notification DTO: creates
Notification.Application/Services/NotificationService.cs - Notification service → Notification record: creates and updates
Notification.Application/Services/NotificationService.cs - Notification service → Channel configuration: reads and sets
Notification.Application/Services/NotificationService.cs - Notification service → Notification repository: loads and saves
Notification.Application/Services/NotificationService.cs - Notification service → Email sender: dispatches by type
Notification.Application/Services/NotificationService.cs - Notification service → SMS sender: dispatches by type
Notification.Application/Services/NotificationService.cs - Notification repository → Database context: queries and updates
Notification.Infrastructure/Repositories/NotificationRepository.cs - Database context → PostgreSQL database: persists entities
- Infrastructure registration → Notification repository: registers implementation
Notification.Infrastructure/Extensions/DependencyInjection.cs - Infrastructure registration → Email sender: registers sender
Notification.Infrastructure/Extensions/DependencyInjection.cs - Infrastructure registration → SMS sender: registers sender
Notification.Infrastructure/Extensions/DependencyInjection.cs