# mlamine300/task-manager architecture

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

- Interactive diagram: https://gitdiagram.com/mlamine300/task-manager
- Repository: https://github.com/mlamine300/task-manager

## Overview

This MERN task manager lets admins and members sign in, manage assigned work, track progress, and view dashboards; admins also manage users and export reports. The React app routes users to role-specific screens, which call the Express API through a shared Axios client; backend routes dispatch to controllers that read and update MongoDB models. The README also documents priorities, due dates, descriptions, and secure route protection. Edges reflect explicit README or source-index references and shown calls; unsampled subsystem internals are represented by their exact directories.

Main entry points: [`frontend/task-manager/src/utils/axiosInstance.ts`](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/axiosInstance.ts) (API client), [`backend/src/models/User.ts`](https://github.com/mlamine300/task-manager/blob/main/backend/src/models/User.ts) (User records), [`frontend/task-manager/src/App.tsx`](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/App.tsx) (Route application), [`backend/src/app.ts`](https://github.com/mlamine300/task-manager/blob/main/backend/src/app.ts) (HTTP application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route application<br/>[App.tsx]"]
  node_auth_pages["Sign-in and signup"]
  node_dash["Dashboard<br/>[Dashboard.tsx]"]
  node_task_ui["Task workflows"]
  node_user_admin["User administration<br/>[ManageUsers.tsx]"]
  node_client_api["API client<br/>[axiosInstance.ts]"]
  node_api_paths["API paths<br/>[apiPaths.ts]"]
  node_token["Token state<br/>[tokenService.ts]"]
  node_reports["Report export<br/>[ManageTasks.tsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP application<br/>[app.ts]"]
  node_auth_routes["Auth routes<br/>[authRoutes.ts]"]
  node_task_routes["Task routes<br/>[taskRoutes.ts]"]
  node_user_routes["User routes<br/>[userRoutes.ts]"]
  node_report_routes["Report routes<br/>[reportRoutes.ts]"]
end

subgraph group_domain["Domain services"]
  node_auth_ctrl["Authentication<br/>[authController.ts]"]
  node_task_ctrl["Task management<br/>[taskController.ts]"]
  node_user_ctrl["User management<br/>[userController.ts]"]
  node_report_ctrl["Reporting"]
  node_auth_mw["JWT protection<br/>[authMiddleware.ts]"]
  node_upload["Image uploads"]
end

subgraph group_persistence["MongoDB persistence"]
  node_user_model[("User records<br/>[User.ts]")]
  node_task_model[("Task records<br/>[Task.ts]")]
end

node_member(("User"))
node_mongo[("MongoDB")]

node_member -->|"uses"| node_app
node_app -->|"routes to"| node_auth_pages
node_app -->|"routes to"| node_dash
node_app -->|"routes to"| node_task_ui
node_app -->|"routes to"| node_user_admin
node_auth_pages -->|"calls"| node_client_api
node_auth_pages -->|"updates"| node_token
node_dash -->|"fetches data"| node_client_api
node_task_ui -->|"calls"| node_client_api
node_user_admin -->|"calls"| node_client_api
node_client_api -->|"uses"| node_api_paths
node_client_api -->|"reads token"| node_token
node_client_api -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_task_routes
node_server -->|"mounts"| node_user_routes
node_server -->|"mounts"| node_report_routes
node_auth_routes -->|"dispatches"| node_auth_ctrl
node_auth_routes -->|"protects"| node_auth_mw
node_auth_routes -->|"configures upload"| node_upload
node_task_routes -->|"dispatches"| node_task_ctrl
node_task_routes -->|"protects"| node_auth_mw
node_user_routes -->|"dispatches"| node_user_ctrl
node_user_routes -->|"protects"| node_auth_mw
node_report_routes -->|"dispatches"| node_report_ctrl
node_report_routes -->|"protects"| node_auth_mw
node_auth_ctrl -->|"reads and writes"| node_user_model
node_auth_ctrl -->|"defines schema"| node_user_model
node_auth_ctrl -->|"uses tasks"| node_task_model
node_task_ctrl -->|"reads and writes"| node_task_model
node_task_ctrl -->|"uses users"| node_user_model
node_user_ctrl -->|"reads and writes"| node_user_model
node_user_ctrl -->|"uses tasks"| node_task_model
node_report_ctrl -->|"queries"| node_task_model
node_report_ctrl -->|"queries"| node_user_model
node_auth_mw -->|"loads user"| node_user_model
node_reports -->|"downloads export"| node_client_api
node_user_model -.->|"persists"| node_mongo
node_task_model -.->|"persists"| node_mongo

click node_app "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/App.tsx"
click node_auth_pages "https://github.com/mlamine300/task-manager/tree/main/frontend/task-manager/src/pages/Auth"
click node_dash "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/Dashboard.tsx"
click node_task_ui "https://github.com/mlamine300/task-manager/tree/main/frontend/task-manager/src/pages"
click node_user_admin "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/Admin/ManageUsers.tsx"
click node_client_api "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/axiosInstance.ts"
click node_api_paths "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/apiPaths.ts"
click node_token "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/tokenService.ts"
click node_server "https://github.com/mlamine300/task-manager/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/authRoutes.ts"
click node_task_routes "https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/taskRoutes.ts"
click node_user_routes "https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/userRoutes.ts"
click node_report_routes "https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/reportRoutes.ts"
click node_auth_ctrl "https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/authController.ts"
click node_task_ctrl "https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/taskController.ts"
click node_user_ctrl "https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/userController.ts"
click node_report_ctrl "https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/reportController.ts"
click node_auth_mw "https://github.com/mlamine300/task-manager/blob/main/backend/src/middlewares/authMiddleware.ts"
click node_upload "https://github.com/mlamine300/task-manager/blob/main/backend/src/middlewares/uploadMiddleware.ts"
click node_user_model "https://github.com/mlamine300/task-manager/blob/main/backend/src/models/User.ts"
click node_task_model "https://github.com/mlamine300/task-manager/blob/main/backend/src/models/Task.ts"
click node_reports "https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/ManageTasks.tsx"

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_auth_pages,node_dash,node_task_ui,node_user_admin,node_client_api,node_api_paths,node_token,node_reports,node_member toneBlue
class node_server,node_auth_routes,node_task_routes,node_user_routes,node_report_routes,node_mongo toneAmber
class node_auth_ctrl,node_task_ctrl,node_user_ctrl,node_report_ctrl,node_auth_mw,node_upload toneMint
class node_user_model,node_task_model toneRose
```

## Components

### Web client

- [Route application](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/App.tsx): `frontend/task-manager/src/App.tsx`
- [Sign-in and signup](https://github.com/mlamine300/task-manager/tree/main/frontend/task-manager/src/pages/Auth): `frontend/task-manager/src/pages/Auth`
- [Dashboard](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/Dashboard.tsx): `frontend/task-manager/src/pages/Dashboard.tsx`
- [Task workflows](https://github.com/mlamine300/task-manager/tree/main/frontend/task-manager/src/pages): `frontend/task-manager/src/pages`
- [User administration](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/Admin/ManageUsers.tsx): `frontend/task-manager/src/pages/Admin/ManageUsers.tsx`
- [API client](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/axiosInstance.ts): `frontend/task-manager/src/utils/axiosInstance.ts`
- [API paths](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/apiPaths.ts): `frontend/task-manager/src/utils/apiPaths.ts`
- [Token state](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/utils/tokenService.ts): `frontend/task-manager/src/utils/tokenService.ts`
- [Report export](https://github.com/mlamine300/task-manager/blob/main/frontend/task-manager/src/pages/ManageTasks.tsx): `frontend/task-manager/src/pages/ManageTasks.tsx`

### Backend API

- [HTTP application](https://github.com/mlamine300/task-manager/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/authRoutes.ts): `backend/src/routes/authRoutes.ts`
- [Task routes](https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/taskRoutes.ts): `backend/src/routes/taskRoutes.ts`
- [User routes](https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/userRoutes.ts): `backend/src/routes/userRoutes.ts`
- [Report routes](https://github.com/mlamine300/task-manager/blob/main/backend/src/routes/reportRoutes.ts): `backend/src/routes/reportRoutes.ts`

### Domain services

- [Authentication](https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/authController.ts): `backend/src/controllers/authController.ts`
- [Task management](https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/taskController.ts): `backend/src/controllers/taskController.ts`
- [User management](https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/userController.ts): `backend/src/controllers/userController.ts`
- [Reporting](https://github.com/mlamine300/task-manager/blob/main/backend/src/controllers/reportController.ts): `backend/src/controllers/reportController.ts`
- [JWT protection](https://github.com/mlamine300/task-manager/blob/main/backend/src/middlewares/authMiddleware.ts): `backend/src/middlewares/authMiddleware.ts`
- [Image uploads](https://github.com/mlamine300/task-manager/blob/main/backend/src/middlewares/uploadMiddleware.ts): `backend/src/middlewares/uploadMiddleware.ts`

### MongoDB persistence

- [User records](https://github.com/mlamine300/task-manager/blob/main/backend/src/models/User.ts): `backend/src/models/User.ts`
- [Task records](https://github.com/mlamine300/task-manager/blob/main/backend/src/models/Task.ts): `backend/src/models/Task.ts`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Route application: uses (evidence: `frontend/task-manager/src/App.tsx`)
- Route application → Sign-in and signup: routes to (evidence: `frontend/task-manager/src/App.tsx`)
- Route application → Dashboard: routes to (evidence: `frontend/task-manager/src/App.tsx`)
- Route application → Task workflows: routes to (evidence: `frontend/task-manager/src/App.tsx`)
- Route application → User administration: routes to (evidence: `frontend/task-manager/src/App.tsx`)
- Sign-in and signup → API client: calls (evidence: `frontend/task-manager/src/pages/Auth/Login.tsx`)
- Sign-in and signup → Token state: updates (evidence: `frontend/task-manager/src/pages/Auth/Login.tsx`)
- Dashboard → API client: fetches data (evidence: `frontend/task-manager/src/pages/Dashboard.tsx`)
- Task workflows → API client: calls (evidence: `frontend/task-manager/src/pages/ManageTasks.tsx`)
- User administration → API client: calls (evidence: `frontend/task-manager/src/pages/Admin/ManageUsers.tsx`)
- API client → API paths: uses (evidence: `frontend/task-manager/src/utils/axiosInstance.ts`)
- API client → Token state: reads token (evidence: `frontend/task-manager/src/utils/axiosInstance.ts`)
- API client → HTTP application: HTTP requests
- HTTP application → Auth routes: mounts (evidence: `backend/src/app.ts`)
- HTTP application → Task routes: mounts (evidence: `backend/src/app.ts`)
- HTTP application → User routes: mounts (evidence: `backend/src/app.ts`)
- HTTP application → Report routes: mounts (evidence: `backend/src/app.ts`)
- Auth routes → Authentication: dispatches (evidence: `backend/src/routes/authRoutes.ts`)
- Auth routes → JWT protection: protects (evidence: `backend/src/routes/authRoutes.ts`)
- Auth routes → Image uploads: configures upload (evidence: `backend/src/routes/authRoutes.ts`)
- Task routes → Task management: dispatches (evidence: `backend/src/routes/taskRoutes.ts`)
- Task routes → JWT protection: protects (evidence: `backend/src/routes/taskRoutes.ts`)
- User routes → User management: dispatches (evidence: `backend/src/routes/userRoutes.ts`)
- User routes → JWT protection: protects (evidence: `backend/src/routes/userRoutes.ts`)
- Report routes → Reporting: dispatches (evidence: `backend/src/routes/reportRoutes.ts`)
- Report routes → JWT protection: protects (evidence: `backend/src/routes/reportRoutes.ts`)
- Authentication → User records: reads and writes (evidence: `backend/src/controllers/authController.ts`)
- Authentication → User records: defines schema (evidence: `backend/src/models/User.ts`)
- Authentication → Task records: uses tasks
- Task management → Task records: reads and writes (evidence: `backend/src/controllers/taskController.ts`)
- Task management → User records: uses users (evidence: `backend/src/controllers/taskController.ts`)
- User management → User records: reads and writes (evidence: `backend/src/controllers/userController.ts`)
- User management → Task records: uses tasks (evidence: `backend/src/controllers/userController.ts`)
- Reporting → Task records: queries (evidence: `backend/src/controllers/reportController.ts`)
- Reporting → User records: queries (evidence: `backend/src/controllers/reportController.ts`)
- JWT protection → User records: loads user (evidence: `backend/src/middlewares/authMiddleware.ts`)
- Report export → API client: downloads export (evidence: `frontend/task-manager/src/pages/ManageTasks.tsx`)
- User records → MongoDB: persists
- Task records → MongoDB: persists
