# nagavjm/notifyflow architecture

> Architecture diagram of the GitHub repository nagavjm/notifyflow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagavjm/notifyflow
- Repository: https://github.com/nagavjm/notifyflow

## Overview

NotifyFlow is an event-driven notification platform with an Angular admin UI, an Ocelot gateway, employee/product/ticket microservices, and a separate email-delivery service. Admin requests enter through the UI and gateway; business services manage their own records and, as documented, publish email requests through an outbox to Service Bus. The email worker consumes requests, renders templates, applies quota controls, sends through an email provider, and supports webhooks and reconciliation. Several subsystem links are based on README descriptions because their implementation files were not excerpted.

Main entry points: [`src/ApiGateway/NotifyFlow.ApiGateway/Program.cs`](https://github.com/nagavjm/notifyflow/blob/main/src/ApiGateway/NotifyFlow.ApiGateway/Program.cs) (API gateway), [`src/Frontend/notifyflow-admin/src/app/app.component.ts`](https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/app.component.ts) (Admin application), [`src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/IdempotentEmailEventHandler.cs`](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/IdempotentEmailEventHandler.cs) (Email processing), [`src/Shared/NotifyFlow.Common/Outbox/OutboxProcessor.cs`](https://github.com/nagavjm/notifyflow/blob/main/src/Shared/NotifyFlow.Common/Outbox/OutboxProcessor.cs) (Transactional outbox)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Admin UI"]
  node_admin_app["Admin application<br/>[app.component.ts]"]
  node_admin_auth["Login and auth<br/>[auth.service.ts]"]
  node_admin_routes["Admin pages<br/>[app.routes.ts]"]
end

subgraph group_gateway["Gateway"]
  node_gateway_app["API gateway<br/>[Program.cs]"]
  node_gateway_auth["Gateway auth<br/>[AuthController.cs]"]
end

subgraph group_business["Business services"]
  node_employee_api["Employee API"]
  node_employee_logic["Employee operations"]
  node_employee_store[("Employee data")]
  node_product_api["Product API"]
  node_product_logic["Product operations"]
  node_product_store[("Product data")]
  node_ticket_api["Ticket API"]
  node_ticket_logic["Ticket operations"]
  node_ticket_store[("Ticket data")]
end

subgraph group_messaging["Messaging"]
  node_outbox["Transactional outbox<br/>[OutboxProcessor.cs]"]
  node_bus_transport["Topic transport"]
  node_service_bus["Azure Service Bus"]
end

subgraph group_email["Email delivery"]
  node_email_worker["Email worker"]
  node_email_pipeline["Email processing"]
  node_template_engine["Template rendering"]
  node_quota["Quota monitor"]
  node_provider["Email provider"]
  node_brevo["Brevo API"]
  node_email_api["Email admin API"]
  node_email_query["Email history queries"]
  node_email_db[("Email database<br/>[EmailDbContext.cs]")]
  node_webhooks_reconcile["Webhooks and reconciliation"]
  node_dlq["Dead-letter handling"]
end

node_admin_user(("Admin user"))

node_admin_user -->|"uses"| node_admin_app
node_admin_app -->|"uses auth"| node_admin_auth
node_admin_app -->|"renders routes"| node_admin_routes
node_admin_auth -->|"posts login"| node_gateway_auth
node_admin_app -->|"calls gateway"| node_gateway_app
node_gateway_app -->|"routes auth"| node_gateway_auth
node_gateway_app -->|"routes requests"| node_employee_api
node_gateway_app -->|"routes requests"| node_product_api
node_gateway_app -->|"routes requests"| node_ticket_api
node_gateway_app -.->|"routes requests"| node_email_api
node_employee_api -->|"calls"| node_employee_logic
node_employee_logic -.->|"persists records"| node_employee_store
node_product_api -.->|"delegates"| node_product_logic
node_product_logic -.->|"persists records"| node_product_store
node_ticket_api -.->|"delegates"| node_ticket_logic
node_ticket_logic -.->|"persists records"| node_ticket_store
node_employee_logic -.->|"records events"| node_outbox
node_product_logic -.->|"records events"| node_outbox
node_ticket_logic -.->|"records events"| node_outbox
node_outbox -->|"publishes via"| node_bus_transport
node_bus_transport -->|"publishes events"| node_service_bus
node_service_bus -.->|"delivers events"| node_email_worker
node_email_worker -.->|"dispatches"| node_email_pipeline
node_email_pipeline -.->|"renders templates"| node_template_engine
node_email_pipeline -.->|"checks quota"| node_quota
node_email_pipeline -.->|"sends email"| node_provider
node_provider -.->|"calls provider"| node_brevo
node_email_api -.->|"queries history"| node_email_query
node_email_query -->|"reads records"| node_email_db
node_webhooks_reconcile -.->|"receives webhooks"| node_brevo
node_email_worker -.->|"handles failures"| node_dlq

click node_admin_app "https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/app.component.ts"
click node_admin_auth "https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/core/services/auth.service.ts"
click node_admin_routes "https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/app.routes.ts"
click node_gateway_app "https://github.com/nagavjm/notifyflow/blob/main/src/ApiGateway/NotifyFlow.ApiGateway/Program.cs"
click node_gateway_auth "https://github.com/nagavjm/notifyflow/blob/main/src/ApiGateway/NotifyFlow.ApiGateway/Controllers/AuthController.cs"
click node_employee_api "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.API/Controllers/EmployeesController.cs"
click node_employee_logic "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.Application/Services/EmployeeServiceImpl.cs"
click node_employee_store "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.Infrastructure/Persistence/EfEmployeeRepository.cs"
click node_product_api "https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.API/Controllers/ProductsController.cs"
click node_product_logic "https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.Application/Services/ProductServiceImpl.cs"
click node_product_store "https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.Infrastructure/Persistence/EfProductRepository.cs"
click node_ticket_api "https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.API/Controllers/TicketsController.cs"
click node_ticket_logic "https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.Application/Services/TicketServiceImpl.cs"
click node_ticket_store "https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.Infrastructure/Persistence/EfTicketRepository.cs"
click node_outbox "https://github.com/nagavjm/notifyflow/blob/main/src/Shared/NotifyFlow.Common/Outbox/OutboxProcessor.cs"
click node_bus_transport "https://github.com/nagavjm/notifyflow/blob/main/src/Shared/NotifyFlow.Common/Messaging/ServiceBusTopicMessageTransport.cs"
click node_email_worker "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Worker/Workers/ServiceBusEmailConsumerWorker.cs"
click node_email_pipeline "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/IdempotentEmailEventHandler.cs"
click node_template_engine "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Templates/ScribanTemplateEngine.cs"
click node_quota "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Quota/ProviderQuotaMonitor.cs"
click node_provider "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Providers/BrevoEmailProvider.cs"
click node_email_api "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.API/Controllers/EmailsController.cs"
click node_email_query "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Services/EmailQueryService.cs"
click node_email_db "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Persistence/EmailDbContext.cs"
click node_webhooks_reconcile "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Worker/Workers/WebhookAndReconciliationBackgroundService.cs"
click node_dlq "https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/ServiceBusDlqService.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_admin_app,node_admin_auth,node_admin_routes,node_admin_user toneBlue
class node_gateway_app,node_gateway_auth toneAmber
class node_employee_api,node_employee_logic,node_employee_store,node_product_api,node_product_logic,node_product_store,node_ticket_api,node_ticket_logic,node_ticket_store toneMint
class node_outbox,node_bus_transport,node_service_bus toneRose
class node_email_worker,node_email_pipeline,node_template_engine,node_quota,node_provider,node_brevo,node_email_api,node_email_query,node_email_db,node_webhooks_reconcile,node_dlq toneIndigo
```

## Components

### Admin UI

- [Admin application](https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/app.component.ts): `src/Frontend/notifyflow-admin/src/app/app.component.ts`
- [Login and auth](https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/core/services/auth.service.ts): `src/Frontend/notifyflow-admin/src/app/core/services/auth.service.ts`
- [Admin pages](https://github.com/nagavjm/notifyflow/blob/main/src/Frontend/notifyflow-admin/src/app/app.routes.ts): `src/Frontend/notifyflow-admin/src/app/app.routes.ts`

### Gateway

- [API gateway](https://github.com/nagavjm/notifyflow/blob/main/src/ApiGateway/NotifyFlow.ApiGateway/Program.cs): `src/ApiGateway/NotifyFlow.ApiGateway/Program.cs`
- [Gateway auth](https://github.com/nagavjm/notifyflow/blob/main/src/ApiGateway/NotifyFlow.ApiGateway/Controllers/AuthController.cs): `src/ApiGateway/NotifyFlow.ApiGateway/Controllers/AuthController.cs`

### Business services

- [Employee API](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.API/Controllers/EmployeesController.cs): `src/Services/EmployeeService/NotifyFlow.Employee.API/Controllers/EmployeesController.cs`
- [Employee operations](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.Application/Services/EmployeeServiceImpl.cs): `src/Services/EmployeeService/NotifyFlow.Employee.Application/Services/EmployeeServiceImpl.cs`
- [Employee data](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmployeeService/NotifyFlow.Employee.Infrastructure/Persistence/EfEmployeeRepository.cs): `src/Services/EmployeeService/NotifyFlow.Employee.Infrastructure/Persistence/EfEmployeeRepository.cs`
- [Product API](https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.API/Controllers/ProductsController.cs): `src/Services/ProductService/NotifyFlow.Product.API/Controllers/ProductsController.cs`
- [Product operations](https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.Application/Services/ProductServiceImpl.cs): `src/Services/ProductService/NotifyFlow.Product.Application/Services/ProductServiceImpl.cs`
- [Product data](https://github.com/nagavjm/notifyflow/blob/main/src/Services/ProductService/NotifyFlow.Product.Infrastructure/Persistence/EfProductRepository.cs): `src/Services/ProductService/NotifyFlow.Product.Infrastructure/Persistence/EfProductRepository.cs`
- [Ticket API](https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.API/Controllers/TicketsController.cs): `src/Services/TicketService/NotifyFlow.Ticket.API/Controllers/TicketsController.cs`
- [Ticket operations](https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.Application/Services/TicketServiceImpl.cs): `src/Services/TicketService/NotifyFlow.Ticket.Application/Services/TicketServiceImpl.cs`
- [Ticket data](https://github.com/nagavjm/notifyflow/blob/main/src/Services/TicketService/NotifyFlow.Ticket.Infrastructure/Persistence/EfTicketRepository.cs): `src/Services/TicketService/NotifyFlow.Ticket.Infrastructure/Persistence/EfTicketRepository.cs`

### Messaging

- [Transactional outbox](https://github.com/nagavjm/notifyflow/blob/main/src/Shared/NotifyFlow.Common/Outbox/OutboxProcessor.cs): `src/Shared/NotifyFlow.Common/Outbox/OutboxProcessor.cs`
- [Topic transport](https://github.com/nagavjm/notifyflow/blob/main/src/Shared/NotifyFlow.Common/Messaging/ServiceBusTopicMessageTransport.cs): `src/Shared/NotifyFlow.Common/Messaging/ServiceBusTopicMessageTransport.cs`
- **Azure Service Bus**

### Email delivery

- [Email worker](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Worker/Workers/ServiceBusEmailConsumerWorker.cs): `src/Services/EmailService/NotifyFlow.Email.Worker/Workers/ServiceBusEmailConsumerWorker.cs`
- [Email processing](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/IdempotentEmailEventHandler.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/IdempotentEmailEventHandler.cs`
- [Template rendering](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Templates/ScribanTemplateEngine.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Templates/ScribanTemplateEngine.cs`
- [Quota monitor](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Quota/ProviderQuotaMonitor.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Quota/ProviderQuotaMonitor.cs`
- [Email provider](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Providers/BrevoEmailProvider.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Providers/BrevoEmailProvider.cs`
- **Brevo API**
- [Email admin API](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.API/Controllers/EmailsController.cs): `src/Services/EmailService/NotifyFlow.Email.API/Controllers/EmailsController.cs`
- [Email history queries](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Services/EmailQueryService.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Services/EmailQueryService.cs`
- [Email database](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Persistence/EmailDbContext.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Persistence/EmailDbContext.cs`
- [Webhooks and reconciliation](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Worker/Workers/WebhookAndReconciliationBackgroundService.cs): `src/Services/EmailService/NotifyFlow.Email.Worker/Workers/WebhookAndReconciliationBackgroundService.cs`
- [Dead-letter handling](https://github.com/nagavjm/notifyflow/blob/main/src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/ServiceBusDlqService.cs): `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Messaging/ServiceBusDlqService.cs`

### Other components

- **Admin user**

## Connections

- Admin user → Admin application: uses (evidence: `README.md`)
- Admin application → Login and auth: uses auth (evidence: `src/Frontend/notifyflow-admin/src/app/app.component.ts`)
- Admin application → Admin pages: renders routes (evidence: `src/Frontend/notifyflow-admin/src/app/app.routes.ts`)
- Login and auth → Gateway auth: posts login (evidence: `src/Frontend/notifyflow-admin/src/app/core/services/auth.service.ts`)
- Admin application → API gateway: calls gateway (evidence: `README.md`)
- API gateway → Gateway auth: routes auth (evidence: `src/ApiGateway/NotifyFlow.ApiGateway/Program.cs`)
- API gateway → Employee API: routes requests (evidence: `README.md`)
- API gateway → Product API: routes requests (evidence: `README.md`)
- API gateway → Ticket API: routes requests (evidence: `README.md`)
- API gateway → Email admin API: routes requests
- Employee API → Employee operations: calls (evidence: `src/Services/EmployeeService/NotifyFlow.Employee.API/Controllers/EmployeesController.cs`)
- Employee operations → Employee data: persists records
- Product API → Product operations: delegates
- Product operations → Product data: persists records
- Ticket API → Ticket operations: delegates
- Ticket operations → Ticket data: persists records
- Employee operations → Transactional outbox: records events (evidence: `README.md`)
- Product operations → Transactional outbox: records events (evidence: `README.md`)
- Ticket operations → Transactional outbox: records events (evidence: `README.md`)
- Transactional outbox → Topic transport: publishes via
- Topic transport → Azure Service Bus: publishes events (evidence: `src/Shared/NotifyFlow.Common/Messaging/ServiceBusTopicMessageTransport.cs`)
- Azure Service Bus → Email worker: delivers events (evidence: `README.md`)
- Email worker → Email processing: dispatches (evidence: `README.md`)
- Email processing → Template rendering: renders templates (evidence: `README.md`)
- Email processing → Quota monitor: checks quota (evidence: `README.md`)
- Email processing → Email provider: sends email (evidence: `README.md`)
- Email provider → Brevo API: calls provider (evidence: `README.md`)
- Email admin API → Email history queries: queries history
- Email history queries → Email database: reads records (evidence: `src/Services/EmailService/NotifyFlow.Email.Infrastructure/Services/EmailQueryService.cs`)
- Webhooks and reconciliation → Brevo API: receives webhooks (evidence: `README.md`)
- Email worker → Dead-letter handling: handles failures (evidence: `README.md`)
