# neerajbhat/taskmanagerapp architecture

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

- Interactive diagram: https://gitdiagram.com/neerajbhat/taskmanagerapp
- Repository: https://github.com/neerajbhat/taskmanagerapp

## Overview

This is an Express task-manager API. Users sign up or log in to receive JWT credentials, then use authenticated routes to manage their profile and owned tasks; profile routes also support avatar uploads and account emails. Task list requests support filtering, sorting and pagination, and deleting a user cascades to their tasks. The source shows route-to-model calls and the database connection setup; detailed wiring for unsampled infrastructure is not inferred.

Main entry points: [`src/routers/user.js`](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/user.js) (User routes), [`src/index.js`](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/index.js) (Express server), [`src/models/user.js`](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/models/user.js) (User model), [`src/routers/task.js`](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/task.js) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API runtime"]
  node_server["Express server<br/>[index.js]"]
end

subgraph group_identity["Accounts and auth"]
  node_user_routes["User routes<br/>[user.js]"]
  node_auth["JWT authentication<br/>[auth.js]"]
  node_user_model["User model<br/>[user.js]"]
  node_account_email["Account email<br/>[account.js]"]
  node_image_processing["Avatar processing<br/>[user.js]"]
end

subgraph group_tasks["Task management"]
  node_task_routes["Task routes<br/>[task.js]"]
  node_task_model["Task model<br/>[task.js]"]
end

subgraph group_persistence["Persistence and email"]
  node_mongo_connect["Mongo connection<br/>[mongoose.js]"]
  node_mongodb[("MongoDB")]
  node_sendgrid["SendGrid"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_user_routes
node_server -->|"mounts routes"| node_task_routes
node_server -->|"loads connection"| node_mongo_connect
node_mongo_connect -->|"connects"| node_mongodb
node_user_routes -->|"authenticates"| node_auth
node_task_routes -->|"authenticates"| node_auth
node_auth -->|"looks up token"| node_user_model
node_user_routes -->|"manages users"| node_user_model
node_user_routes -->|"sends account mail"| node_account_email
node_account_email -->|"sends email"| node_sendgrid
node_user_routes -->|"resizes avatars"| node_image_processing
node_task_routes -->|"manages tasks"| node_task_model
node_user_model -->|"deletes owned tasks"| node_task_model
node_user_model -->|"reads and writes"| node_mongodb
node_task_model -->|"reads and writes"| node_mongodb

click node_server "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/index.js"
click node_user_routes "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/user.js"
click node_task_routes "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/task.js"
click node_auth "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/middleware/auth.js"
click node_user_model "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/models/user.js"
click node_task_model "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/models/task.js"
click node_mongo_connect "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/db/mongoose.js"
click node_account_email "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/emails/account.js"
click node_image_processing "https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/user.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_model,node_account_email,node_image_processing toneAmber
class node_task_routes,node_task_model toneMint
class node_mongo_connect,node_mongodb,node_sendgrid toneRose
```

## Components

### API runtime

- [Express server](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/index.js): `src/index.js`

### Accounts and auth

- [User routes](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/user.js): `src/routers/user.js`
- [JWT authentication](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/middleware/auth.js): `src/middleware/auth.js`
- [User model](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/models/user.js): `src/models/user.js`
- [Account email](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/emails/account.js): `src/emails/account.js`
- [Avatar processing](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/user.js): `src/routers/user.js`

### Task management

- [Task routes](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/routers/task.js): `src/routers/task.js`
- [Task model](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/models/task.js): `src/models/task.js`

### Persistence and email

- [Mongo connection](https://github.com/neerajbhat/taskmanagerapp/blob/master/src/db/mongoose.js): `src/db/mongoose.js`
- **MongoDB**
- **SendGrid**

### Other components

- **API client**

## Connections

- API client → Express server: sends requests
- Express server → User routes: mounts routes
- Express server → Task routes: mounts routes
- Express server → Mongo connection: loads connection
- Mongo connection → MongoDB: connects
- User routes → JWT authentication: authenticates
- Task routes → JWT authentication: authenticates
- JWT authentication → User model: looks up token
- User routes → User model: manages users
- User routes → Account email: sends account mail
- Account email → SendGrid: sends email
- User routes → Avatar processing: resizes avatars
- Task routes → Task model: manages tasks
- User model → Task model: deletes owned tasks
- User model → MongoDB: reads and writes
- Task model → MongoDB: reads and writes
