# updpujan/task-reminder-system architecture

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

- Interactive diagram: https://gitdiagram.com/updpujan/task-reminder-system
- Repository: https://github.com/updpujan/task-reminder-system

## Overview

Task Reminder System is an Express API for user authentication, task lifecycle management, and timezone-aware reminders, with administrator views and health checks. The main workflow is client → route and authorization → controller → application service → repository → PostgreSQL; the reminder worker separately polls due reminders and advances recurring schedules. Swagger UI is also served by the application. Relationships are based on excerpts, SOURCE INDEX references, and README diagrams; some route/controller and worker wiring is documented rather than fully sampled.

Main entry points: [`src/app.ts`](https://github.com/updpujan/task-reminder-system/blob/main/src/app.ts) (Express application), [`src/config/databaseConnection.ts`](https://github.com/updpujan/task-reminder-system/blob/main/src/config/databaseConnection.ts) (PostgreSQL pool), [`src/Routes/adminRoute.ts`](https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/adminRoute.ts) (Admin routes), [`src/controller/TaskController.ts`](https://github.com/updpujan/task-reminder-system/blob/main/src/controller/TaskController.ts) (Task controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_app["Express application<br/>[app.ts]"]
  node_task_routes["Task routes<br/>[tasksRoute.ts]"]
  node_auth_routes["Auth routes<br/>[authRoute.ts]"]
  node_admin_routes["Admin routes<br/>[adminRoute.ts]"]
  node_health_routes["Health route<br/>[healthRoute.ts]"]
  node_swagger["Swagger UI<br/>[swagger.ts]"]
end

subgraph group_identity["Identity &amp; Access"]
  node_auth_controller["Auth controller<br/>[authController.ts]"]
  node_auth_services["Auth services"]
  node_auth_middleware["JWT middleware<br/>[authMiddleware.ts]"]
  node_admin_middleware["Admin authorization"]
  node_jwt["JWT utilities<br/>[jwt.ts]"]
end

subgraph group_tasks["Task Management"]
  node_task_controller["Task controller<br/>[TaskController.ts]"]
  node_task_validation["Task schemas"]
  node_task_services["Task services<br/>[taskServices.ts]"]
  node_task_repository["Task repository<br/>[taskRepo.ts]"]
  node_user_admin["User administration<br/>[userController.ts]"]
end

subgraph group_reminders["Reminder Processing"]
  node_reminder_job["Reminder scheduler"]
  node_reminder_service["Reminder service<br/>[reminderService.ts]"]
  node_reminder_repository["Reminder repository<br/>[reminder.ts]"]
  node_reminder_time["Timezone calculations<br/>[reminder.ts]"]
end

subgraph group_data["Persistence &amp; Health"]
  node_health_controller["Health controller"]
  node_user_repository["User repositories"]
  node_auth_repository["Authentication repositories"]
  node_db_pool["PostgreSQL pool"]
end

node_client(("API client"))
node_postgres[("PostgreSQL")]

node_client -->|"sends HTTP"| node_app
node_app -->|"mounts routes"| node_task_routes
node_app -->|"mounts routes"| node_auth_routes
node_app -->|"mounts routes"| node_admin_routes
node_app -->|"mounts routes"| node_health_routes
node_app -->|"serves UI"| node_swagger
node_task_routes -->|"guards requests"| node_auth_middleware
node_task_routes -->|"dispatches requests"| node_task_controller
node_task_controller -->|"validates input"| node_task_validation
node_task_controller -->|"calls services"| node_task_services
node_task_services -->|"calls repository"| node_task_repository
node_task_services -->|"calculates schedule"| node_reminder_time
node_auth_routes -->|"dispatches requests"| node_auth_controller
node_auth_controller -->|"calls services"| node_auth_services
node_auth_services -->|"queries users"| node_auth_repository
node_auth_services -->|"generates token"| node_jwt
node_auth_routes -->|"applies validation"| node_auth_middleware
node_admin_routes -->|"requires identity"| node_auth_middleware
node_admin_routes -->|"checks role"| node_admin_middleware
node_admin_routes -->|"dispatches task views"| node_task_controller
node_admin_routes -->|"dispatches user views"| node_user_admin
node_health_routes -->|"dispatches check"| node_health_controller
node_health_controller -->|"checks connection"| node_db_pool
node_reminder_job -->|"runs periodically"| node_reminder_service
node_reminder_service -->|"loads and updates"| node_reminder_repository
node_reminder_service -->|"calculates recurrence"| node_reminder_time
node_task_repository -->|"uses pool"| node_db_pool
node_auth_repository -->|"uses pool"| node_db_pool
node_user_repository -->|"uses pool"| node_db_pool
node_reminder_repository -->|"uses pool"| node_db_pool
node_db_pool -->|"queries"| node_postgres

click node_app "https://github.com/updpujan/task-reminder-system/blob/main/src/app.ts"
click node_task_routes "https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/tasksRoute.ts"
click node_auth_routes "https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/authRoute.ts"
click node_admin_routes "https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/adminRoute.ts"
click node_health_routes "https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/healthRoute.ts"
click node_swagger "https://github.com/updpujan/task-reminder-system/blob/main/src/config/swagger.ts"
click node_auth_controller "https://github.com/updpujan/task-reminder-system/blob/main/src/controller/authController.ts"
click node_auth_services "https://github.com/updpujan/task-reminder-system/tree/main/src/application/auth"
click node_auth_middleware "https://github.com/updpujan/task-reminder-system/blob/main/src/middleware/authMiddleware.ts"
click node_admin_middleware "https://github.com/updpujan/task-reminder-system/blob/main/src/middleware/adminAuthMiddleware.ts"
click node_jwt "https://github.com/updpujan/task-reminder-system/blob/main/src/utils/jwt.ts"
click node_task_controller "https://github.com/updpujan/task-reminder-system/blob/main/src/controller/TaskController.ts"
click node_task_validation "https://github.com/updpujan/task-reminder-system/tree/main/src/schema/task"
click node_task_services "https://github.com/updpujan/task-reminder-system/blob/main/src/application/task/taskServices.ts"
click node_task_repository "https://github.com/updpujan/task-reminder-system/blob/main/src/repository/tasks/taskRepo.ts"
click node_user_admin "https://github.com/updpujan/task-reminder-system/blob/main/src/controller/userController.ts"
click node_reminder_job "https://github.com/updpujan/task-reminder-system/blob/main/src/jobs/reminderSchedular.ts"
click node_reminder_service "https://github.com/updpujan/task-reminder-system/blob/main/src/application/reminder/reminderService.ts"
click node_reminder_repository "https://github.com/updpujan/task-reminder-system/blob/main/src/repository/reminder.ts"
click node_reminder_time "https://github.com/updpujan/task-reminder-system/blob/main/src/utils/reminder.ts"
click node_health_controller "https://github.com/updpujan/task-reminder-system/blob/main/src/controller/healthController.ts"
click node_user_repository "https://github.com/updpujan/task-reminder-system/tree/main/src/repository/users"
click node_auth_repository "https://github.com/updpujan/task-reminder-system/tree/main/src/repository/auth"
click node_db_pool "https://github.com/updpujan/task-reminder-system/blob/main/src/config/databaseConnection.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_app,node_task_routes,node_auth_routes,node_admin_routes,node_health_routes,node_swagger,node_client toneBlue
class node_auth_controller,node_auth_services,node_auth_middleware,node_admin_middleware,node_jwt,node_postgres toneAmber
class node_task_controller,node_task_validation,node_task_services,node_task_repository,node_user_admin toneMint
class node_reminder_job,node_reminder_service,node_reminder_repository,node_reminder_time toneRose
class node_health_controller,node_user_repository,node_auth_repository,node_db_pool toneIndigo
```

## Components

### HTTP API

- [Express application](https://github.com/updpujan/task-reminder-system/blob/main/src/app.ts): `src/app.ts`
- [Task routes](https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/tasksRoute.ts): `src/Routes/tasksRoute.ts`
- [Auth routes](https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/authRoute.ts): `src/Routes/authRoute.ts`
- [Admin routes](https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/adminRoute.ts): `src/Routes/adminRoute.ts`
- [Health route](https://github.com/updpujan/task-reminder-system/blob/main/src/Routes/healthRoute.ts): `src/Routes/healthRoute.ts`
- [Swagger UI](https://github.com/updpujan/task-reminder-system/blob/main/src/config/swagger.ts): `src/config/swagger.ts`

### Identity & Access

- [Auth controller](https://github.com/updpujan/task-reminder-system/blob/main/src/controller/authController.ts): `src/controller/authController.ts`
- [Auth services](https://github.com/updpujan/task-reminder-system/tree/main/src/application/auth): `src/application/auth`
- [JWT middleware](https://github.com/updpujan/task-reminder-system/blob/main/src/middleware/authMiddleware.ts): `src/middleware/authMiddleware.ts`
- [Admin authorization](https://github.com/updpujan/task-reminder-system/blob/main/src/middleware/adminAuthMiddleware.ts): `src/middleware/adminAuthMiddleware.ts`
- [JWT utilities](https://github.com/updpujan/task-reminder-system/blob/main/src/utils/jwt.ts): `src/utils/jwt.ts`

### Task Management

- [Task controller](https://github.com/updpujan/task-reminder-system/blob/main/src/controller/TaskController.ts): `src/controller/TaskController.ts`
- [Task schemas](https://github.com/updpujan/task-reminder-system/tree/main/src/schema/task): `src/schema/task`
- [Task services](https://github.com/updpujan/task-reminder-system/blob/main/src/application/task/taskServices.ts): `src/application/task/taskServices.ts`
- [Task repository](https://github.com/updpujan/task-reminder-system/blob/main/src/repository/tasks/taskRepo.ts): `src/repository/tasks/taskRepo.ts`
- [User administration](https://github.com/updpujan/task-reminder-system/blob/main/src/controller/userController.ts): `src/controller/userController.ts`

### Reminder Processing

- [Reminder scheduler](https://github.com/updpujan/task-reminder-system/blob/main/src/jobs/reminderSchedular.ts): `src/jobs/reminderSchedular.ts`
- [Reminder service](https://github.com/updpujan/task-reminder-system/blob/main/src/application/reminder/reminderService.ts): `src/application/reminder/reminderService.ts`
- [Reminder repository](https://github.com/updpujan/task-reminder-system/blob/main/src/repository/reminder.ts): `src/repository/reminder.ts`
- [Timezone calculations](https://github.com/updpujan/task-reminder-system/blob/main/src/utils/reminder.ts): `src/utils/reminder.ts`

### Persistence & Health

- [Health controller](https://github.com/updpujan/task-reminder-system/blob/main/src/controller/healthController.ts): `src/controller/healthController.ts`
- [User repositories](https://github.com/updpujan/task-reminder-system/tree/main/src/repository/users): `src/repository/users`
- [Authentication repositories](https://github.com/updpujan/task-reminder-system/tree/main/src/repository/auth): `src/repository/auth`
- [PostgreSQL pool](https://github.com/updpujan/task-reminder-system/blob/main/src/config/databaseConnection.ts): `src/config/databaseConnection.ts`

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → Express application: sends HTTP (evidence: `README.md`)
- Express application → Task routes: mounts routes (evidence: `src/app.ts`)
- Express application → Auth routes: mounts routes (evidence: `src/app.ts`)
- Express application → Admin routes: mounts routes (evidence: `src/app.ts`)
- Express application → Health route: mounts routes (evidence: `src/app.ts`)
- Express application → Swagger UI: serves UI (evidence: `src/app.ts`)
- Task routes → JWT middleware: guards requests (evidence: `src/Routes/tasksRoute.ts`)
- Task routes → Task controller: dispatches requests (evidence: `src/Routes/tasksRoute.ts`)
- Task controller → Task schemas: validates input (evidence: `src/controller/TaskController.ts`)
- Task controller → Task services: calls services (evidence: `src/controller/TaskController.ts`)
- Task services → Task repository: calls repository (evidence: `src/application/task/taskServices.ts`)
- Task services → Timezone calculations: calculates schedule (evidence: `src/application/task/taskServices.ts`)
- Auth routes → Auth controller: dispatches requests (evidence: `src/Routes/authRoute.ts`)
- Auth controller → Auth services: calls services (evidence: `src/controller/authController.ts`)
- Auth services → Authentication repositories: queries users (evidence: `src/application/auth/loginService.ts`)
- Auth services → JWT utilities: generates token (evidence: `src/application/auth/loginService.ts`)
- Auth routes → JWT middleware: applies validation (evidence: `src/Routes/authRoute.ts`)
- Admin routes → JWT middleware: requires identity (evidence: `src/Routes/adminRoute.ts`)
- Admin routes → Admin authorization: checks role (evidence: `src/Routes/adminRoute.ts`)
- Admin routes → Task controller: dispatches task views (evidence: `src/Routes/adminRoute.ts`)
- Admin routes → User administration: dispatches user views (evidence: `src/Routes/adminRoute.ts`)
- Health route → Health controller: dispatches check (evidence: `src/Routes/healthRoute.ts`)
- Health controller → PostgreSQL pool: checks connection (evidence: `src/controller/healthController.ts`)
- Reminder scheduler → Reminder service: runs periodically (evidence: `src/jobs/reminderSchedular.ts`)
- Reminder service → Reminder repository: loads and updates (evidence: `src/application/reminder/reminderService.ts`)
- Reminder service → Timezone calculations: calculates recurrence (evidence: `src/application/reminder/reminderService.ts`)
- Task repository → PostgreSQL pool: uses pool (evidence: `src/repository/tasks/taskRepo.ts`)
- Authentication repositories → PostgreSQL pool: uses pool (evidence: `src/repository/auth/findUser.ts`)
- User repositories → PostgreSQL pool: uses pool (evidence: `src/repository/users/usersRepo.ts`)
- Reminder repository → PostgreSQL pool: uses pool (evidence: `src/repository/reminder.ts`)
- PostgreSQL pool → PostgreSQL: queries (evidence: `README.md`)
