# ahmadmdabit/notificationsystem architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadmdabit/notificationsystem
- Repository: https://github.com/ahmadmdabit/notificationsystem

## Overview

NotificationSystem is a .NET microservice application for user authentication, notification creation/sending, and notification-history tracking. A user interacts with the MVC UI, whose API facade calls a gateway; the gateway routes requests to the UserService or NotificationService. Controllers delegate to business logic, repositories persist through shared Dapper infrastructure, and APIs return common result contracts. The README documents JWT authorization, Swagger, SQL Server, and responsive UI; some wiring and service internals are represented from documented structure because their source was not sampled.

Main entry points: [`API/Controller/BaseApiController.cs`](https://github.com/ahmadmdabit/notificationsystem/blob/master/API/Controller/BaseApiController.cs) (Base API Controller), [`ApiGateway/Startup.cs`](https://github.com/ahmadmdabit/notificationsystem/blob/master/ApiGateway/Startup.cs) (API Gateway), [`UserService/Controllers/UsersController.cs`](https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Controllers/UsersController.cs) (Users API), [`NotificationService/Controllers/NotificationsController.cs`](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Controllers/NotificationsController.cs) (Notifications API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client Experience"]
  node_ui_web["MVC Web UI<br/>[HomeController.cs]"]
  node_ui_api["UI API Facade<br/>[ApiController.cs]"]
  node_gateway_client["Gateway Client"]
end

subgraph group_edge["Gateway Edge"]
  node_gateway["API Gateway<br/>[Startup.cs]"]
end

subgraph group_users["User Service"]
  node_user_api["Users API<br/>[UsersController.cs]"]
  node_user_business["User Business<br/>[UserBusiness.cs]"]
  node_user_repository["User Repository<br/>[UserRepository.cs]"]
  node_jwt_auth["JWT Authentication<br/>[Startup.cs]"]
end

subgraph group_notifications["Notification Service"]
  node_notification_api["Notifications API"]
  node_history_api["History API"]
  node_notification_business["Notification Business"]
  node_history_business["History Business"]
  node_notification_repository["Notification Repository"]
  node_history_repository["History Repository"]
end

subgraph group_shared["Shared Runtime"]
  node_base_api["Base API Controller"]
  node_base_composite_api["Composite API Controller"]
  node_base_repository["Dapper Repository<br/>[BaseRepository.cs]"]
  node_base_composite_repository["Composite Repository"]
  node_api_result["API Result Contract<br/>[ApiResult.cs]"]
end

node_user_actor(("User"))
node_sql_server[("SQL Server")]

node_user_actor -->|"uses UI"| node_ui_web
node_ui_web -->|"submits requests"| node_ui_api
node_ui_api -->|"calls client"| node_gateway_client
node_gateway_client -->|"sends HTTP"| node_gateway
node_gateway -->|"routes users"| node_user_api
node_gateway -->|"routes notifications"| node_notification_api
node_gateway -->|"routes histories"| node_history_api
node_user_api -->|"uses base actions"| node_base_api
node_notification_api -->|"uses base actions"| node_base_api
node_history_api -->|"uses composite actions"| node_base_composite_api
node_base_api -->|"invokes business"| node_user_business
node_base_api -->|"invokes business"| node_notification_business
node_base_composite_api -->|"invokes business"| node_history_business
node_user_api -->|"registers users"| node_user_business
node_user_api -->|"issues tokens"| node_jwt_auth
node_jwt_auth -.->|"guards APIs"| node_base_api
node_notification_api -->|"sends notifications"| node_notification_business
node_user_business -->|"reads and writes"| node_user_repository
node_notification_business -->|"reads and writes"| node_notification_repository
node_history_business -->|"reads and writes"| node_history_repository
node_user_repository -->|"uses repository"| node_base_repository
node_notification_repository -->|"uses repository"| node_base_repository
node_history_repository -->|"uses repository"| node_base_composite_repository
node_base_repository -->|"queries data"| node_sql_server
node_base_composite_repository -->|"queries data"| node_sql_server
node_base_api -->|"wraps responses"| node_api_result
node_base_composite_api -->|"wraps responses"| node_api_result

click node_ui_web "https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Controllers/HomeController.cs"
click node_ui_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Controllers/ApiController.cs"
click node_gateway_client "https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Services/GatewayApiClient.cs"
click node_gateway "https://github.com/ahmadmdabit/notificationsystem/blob/master/ApiGateway/Startup.cs"
click node_user_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Controllers/UsersController.cs"
click node_user_business "https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Businesses/UserBusiness.cs"
click node_user_repository "https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Repositories/UserRepository.cs"
click node_jwt_auth "https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Startup.cs"
click node_notification_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Controllers/NotificationsController.cs"
click node_history_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Controllers/NotificationsHistoryController.cs"
click node_notification_business "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Businesses/NotificationBusiness.cs"
click node_history_business "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Businesses/NotificationHistoryBusiness.cs"
click node_notification_repository "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Repositories/NotificationRepository.cs"
click node_history_repository "https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Repositories/NotificationHistoryRepository.cs"
click node_base_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/API/Controller/BaseApiController.cs"
click node_base_composite_api "https://github.com/ahmadmdabit/notificationsystem/blob/master/API/Controller/BaseCompositeApiController.cs"
click node_base_repository "https://github.com/ahmadmdabit/notificationsystem/blob/master/DAL/Repository/BaseRepository.cs"
click node_base_composite_repository "https://github.com/ahmadmdabit/notificationsystem/blob/master/DAL/Repository/BaseCompositeRepository.cs"
click node_api_result "https://github.com/ahmadmdabit/notificationsystem/blob/master/Common/Helpers/ApiResult.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_ui_web,node_ui_api,node_gateway_client,node_user_actor toneBlue
class node_gateway,node_sql_server toneAmber
class node_user_api,node_user_business,node_user_repository,node_jwt_auth toneMint
class node_notification_api,node_history_api,node_notification_business,node_history_business,node_notification_repository,node_history_repository toneRose
class node_base_api,node_base_composite_api,node_base_repository,node_base_composite_repository,node_api_result toneIndigo
```

## Components

### Client Experience

- [MVC Web UI](https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Controllers/HomeController.cs): `UI/Controllers/HomeController.cs`
- [UI API Facade](https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Controllers/ApiController.cs): `UI/Controllers/ApiController.cs`
- [Gateway Client](https://github.com/ahmadmdabit/notificationsystem/blob/master/UI/Services/GatewayApiClient.cs): `UI/Services/GatewayApiClient.cs`

### Gateway Edge

- [API Gateway](https://github.com/ahmadmdabit/notificationsystem/blob/master/ApiGateway/Startup.cs): `ApiGateway/Startup.cs`

### User Service

- [Users API](https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Controllers/UsersController.cs): `UserService/Controllers/UsersController.cs`
- [User Business](https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Businesses/UserBusiness.cs): `UserService/Businesses/UserBusiness.cs`
- [User Repository](https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Repositories/UserRepository.cs): `UserService/Repositories/UserRepository.cs`
- [JWT Authentication](https://github.com/ahmadmdabit/notificationsystem/blob/master/UserService/Startup.cs): `UserService/Startup.cs`

### Notification Service

- [Notifications API](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Controllers/NotificationsController.cs): `NotificationService/Controllers/NotificationsController.cs`
- [History API](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Controllers/NotificationsHistoryController.cs): `NotificationService/Controllers/NotificationsHistoryController.cs`
- [Notification Business](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Businesses/NotificationBusiness.cs): `NotificationService/Businesses/NotificationBusiness.cs`
- [History Business](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Businesses/NotificationHistoryBusiness.cs): `NotificationService/Businesses/NotificationHistoryBusiness.cs`
- [Notification Repository](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Repositories/NotificationRepository.cs): `NotificationService/Repositories/NotificationRepository.cs`
- [History Repository](https://github.com/ahmadmdabit/notificationsystem/blob/master/NotificationService/Repositories/NotificationHistoryRepository.cs): `NotificationService/Repositories/NotificationHistoryRepository.cs`

### Shared Runtime

- [Base API Controller](https://github.com/ahmadmdabit/notificationsystem/blob/master/API/Controller/BaseApiController.cs): `API/Controller/BaseApiController.cs`
- [Composite API Controller](https://github.com/ahmadmdabit/notificationsystem/blob/master/API/Controller/BaseCompositeApiController.cs): `API/Controller/BaseCompositeApiController.cs`
- [Dapper Repository](https://github.com/ahmadmdabit/notificationsystem/blob/master/DAL/Repository/BaseRepository.cs): `DAL/Repository/BaseRepository.cs`
- [Composite Repository](https://github.com/ahmadmdabit/notificationsystem/blob/master/DAL/Repository/BaseCompositeRepository.cs): `DAL/Repository/BaseCompositeRepository.cs`
- [API Result Contract](https://github.com/ahmadmdabit/notificationsystem/blob/master/Common/Helpers/ApiResult.cs): `Common/Helpers/ApiResult.cs`

### Other components

- **User**
- **SQL Server**

## Connections

- User → MVC Web UI: uses UI
- MVC Web UI → UI API Facade: submits requests
- UI API Facade → Gateway Client: calls client
- Gateway Client → API Gateway: sends HTTP
- API Gateway → Users API: routes users
- API Gateway → Notifications API: routes notifications
- API Gateway → History API: routes histories
- Users API → Base API Controller: uses base actions
- Notifications API → Base API Controller: uses base actions
- History API → Composite API Controller: uses composite actions
- Base API Controller → User Business: invokes business
- Base API Controller → Notification Business: invokes business
- Composite API Controller → History Business: invokes business
- Users API → User Business: registers users
- Users API → JWT Authentication: issues tokens
- JWT Authentication → Base API Controller: guards APIs
- Notifications API → Notification Business: sends notifications
- User Business → User Repository: reads and writes
- Notification Business → Notification Repository: reads and writes
- History Business → History Repository: reads and writes
- User Repository → Dapper Repository: uses repository
- Notification Repository → Dapper Repository: uses repository
- History Repository → Composite Repository: uses repository
- Dapper Repository → SQL Server: queries data
- Composite Repository → SQL Server: queries data
- Base API Controller → API Result Contract: wraps responses
- Composite API Controller → API Result Contract: wraps responses
