# projettaskflow/taskflowapi architecture

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

- Interactive diagram: https://gitdiagram.com/projettaskflow/taskflowapi
- Repository: https://github.com/projettaskflow/taskflowapi

## Overview

TaskFlow is a Node.js/Express REST API for user accounts, projects, and tasks, backed by MySQL. The principal workflow is an HTTP client request routed by the server, dispatched through a domain router and controller, then answered using model operations; account flows also include registration, login, session verification, and profile/password updates. Source excerpts show the project and user persistence calls and the task controller’s model calls, but the task model excerpt was not supplied, so its database relationship is supported only by the source index. The README also documents login and user lookup endpoints.

Main entry points: [`server.js`](https://github.com/projettaskflow/taskflowapi/blob/main/server.js) (Express server), [`db.js`](https://github.com/projettaskflow/taskflowapi/blob/main/db.js) (MySQL pool), [`utilisateur/routes/UtilisateurRouter.js`](https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/routes/UtilisateurRouter.js) (User routes), [`utilisateur/controllers/UtilisateurController.js`](https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/controllers/UtilisateurController.js) (Account workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_server["Express server<br/>[server.js]"]
end

subgraph group_identity["Accounts and auth"]
  node_user_routes["User routes"]
  node_auth["Token verification<br/>[authMiddleware.js]"]
  node_user_controller["Account workflows"]
  node_user_model["User data and passwords"]
end

subgraph group_projects["Project management"]
  node_project_routes["Project routes<br/>[ProjetRouter.js]"]
  node_project_controller["Project workflows"]
  node_project_model["Project queries<br/>[ProjetModel.js]"]
end

subgraph group_tasks["Task management"]
  node_task_routes["Task routes<br/>[TacheRouter.js]"]
  node_task_controller["Task workflows<br/>[TacheController.js]"]
  node_task_model["Task queries<br/>[TacheModel.js]"]
end

subgraph group_persistence["Persistence"]
  node_db_pool["MySQL pool<br/>[db.js]"]
end

node_client(("HTTP client"))
node_mysql[("MySQL database")]

node_client -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_user_routes
node_server -->|"mounts routes"| node_project_routes
node_server -->|"mounts routes"| node_task_routes
node_user_routes -->|"dispatches to"| node_user_controller
node_user_routes -->|"checks sessions"| node_auth
node_user_controller -->|"calls"| node_user_model
node_project_routes -->|"dispatches to"| node_project_controller
node_project_controller -->|"calls"| node_project_model
node_task_routes -->|"dispatches to"| node_task_controller
node_task_controller -->|"calls"| node_task_model
node_user_model -->|"queries"| node_db_pool
node_project_model -->|"queries"| node_db_pool
node_task_model -->|"queries"| node_db_pool
node_db_pool -->|"connects to"| node_mysql

click node_server "https://github.com/projettaskflow/taskflowapi/blob/main/server.js"
click node_user_routes "https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/routes/UtilisateurRouter.js"
click node_auth "https://github.com/projettaskflow/taskflowapi/blob/main/middleware/authMiddleware.js"
click node_user_controller "https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/controllers/UtilisateurController.js"
click node_user_model "https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/models/UtilisateurModel.js"
click node_project_routes "https://github.com/projettaskflow/taskflowapi/blob/main/projet/routes/ProjetRouter.js"
click node_project_controller "https://github.com/projettaskflow/taskflowapi/blob/main/projet/controllers/ProjetController.js"
click node_project_model "https://github.com/projettaskflow/taskflowapi/blob/main/projet/models/ProjetModel.js"
click node_task_routes "https://github.com/projettaskflow/taskflowapi/blob/main/tache/routes/TacheRouter.js"
click node_task_controller "https://github.com/projettaskflow/taskflowapi/blob/main/tache/controllers/TacheController.js"
click node_task_model "https://github.com/projettaskflow/taskflowapi/blob/main/tache/models/TacheModel.js"
click node_db_pool "https://github.com/projettaskflow/taskflowapi/blob/main/db.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_server,node_client toneBlue
class node_user_routes,node_auth,node_user_controller,node_user_model,node_mysql toneAmber
class node_project_routes,node_project_controller,node_project_model toneMint
class node_task_routes,node_task_controller,node_task_model toneRose
class node_db_pool toneIndigo
```

## Components

### API entry

- [Express server](https://github.com/projettaskflow/taskflowapi/blob/main/server.js): `server.js`

### Accounts and auth

- [User routes](https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/routes/UtilisateurRouter.js): `utilisateur/routes/UtilisateurRouter.js`
- [Token verification](https://github.com/projettaskflow/taskflowapi/blob/main/middleware/authMiddleware.js): `middleware/authMiddleware.js`
- [Account workflows](https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/controllers/UtilisateurController.js): `utilisateur/controllers/UtilisateurController.js`
- [User data and passwords](https://github.com/projettaskflow/taskflowapi/blob/main/utilisateur/models/UtilisateurModel.js): `utilisateur/models/UtilisateurModel.js`

### Project management

- [Project routes](https://github.com/projettaskflow/taskflowapi/blob/main/projet/routes/ProjetRouter.js): `projet/routes/ProjetRouter.js`
- [Project workflows](https://github.com/projettaskflow/taskflowapi/blob/main/projet/controllers/ProjetController.js): `projet/controllers/ProjetController.js`
- [Project queries](https://github.com/projettaskflow/taskflowapi/blob/main/projet/models/ProjetModel.js): `projet/models/ProjetModel.js`

### Task management

- [Task routes](https://github.com/projettaskflow/taskflowapi/blob/main/tache/routes/TacheRouter.js): `tache/routes/TacheRouter.js`
- [Task workflows](https://github.com/projettaskflow/taskflowapi/blob/main/tache/controllers/TacheController.js): `tache/controllers/TacheController.js`
- [Task queries](https://github.com/projettaskflow/taskflowapi/blob/main/tache/models/TacheModel.js): `tache/models/TacheModel.js`

### Persistence

- [MySQL pool](https://github.com/projettaskflow/taskflowapi/blob/main/db.js): `db.js`

### Other components

- **HTTP client**
- **MySQL database**

## Connections

- HTTP client → Express server: sends requests (evidence: `README.md`)
- Express server → User routes: mounts routes (evidence: `server.js`)
- Express server → Project routes: mounts routes (evidence: `server.js`)
- Express server → Task routes: mounts routes (evidence: `server.js`)
- User routes → Account workflows: dispatches to (evidence: `utilisateur/routes/UtilisateurRouter.js`)
- User routes → Token verification: checks sessions (evidence: `utilisateur/routes/UtilisateurRouter.js`)
- Account workflows → User data and passwords: calls (evidence: `utilisateur/controllers/UtilisateurController.js`)
- Project routes → Project workflows: dispatches to (evidence: `projet/routes/ProjetRouter.js`)
- Project workflows → Project queries: calls (evidence: `projet/controllers/ProjetController.js`)
- Task routes → Task workflows: dispatches to (evidence: `tache/routes/TacheRouter.js`)
- Task workflows → Task queries: calls (evidence: `tache/controllers/TacheController.js`)
- User data and passwords → MySQL pool: queries (evidence: `utilisateur/models/UtilisateurModel.js`)
- Project queries → MySQL pool: queries (evidence: `projet/models/ProjetModel.js`)
- Task queries → MySQL pool: queries (evidence: `tache/models/TacheModel.js`)
- MySQL pool → MySQL database: connects to (evidence: `db.js`)
