# yashx37/notifyr architecture

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

- Interactive diagram: https://gitdiagram.com/yashx37/notifyr
- Repository: https://github.com/yashx37/notifyr

## Overview

Notifyr is a Spring Boot bulk-notification platform. Clients manage recipients, templates and campaigns or submit individual notifications; campaigns are scheduled and dispatched asynchronously, then workers route deliveries by channel and retry failures. The graph captures documented RabbitMQ, Redis, storage, security and monitoring capabilities. Most runtime wiring was not excerpted, so undocumented relationships are omitted or marked unverified.

Main entry points: [`src/main/java/com/yash/Notifyr/controller`](https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/controller) (REST controllers), [`src/main/java/com/yash/Notifyr/service/CampaignService.java`](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/CampaignService.java) (Campaign engine), [`src/main/java/com/yash/Notifyr/worker/NotificationWorker.java`](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/worker/NotificationWorker.java) (Notification worker), [`src/main/java/com/yash/Notifyr/service/NotificationService.java`](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/NotificationService.java) (Notification service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and security"]
  node_controllers["REST controllers"]
  node_auth["Authentication<br/>[AuthService.java]"]
  node_security["JWT and API-key filters"]
end

subgraph group_domain["Campaign and content"]
  node_recipients["Recipient management"]
  node_templates["Template management"]
  node_campaigns["Campaign engine"]
end

subgraph group_delivery["Async delivery"]
  node_scheduling["Campaign scheduling"]
  node_dispatch_worker["Dispatch worker"]
  node_notifications["Notification service"]
  node_publisher["Notification publisher"]
  node_worker["Notification worker"]
  node_providers["Channel providers"]
  node_rabbit["RabbitMQ queues"]
  node_retry["Retry and dead-letter queues"]
end

subgraph group_platform["Persistence and operations"]
  node_database[("PostgreSQL data")]
  node_redis[("Redis idempotency")]
  node_reconciliation["Status reconciliation"]
  node_monitoring["Metrics and dashboards"]
end

node_client(("API client"))
node_email["Email service"]
node_sms["SMS service"]
node_push["Push simulation"]

node_client -->|"calls REST"| node_controllers
node_controllers -->|"delegates auth"| node_auth
node_controllers -->|"delegates recipient ops"| node_recipients
node_controllers -->|"delegates template ops"| node_templates
node_controllers -.->|"delegates campaign ops"| node_campaigns
node_controllers -.->|"delegates sends"| node_notifications
node_auth -->|"generates JWT"| node_security
node_controllers -->|"authenticated by"| node_security
node_recipients -->|"reads and writes"| node_database
node_templates -->|"reads and writes"| node_database
node_campaigns -->|"renders content"| node_templates
node_campaigns -->|"persists campaigns"| node_database
node_campaigns -->|"selects audience"| node_recipients
node_scheduling -->|"publishes dispatch"| node_rabbit
node_rabbit -->|"delivers dispatch"| node_dispatch_worker
node_dispatch_worker -->|"invokes dispatch"| node_campaigns
node_campaigns -->|"publishes notifications"| node_publisher
node_notifications -.->|"checks idempotency"| node_redis
node_notifications -.->|"publishes messages"| node_publisher
node_publisher -.->|"sends messages"| node_rabbit
node_rabbit -->|"delivers messages"| node_worker
node_worker -.->|"updates status"| node_database
node_worker -->|"routes by channel"| node_providers
node_providers -.->|"sends email"| node_email
node_providers -.->|"sends SMS"| node_sms
node_worker -->|"simulates push"| node_push
node_worker -->|"retries failures"| node_retry
node_retry -->|"requeues or dead-letters"| node_rabbit
node_reconciliation -.->|"re-drives stuck rows"| node_database
node_controllers -.->|"exposes metrics"| node_monitoring

click node_controllers "https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/controller"
click node_auth "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/AuthService.java"
click node_security "https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/security"
click node_recipients "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/RecipientService.java"
click node_templates "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/TemplateService.java"
click node_campaigns "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/CampaignService.java"
click node_scheduling "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/scheduler/CampaignScheduler.java"
click node_dispatch_worker "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/worker/CampaignDispatchWorker.java"
click node_notifications "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/NotificationService.java"
click node_publisher "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/NotificationPublisher.java"
click node_worker "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/worker/NotificationWorker.java"
click node_providers "https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/provider"
click node_reconciliation "https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/scheduler/NotificationReconciliationScheduler.java"

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_controllers,node_auth,node_security,node_client toneBlue
class node_recipients,node_templates,node_campaigns toneAmber
class node_scheduling,node_dispatch_worker,node_notifications,node_publisher,node_worker,node_providers,node_rabbit,node_retry toneMint
class node_database,node_redis,node_reconciliation,node_monitoring toneRose
class node_email,node_sms,node_push toneIndigo
```

## Components

### API and security

- [REST controllers](https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/controller): `src/main/java/com/yash/Notifyr/controller`
- [Authentication](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/AuthService.java): `src/main/java/com/yash/Notifyr/service/AuthService.java`
- [JWT and API-key filters](https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/security): `src/main/java/com/yash/Notifyr/security`

### Campaign and content

- [Recipient management](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/RecipientService.java): `src/main/java/com/yash/Notifyr/service/RecipientService.java`
- [Template management](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/TemplateService.java): `src/main/java/com/yash/Notifyr/service/TemplateService.java`
- [Campaign engine](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/CampaignService.java): `src/main/java/com/yash/Notifyr/service/CampaignService.java`

### Async delivery

- [Campaign scheduling](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/scheduler/CampaignScheduler.java): `src/main/java/com/yash/Notifyr/scheduler/CampaignScheduler.java`
- [Dispatch worker](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/worker/CampaignDispatchWorker.java): `src/main/java/com/yash/Notifyr/worker/CampaignDispatchWorker.java`
- [Notification service](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/NotificationService.java): `src/main/java/com/yash/Notifyr/service/NotificationService.java`
- [Notification publisher](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/service/NotificationPublisher.java): `src/main/java/com/yash/Notifyr/service/NotificationPublisher.java`
- [Notification worker](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/worker/NotificationWorker.java): `src/main/java/com/yash/Notifyr/worker/NotificationWorker.java`
- [Channel providers](https://github.com/yashx37/notifyr/tree/main/src/main/java/com/yash/Notifyr/provider): `src/main/java/com/yash/Notifyr/provider`
- **RabbitMQ queues**
- **Retry and dead-letter queues**

### Persistence and operations

- **PostgreSQL data**
- **Redis idempotency**
- [Status reconciliation](https://github.com/yashx37/notifyr/blob/main/src/main/java/com/yash/Notifyr/scheduler/NotificationReconciliationScheduler.java): `src/main/java/com/yash/Notifyr/scheduler/NotificationReconciliationScheduler.java`
- **Metrics and dashboards**

### Other components

- **API client**
- **Email service**
- **SMS service**
- **Push simulation**

## Connections

- API client → REST controllers: calls REST
- REST controllers → Authentication: delegates auth (evidence: `src/main/java/com/yash/Notifyr/controller/AuthController.java`)
- REST controllers → Recipient management: delegates recipient ops (evidence: `src/main/java/com/yash/Notifyr/controller/RecipientController.java`)
- REST controllers → Template management: delegates template ops (evidence: `src/main/java/com/yash/Notifyr/controller/TemplateController.java`)
- REST controllers → Campaign engine: delegates campaign ops
- REST controllers → Notification service: delegates sends
- Authentication → JWT and API-key filters: generates JWT (evidence: `src/main/java/com/yash/Notifyr/service/AuthService.java`)
- REST controllers → JWT and API-key filters: authenticated by
- Recipient management → PostgreSQL data: reads and writes (evidence: `src/main/java/com/yash/Notifyr/service/RecipientService.java`)
- Template management → PostgreSQL data: reads and writes (evidence: `src/main/java/com/yash/Notifyr/service/TemplateService.java`)
- Campaign engine → Template management: renders content (evidence: `src/main/java/com/yash/Notifyr/service/CampaignService.java`)
- Campaign engine → PostgreSQL data: persists campaigns
- Campaign engine → Recipient management: selects audience (evidence: `src/main/java/com/yash/Notifyr/service/CampaignService.java`)
- Campaign scheduling → RabbitMQ queues: publishes dispatch
- RabbitMQ queues → Dispatch worker: delivers dispatch
- Dispatch worker → Campaign engine: invokes dispatch (evidence: `src/main/java/com/yash/Notifyr/worker/CampaignDispatchWorker.java`)
- Campaign engine → Notification publisher: publishes notifications (evidence: `src/main/java/com/yash/Notifyr/service/CampaignService.java`)
- Notification service → Redis idempotency: checks idempotency
- Notification service → Notification publisher: publishes messages
- Notification publisher → RabbitMQ queues: sends messages
- RabbitMQ queues → Notification worker: delivers messages
- Notification worker → PostgreSQL data: updates status
- Notification worker → Channel providers: routes by channel (evidence: `src/main/java/com/yash/Notifyr/worker/NotificationWorker.java`)
- Channel providers → Email service: sends email
- Channel providers → SMS service: sends SMS
- Notification worker → Push simulation: simulates push (evidence: `src/main/java/com/yash/Notifyr/worker/NotificationWorker.java`)
- Notification worker → Retry and dead-letter queues: retries failures
- Retry and dead-letter queues → RabbitMQ queues: requeues or dead-letters
- Status reconciliation → PostgreSQL data: re-drives stuck rows
- REST controllers → Metrics and dashboards: exposes metrics
