# joaopedro-h/task-list-system architecture

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

- Interactive diagram: https://gitdiagram.com/joaopedro-h/task-list-system
- Repository: https://github.com/joaopedro-h/task-list-system

## Overview

This is a task-management application with user registration/login, task creation and lifecycle management, search, and a weather view. The backend workflow is HTTP request → route/middleware → controller → service → MySQL, with weather fetched from an external provider and cached. Frontend JS and TypeScript files cover corresponding UI capabilities, but the available excerpts do not show how they call the backend; those links are therefore omitted. Backend relationships are based on route/controller and controller/service excerpts, plus indexed service references.

Main entry points: [`backend/sources/controllers/TaskController.js`](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/TaskController.js) (Task controller), [`backend/sources/database/connection.js`](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/database/connection.js) (MySQL pool), [`backend/sources/routes/routes.js`](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/routes/routes.js) (API routes), [`backend/sources/app.js`](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/app.js) (Express app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP application"]
  node_app["Express app<br/>[app.js]"]
  node_routes["API routes<br/>[routes.js]"]
  node_auth["Authentication middleware<br/>[authentication.js]"]
  node_cronauth["Cron authorization"]
  node_errors["Error handler<br/>[errorHandler.js]"]
end

subgraph group_identity["User identity"]
  node_logincontroller["Login controller<br/>[LoginController.js]"]
  node_registercontroller["Registration controller"]
  node_loginservice["Login service"]
  node_userservice["User creation"]
  node_frontendidentity["Login and registration UI<br/>[login.js]"]
end

subgraph group_tasks["Task management"]
  node_taskcontroller["Task controller<br/>[TaskController.js]"]
  node_createtask["Create task"]
  node_loadtask["Load tasks<br/>[LoadTaskService.js]"]
  node_searchtask["Search tasks"]
  node_edittask["Edit task<br/>[EditTaskService.js]"]
  node_deletetask["Delete completed tasks"]
  node_progresstask["Start task"]
  node_completetask["Complete task"]
  node_reopentask["Reopen task"]
  node_database[("MySQL pool<br/>[connection.js]")]
  node_frontendtasks["Task UI actions and views<br/>[taskView.js]"]
  node_frontendloads["Task loading and search UI<br/>[loadTasks.js]"]
end

subgraph group_integrations["External data"]
  node_weathercontroller["Weather controller"]
  node_weatherservice["Weather service and cache<br/>[WeatherService.js]"]
  node_frontendweather["Weather UI<br/>[weather.js]"]
end

node_user(("User"))
node_weatherapi["Weather API"]

node_user -->|"sends requests"| node_routes
node_app -->|"mounts"| node_routes
node_app -->|"registers"| node_errors
node_routes -->|"routes login"| node_logincontroller
node_routes -->|"routes registration"| node_registercontroller
node_routes -->|"routes tasks"| node_taskcontroller
node_routes -->|"routes weather"| node_weathercontroller
node_routes -->|"protects routes"| node_auth
node_routes -->|"guards cleanup"| node_cronauth
node_logincontroller -->|"executes"| node_loginservice
node_registercontroller -->|"executes"| node_userservice
node_taskcontroller -->|"executes"| node_createtask
node_taskcontroller -->|"executes"| node_loadtask
node_taskcontroller -->|"executes"| node_searchtask
node_taskcontroller -->|"executes"| node_edittask
node_taskcontroller -->|"executes"| node_deletetask
node_taskcontroller -->|"executes"| node_progresstask
node_taskcontroller -->|"executes"| node_completetask
node_taskcontroller -->|"executes"| node_reopentask
node_loginservice -->|"queries"| node_database
node_userservice -->|"writes user"| node_database
node_createtask -->|"writes task"| node_database
node_loadtask -->|"loads tasks"| node_database
node_searchtask -->|"searches tasks"| node_database
node_edittask -->|"updates task"| node_database
node_deletetask -->|"deletes tasks"| node_database
node_progresstask -->|"updates status"| node_database
node_completetask -->|"updates status"| node_database
node_reopentask -->|"updates status"| node_database
node_weathercontroller -->|"executes"| node_weatherservice
node_weatherservice -->|"fetches forecast"| node_weatherapi

click node_app "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/app.js"
click node_routes "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/routes/routes.js"
click node_auth "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/authentication.js"
click node_cronauth "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/cronAuthMiddleware.js"
click node_errors "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/errorHandler.js"
click node_logincontroller "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/LoginController.js"
click node_registercontroller "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/RegisterController.js"
click node_loginservice "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/LoginUserService.js"
click node_userservice "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CreateUserService.js"
click node_taskcontroller "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/TaskController.js"
click node_createtask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CreateTaskService.js"
click node_loadtask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/LoadTaskService.js"
click node_searchtask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/SearchTaskService.js"
click node_edittask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/EditTaskService.js"
click node_deletetask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/DeleteTaskService.js"
click node_progresstask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/InProgressTaskService.js"
click node_completetask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CompleteTaskService.js"
click node_reopentask "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/ReopenTaskService.js"
click node_database "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/database/connection.js"
click node_weathercontroller "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/WeatherController.js"
click node_weatherservice "https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/WeatherService.js"
click node_frontendtasks "https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/taskView.js"
click node_frontendloads "https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/loadTasks.js"
click node_frontendidentity "https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/login.js"
click node_frontendweather "https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/weather.js"

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_routes,node_auth,node_cronauth,node_errors,node_user toneBlue
class node_logincontroller,node_registercontroller,node_loginservice,node_userservice,node_frontendidentity toneAmber
class node_taskcontroller,node_createtask,node_loadtask,node_searchtask,node_edittask,node_deletetask,node_progresstask,node_completetask,node_reopentask,node_database,node_frontendtasks,node_frontendloads,node_weatherapi toneMint
class node_weathercontroller,node_weatherservice,node_frontendweather toneRose
```

## Components

### HTTP application

- [Express app](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/app.js): `backend/sources/app.js`
- [API routes](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/routes/routes.js): `backend/sources/routes/routes.js`
- [Authentication middleware](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/authentication.js): `backend/sources/middlewares/authentication.js`
- [Cron authorization](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/cronAuthMiddleware.js): `backend/sources/middlewares/cronAuthMiddleware.js`
- [Error handler](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/middlewares/errorHandler.js): `backend/sources/middlewares/errorHandler.js`

### User identity

- [Login controller](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/LoginController.js): `backend/sources/controllers/LoginController.js`
- [Registration controller](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/RegisterController.js): `backend/sources/controllers/RegisterController.js`
- [Login service](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/LoginUserService.js): `backend/sources/services/LoginUserService.js`
- [User creation](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CreateUserService.js): `backend/sources/services/CreateUserService.js`
- [Login and registration UI](https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/login.js): `frontend/js/login.js`

### Task management

- [Task controller](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/TaskController.js): `backend/sources/controllers/TaskController.js`
- [Create task](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CreateTaskService.js): `backend/sources/services/CreateTaskService.js`
- [Load tasks](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/LoadTaskService.js): `backend/sources/services/LoadTaskService.js`
- [Search tasks](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/SearchTaskService.js): `backend/sources/services/SearchTaskService.js`
- [Edit task](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/EditTaskService.js): `backend/sources/services/EditTaskService.js`
- [Delete completed tasks](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/DeleteTaskService.js): `backend/sources/services/DeleteTaskService.js`
- [Start task](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/InProgressTaskService.js): `backend/sources/services/InProgressTaskService.js`
- [Complete task](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/CompleteTaskService.js): `backend/sources/services/CompleteTaskService.js`
- [Reopen task](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/ReopenTaskService.js): `backend/sources/services/ReopenTaskService.js`
- [MySQL pool](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/database/connection.js): `backend/sources/database/connection.js`
- [Task UI actions and views](https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/taskView.js): `frontend/js/taskView.js`
- [Task loading and search UI](https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/loadTasks.js): `frontend/js/loadTasks.js`

### External data

- [Weather controller](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/controllers/WeatherController.js): `backend/sources/controllers/WeatherController.js`
- [Weather service and cache](https://github.com/joaopedro-h/task-list-system/blob/main/backend/sources/services/WeatherService.js): `backend/sources/services/WeatherService.js`
- [Weather UI](https://github.com/joaopedro-h/task-list-system/blob/main/frontend/js/weather.js): `frontend/js/weather.js`

### Other components

- **User**
- **Weather API**

## Connections

- User → API routes: sends requests (evidence: `backend/sources/routes/routes.js`)
- Express app → API routes: mounts (evidence: `backend/sources/app.js`)
- Express app → Error handler: registers (evidence: `backend/sources/app.js`)
- API routes → Login controller: routes login (evidence: `backend/sources/routes/routes.js`)
- API routes → Registration controller: routes registration (evidence: `backend/sources/routes/routes.js`)
- API routes → Task controller: routes tasks (evidence: `backend/sources/routes/routes.js`)
- API routes → Weather controller: routes weather (evidence: `backend/sources/routes/routes.js`)
- API routes → Authentication middleware: protects routes (evidence: `backend/sources/routes/routes.js`)
- API routes → Cron authorization: guards cleanup (evidence: `backend/sources/routes/routes.js`)
- Login controller → Login service: executes (evidence: `backend/sources/controllers/LoginController.js`)
- Registration controller → User creation: executes (evidence: `backend/sources/controllers/RegisterController.js`)
- Task controller → Create task: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Load tasks: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Search tasks: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Edit task: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Delete completed tasks: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Start task: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Complete task: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Task controller → Reopen task: executes (evidence: `backend/sources/controllers/TaskController.js`)
- Login service → MySQL pool: queries (evidence: `backend/sources/services/LoginUserService.js`)
- User creation → MySQL pool: writes user (evidence: `backend/sources/services/CreateUserService.js`)
- Create task → MySQL pool: writes task (evidence: `backend/sources/services/CreateTaskService.js`)
- Load tasks → MySQL pool: loads tasks (evidence: `backend/sources/services/LoadTaskService.js`)
- Search tasks → MySQL pool: searches tasks (evidence: `backend/sources/services/SearchTaskService.js`)
- Edit task → MySQL pool: updates task (evidence: `backend/sources/services/EditTaskService.js`)
- Delete completed tasks → MySQL pool: deletes tasks (evidence: `backend/sources/services/DeleteTaskService.js`)
- Start task → MySQL pool: updates status (evidence: `backend/sources/services/InProgressTaskService.js`)
- Complete task → MySQL pool: updates status (evidence: `backend/sources/services/CompleteTaskService.js`)
- Reopen task → MySQL pool: updates status (evidence: `backend/sources/services/ReopenTaskService.js`)
- Weather controller → Weather service and cache: executes (evidence: `backend/sources/controllers/WeatherController.js`)
- Weather service and cache → Weather API: fetches forecast (evidence: `backend/sources/services/WeatherService.js`)
