# minhazur-rahman250/notification-service architecture

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

- Interactive diagram: https://gitdiagram.com/minhazur-rahman250/notification-service
- Repository: https://github.com/minhazur-rahman250/notification-service

## Overview

This is a Gin-based service for notifications, course search indexing, certificate issuance, and platform analytics. Clients call the registered HTTP routes; handlers validate requests, perform PostgreSQL operations, and return JSON, while certificate generation also writes a PDF. The course-index endpoint is documented as receiving updates from the NestJS application. The excerpts show the route wiring and handler-to-database behavior; no README is present, and no other integrations are established by the sampled source.

Main entry points: [`routes/routes.go`](https://github.com/minhazur-rahman250/notification-service/blob/main/routes/routes.go) (HTTP routes), [`handlers/search_handler.go`](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/search_handler.go) (Course search), [`handlers/notification_handler.go`](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/notification_handler.go) (Notifications), [`handlers/certificate_handler.go`](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/certificate_handler.go) (Certificates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Service entry"]
  node_server["Service startup<br/>[main.go]"]
  node_routes["HTTP routes<br/>[routes.go]"]
end

subgraph group_features["Product handlers"]
  node_notifications["Notifications"]
  node_certificates["Certificates"]
  node_search["Course search<br/>[search_handler.go]"]
  node_analytics["Analytics"]
end

subgraph group_data["Domain models"]
  node_notification_model["Notification data<br/>[notification.go]"]
  node_certificate_model["Certificate data<br/>[certificate.go]"]
  node_course_model["Course index data<br/>[course_index.go]"]
  node_analytics_model["Analytics data<br/>[analytics.go]"]
end

subgraph group_storage["Persistence"]
  node_db_setup["Database setup<br/>[database.go]"]
  node_postgres[("PostgreSQL")]
end

node_clients(("HTTP clients"))
node_upstream(("NestJS course app"))

node_clients -->|"send requests"| node_routes
node_upstream -->|"posts course index"| node_search
node_server -->|"connects"| node_db_setup
node_server -->|"registers"| node_routes
node_routes -->|"dispatches"| node_notifications
node_routes -->|"dispatches"| node_certificates
node_routes -->|"dispatches"| node_search
node_routes -->|"dispatches"| node_analytics
node_notifications -->|"reads and writes"| node_postgres
node_certificates -->|"reads and writes"| node_postgres
node_search -->|"reads and writes"| node_postgres
node_analytics -->|"queries"| node_postgres
node_db_setup -->|"creates tables"| node_postgres
node_notifications -->|"binds and returns"| node_notification_model
node_certificates -->|"binds and returns"| node_certificate_model
node_search -->|"binds and returns"| node_course_model
node_analytics -->|"returns"| node_analytics_model

click node_server "https://github.com/minhazur-rahman250/notification-service/blob/main/main.go"
click node_routes "https://github.com/minhazur-rahman250/notification-service/blob/main/routes/routes.go"
click node_notifications "https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/notification_handler.go"
click node_certificates "https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/certificate_handler.go"
click node_search "https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/search_handler.go"
click node_analytics "https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/analytics_handler.go"
click node_notification_model "https://github.com/minhazur-rahman250/notification-service/blob/main/models/notification.go"
click node_certificate_model "https://github.com/minhazur-rahman250/notification-service/blob/main/models/certificate.go"
click node_course_model "https://github.com/minhazur-rahman250/notification-service/blob/main/models/course_index.go"
click node_analytics_model "https://github.com/minhazur-rahman250/notification-service/blob/main/models/analytics.go"
click node_db_setup "https://github.com/minhazur-rahman250/notification-service/blob/main/config/database.go"

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_server,node_routes,node_clients toneBlue
class node_notifications,node_certificates,node_search,node_analytics toneAmber
class node_notification_model,node_certificate_model,node_course_model,node_analytics_model toneMint
class node_db_setup,node_postgres toneRose
class node_upstream toneIndigo
```

## Components

### Service entry

- [Service startup](https://github.com/minhazur-rahman250/notification-service/blob/main/main.go): `main.go`
- [HTTP routes](https://github.com/minhazur-rahman250/notification-service/blob/main/routes/routes.go): `routes/routes.go`

### Product handlers

- [Notifications](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/notification_handler.go): `handlers/notification_handler.go`
- [Certificates](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/certificate_handler.go): `handlers/certificate_handler.go`
- [Course search](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/search_handler.go): `handlers/search_handler.go`
- [Analytics](https://github.com/minhazur-rahman250/notification-service/blob/main/handlers/analytics_handler.go): `handlers/analytics_handler.go`

### Domain models

- [Notification data](https://github.com/minhazur-rahman250/notification-service/blob/main/models/notification.go): `models/notification.go`
- [Certificate data](https://github.com/minhazur-rahman250/notification-service/blob/main/models/certificate.go): `models/certificate.go`
- [Course index data](https://github.com/minhazur-rahman250/notification-service/blob/main/models/course_index.go): `models/course_index.go`
- [Analytics data](https://github.com/minhazur-rahman250/notification-service/blob/main/models/analytics.go): `models/analytics.go`

### Persistence

- [Database setup](https://github.com/minhazur-rahman250/notification-service/blob/main/config/database.go): `config/database.go`
- **PostgreSQL**

### Other components

- **HTTP clients**
- **NestJS course app**

## Connections

- HTTP clients → HTTP routes: send requests (evidence: `routes/routes.go`)
- NestJS course app → Course search: posts course index (evidence: `handlers/search_handler.go`)
- Service startup → Database setup: connects (evidence: `main.go`)
- Service startup → HTTP routes: registers (evidence: `main.go`)
- HTTP routes → Notifications: dispatches (evidence: `routes/routes.go`)
- HTTP routes → Certificates: dispatches (evidence: `routes/routes.go`)
- HTTP routes → Course search: dispatches (evidence: `routes/routes.go`)
- HTTP routes → Analytics: dispatches (evidence: `routes/routes.go`)
- Notifications → PostgreSQL: reads and writes (evidence: `handlers/notification_handler.go`)
- Certificates → PostgreSQL: reads and writes (evidence: `handlers/certificate_handler.go`)
- Course search → PostgreSQL: reads and writes (evidence: `handlers/search_handler.go`)
- Analytics → PostgreSQL: queries (evidence: `handlers/analytics_handler.go`)
- Database setup → PostgreSQL: creates tables (evidence: `config/database.go`)
- Notifications → Notification data: binds and returns (evidence: `handlers/notification_handler.go`)
- Certificates → Certificate data: binds and returns (evidence: `handlers/certificate_handler.go`)
- Course search → Course index data: binds and returns (evidence: `handlers/search_handler.go`)
- Analytics → Analytics data: returns (evidence: `handlers/analytics_handler.go`)
