# dilasathapa/configurable-notification-system architecture

> Architecture diagram of the GitHub repository dilasathapa/configurable-notification-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dilasathapa/configurable-notification-system
- Repository: https://github.com/dilasathapa/configurable-notification-system

## Overview

This is a configurable, event-driven notification product: users manage rules or submit a test event in the Angular UI; the backend evaluates enabled rules, creates per-recipient/channel notification records, dispatches delivery, and exposes history and dashboard metrics. The graph preserves rule management, event processing, email/in-app delivery, and monitoring. Backend relationships are grounded in excerpts and the SOURCE INDEX; frontend feature-to-API calls are supported by index references, while HTTP client/server integration is documented by the README. Unsampled controller and dashboard details are represented only where documented.

Main entry points: [`frontend/src/app/core/services/api.ts`](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/core/services/api.ts) (API client), [`backend/src/services/notifications/event-processing.service.ts`](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/notifications/event-processing.service.ts) (Event processor), [`frontend/src/app/app.routes.ts`](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/app.routes.ts) (Page router), [`backend/src/app.ts`](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/app.ts) (Express application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Angular application"]
  node_ruleui["Rule management<br/>[rules.ts]"]
  node_ruleform["Rule editor<br/>[rule-form.ts]"]
  node_eventui["Event trigger<br/>[events.ts]"]
  node_historyui["Notification history<br/>[notifications.ts]"]
  node_dashboard["Activity dashboard<br/>[dashboard.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_router["Page router<br/>[app.routes.ts]"]
end

subgraph group_api["Backend API"]
  node_backend["Express application<br/>[app.ts]"]
  node_rule_routes["Rule routes<br/>[rule.routes.ts]"]
  node_rule_controller["Rule management API<br/>[rule.controller.ts]"]
  node_event_controller["Event API"]
  node_notification_controller["Notification API"]
end

subgraph group_processing["Event processing"]
  node_event_processor["Event processor"]
  node_rule_engine["Rule engine"]
end

subgraph group_delivery["Notification delivery"]
  node_dispatcher["Channel dispatcher"]
  node_email["Email delivery<br/>[email.channel.ts]"]
  node_inapp["In-app delivery<br/>[in-app.channel.ts]"]
end

subgraph group_state["Persistence"]
  node_rule_model[("Rule definitions")]
  node_notification_model[("Notification records")]
end

node_user(("User"))
node_emailjs{{"EmailJS"}}
node_mongodb[("MongoDB")]

node_user -->|"manages rules"| node_ruleui
node_user -->|"triggers events"| node_eventui
node_user -->|"views history"| node_historyui
node_user -->|"monitors activity"| node_dashboard
node_router -->|"routes to"| node_ruleui
node_router -->|"routes to"| node_ruleform
node_router -->|"routes to"| node_eventui
node_router -->|"routes to"| node_historyui
node_router -->|"routes to"| node_dashboard
node_ruleui -->|"calls"| node_api_client
node_ruleform -->|"calls"| node_api_client
node_eventui -->|"calls"| node_api_client
node_historyui -->|"calls"| node_api_client
node_dashboard -->|"calls"| node_api_client
node_api_client -->|"requests API"| node_backend
node_backend -->|"mounts"| node_rule_routes
node_rule_routes -->|"routes requests"| node_rule_controller
node_rule_controller -->|"reads and writes"| node_rule_model
node_backend -->|"mounts routes"| node_event_controller
node_event_controller -->|"processes event"| node_event_processor
node_event_processor -->|"loads enabled rules"| node_rule_model
node_event_processor -->|"evaluates rules"| node_rule_engine
node_event_processor -->|"creates records"| node_notification_model
node_event_processor -->|"dispatches notifications"| node_dispatcher
node_dispatcher -->|"sends email"| node_email
node_dispatcher -->|"sends in-app"| node_inapp
node_email -->|"delivers via"| node_emailjs
node_event_processor -->|"updates status"| node_notification_model
node_backend -->|"mounts routes"| node_notification_controller
node_notification_controller -->|"reads history"| node_notification_model
node_rule_model -->|"persists"| node_mongodb
node_notification_model -->|"persists"| node_mongodb
node_dashboard -->|"loads metrics"| node_api_client

click node_ruleui "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/rules/rules.ts"
click node_ruleform "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/rules/rule-form/rule-form.ts"
click node_eventui "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/events/events.ts"
click node_historyui "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/notifications/notifications.ts"
click node_dashboard "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/dashboard/dashboard.ts"
click node_api_client "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/core/services/api.ts"
click node_router "https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/app.routes.ts"
click node_backend "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/app.ts"
click node_rule_routes "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/routes/rule.routes.ts"
click node_rule_controller "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/rule.controller.ts"
click node_event_controller "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/event.controller.ts"
click node_notification_controller "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/notification.controller.ts"
click node_event_processor "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/notifications/event-processing.service.ts"
click node_rule_engine "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/rules/rule-engine.service.ts"
click node_rule_model "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/models/notification-rule.model.ts"
click node_notification_model "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/models/notification.model.ts"
click node_dispatcher "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/channel-dispatcher.service.ts"
click node_email "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/email.channel.ts"
click node_inapp "https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/in-app.channel.ts"

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_ruleui,node_ruleform,node_eventui,node_historyui,node_dashboard,node_api_client,node_router,node_user toneBlue
class node_backend,node_rule_routes,node_rule_controller,node_event_controller,node_notification_controller,node_mongodb toneAmber
class node_event_processor,node_rule_engine toneMint
class node_dispatcher,node_email,node_inapp toneRose
class node_rule_model,node_notification_model,node_emailjs toneIndigo
```

## Components

### Angular application

- [Rule management](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/rules/rules.ts): `frontend/src/app/features/rules/rules.ts`
- [Rule editor](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/rules/rule-form/rule-form.ts): `frontend/src/app/features/rules/rule-form/rule-form.ts`
- [Event trigger](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/events/events.ts): `frontend/src/app/features/events/events.ts`
- [Notification history](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/notifications/notifications.ts): `frontend/src/app/features/notifications/notifications.ts`
- [Activity dashboard](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/features/dashboard/dashboard.ts): `frontend/src/app/features/dashboard/dashboard.ts`
- [API client](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/core/services/api.ts): `frontend/src/app/core/services/api.ts`
- [Page router](https://github.com/dilasathapa/configurable-notification-system/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`

### Backend API

- [Express application](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Rule routes](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/routes/rule.routes.ts): `backend/src/routes/rule.routes.ts`
- [Rule management API](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/rule.controller.ts): `backend/src/controllers/rule.controller.ts`
- [Event API](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/event.controller.ts): `backend/src/controllers/event.controller.ts`
- [Notification API](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/controllers/notification.controller.ts): `backend/src/controllers/notification.controller.ts`

### Event processing

- [Event processor](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/notifications/event-processing.service.ts): `backend/src/services/notifications/event-processing.service.ts`
- [Rule engine](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/rules/rule-engine.service.ts): `backend/src/services/rules/rule-engine.service.ts`

### Notification delivery

- [Channel dispatcher](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/channel-dispatcher.service.ts): `backend/src/services/channels/channel-dispatcher.service.ts`
- [Email delivery](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/email.channel.ts): `backend/src/services/channels/email.channel.ts`
- [In-app delivery](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/services/channels/in-app.channel.ts): `backend/src/services/channels/in-app.channel.ts`

### Persistence

- [Rule definitions](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/models/notification-rule.model.ts): `backend/src/models/notification-rule.model.ts`
- [Notification records](https://github.com/dilasathapa/configurable-notification-system/blob/main/backend/src/models/notification.model.ts): `backend/src/models/notification.model.ts`

### Other components

- **User**
- **EmailJS**
- **MongoDB**

## Connections

- User → Rule management: manages rules (evidence: `README.md`)
- User → Event trigger: triggers events (evidence: `README.md`)
- User → Notification history: views history (evidence: `README.md`)
- User → Activity dashboard: monitors activity (evidence: `README.md`)
- Page router → Rule management: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page router → Rule editor: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page router → Event trigger: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page router → Notification history: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Page router → Activity dashboard: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Rule management → API client: calls (evidence: `frontend/src/app/features/rules/rules.ts`)
- Rule editor → API client: calls (evidence: `frontend/src/app/features/rules/rule-form/rule-form.ts`)
- Event trigger → API client: calls (evidence: `frontend/src/app/features/events/events.ts`)
- Notification history → API client: calls (evidence: `frontend/src/app/features/notifications/notifications.ts`)
- Activity dashboard → API client: calls (evidence: `frontend/src/app/features/dashboard/dashboard.ts`)
- API client → Express application: requests API (evidence: `README.md`)
- Express application → Rule routes: mounts (evidence: `backend/src/app.ts`)
- Rule routes → Rule management API: routes requests (evidence: `backend/src/routes/rule.routes.ts`)
- Rule management API → Rule definitions: reads and writes (evidence: `backend/src/controllers/rule.controller.ts`)
- Express application → Event API: mounts routes (evidence: `backend/src/app.ts`)
- Event API → Event processor: processes event (evidence: `backend/src/controllers/event.controller.ts`)
- Event processor → Rule definitions: loads enabled rules (evidence: `backend/src/services/notifications/event-processing.service.ts`)
- Event processor → Rule engine: evaluates rules (evidence: `backend/src/services/notifications/event-processing.service.ts`)
- Event processor → Notification records: creates records (evidence: `backend/src/services/notifications/event-processing.service.ts`)
- Event processor → Channel dispatcher: dispatches notifications (evidence: `backend/src/services/notifications/event-processing.service.ts`)
- Channel dispatcher → Email delivery: sends email (evidence: `backend/src/services/channels/channel-dispatcher.service.ts`)
- Channel dispatcher → In-app delivery: sends in-app (evidence: `backend/src/services/channels/channel-dispatcher.service.ts`)
- Email delivery → EmailJS: delivers via (evidence: `README.md`)
- Event processor → Notification records: updates status (evidence: `backend/src/services/notifications/event-processing.service.ts`)
- Express application → Notification API: mounts routes (evidence: `backend/src/app.ts`)
- Notification API → Notification records: reads history (evidence: `backend/src/controllers/notification.controller.ts`)
- Rule definitions → MongoDB: persists (evidence: `README.md`)
- Notification records → MongoDB: persists (evidence: `README.md`)
- Activity dashboard → API client: loads metrics (evidence: `frontend/src/app/features/dashboard/dashboard.ts`)
