# tanjila-i/todo-mern-project architecture

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

- Interactive diagram: https://gitdiagram.com/tanjila-i/todo-mern-project
- Repository: https://github.com/tanjila-i/todo-mern-project

## Overview

This is a MERN to-do application. Users register or log in, reach the task screen, and create, view, edit, complete, or delete tasks; the backend exposes auth and task routes and persists domain data through MongoDB models. The graph includes the principal UI, API, domain, and persistence layers plus authentication utilities. Frontend store implementations and database connection details were not excerpted, so their runtime links are marked unverified rather than inferred from naming alone.

Main entry points: [`backend/server.js`](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/server.js) (Express Server), [`frontend/src/App.jsx`](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/App.jsx) (App Routing), [`backend/src/controllers/userController.js`](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/controllers/userController.js) (User Controller), [`frontend/src/pages/SignUpIn.jsx`](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/pages/SignUpIn.jsx) (Sign Up / Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app_entry["React Entry<br/>[main.jsx]"]
  node_app_routes["App Routing<br/>[App.jsx]"]
  node_signup["Sign Up / Login<br/>[SignUpIn.jsx]"]
  node_input["Form Input<br/>[Input.jsx]"]
  node_home["Task Screen<br/>[Home.jsx]"]
  node_floating["Floating Shapes<br/>[FloatingShap.jsx]"]
  node_auth_store["Auth Store<br/>[authStore.jsx]"]
  node_todo_store["Task Store<br/>[todoStore.jsx]"]
end

subgraph group_backend["Backend API"]
  node_api_server["Express Server<br/>[server.js]"]
  node_auth_routes["Auth Routes<br/>[userRoute.js]"]
  node_todo_routes["Task Routes<br/>[todoRoutes.js]"]
  node_auth_controller["User Controller<br/>[userController.js]"]
  node_todo_controller["Task Controller<br/>[todoController.js]"]
end

subgraph group_persistence["Persistence"]
  node_db_config["DB Connection<br/>[db.js]"]
  node_user_model["User Model<br/>[userModel.js]"]
  node_todo_model["Task Model<br/>[todoModel.js]"]
  node_mongo[("MongoDB")]
end

subgraph group_utilities["Auth Utilities"]
  node_error_handler["Error Helper<br/>[errorHandler.js]"]
  node_token["Token Generator<br/>[generateToken.js]"]
end

node_user(("User"))

node_user -->|"registers or logs in"| node_signup
node_user -->|"manages tasks"| node_home
node_app_entry -->|"renders"| node_app_routes
node_app_routes -->|"routes to"| node_signup
node_app_routes -->|"routes to"| node_home
node_app_routes -->|"renders"| node_floating
node_signup -->|"renders"| node_input
node_signup -->|"calls"| node_auth_store
node_home -->|"calls"| node_auth_store
node_home -->|"calls"| node_todo_store
node_auth_store -.->|"sends auth requests"| node_api_server
node_todo_store -.->|"sends task requests"| node_api_server
node_api_server -->|"connects on startup"| node_db_config
node_api_server -->|"mounts auth routes"| node_auth_routes
node_api_server -->|"mounts task routes"| node_todo_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_todo_routes -->|"dispatches"| node_todo_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"generates token"| node_token
node_auth_controller -->|"creates errors"| node_error_handler
node_todo_controller -->|"reads and writes"| node_todo_model
node_todo_controller -->|"creates errors"| node_error_handler
node_db_config -.->|"connects"| node_mongo
node_user_model -.->|"persists users"| node_mongo
node_todo_model -.->|"persists tasks"| node_mongo

click node_app_entry "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/main.jsx"
click node_app_routes "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/App.jsx"
click node_signup "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/pages/SignUpIn.jsx"
click node_input "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/components/Input.jsx"
click node_home "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/pages/Home.jsx"
click node_floating "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/components/FloatingShap.jsx"
click node_auth_store "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/store/authStore.jsx"
click node_todo_store "https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/store/todoStore.jsx"
click node_api_server "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/server.js"
click node_auth_routes "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/routes/userRoute.js"
click node_todo_routes "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/routes/todoRoutes.js"
click node_auth_controller "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/controllers/userController.js"
click node_todo_controller "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/controllers/todoController.js"
click node_db_config "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/config/db.js"
click node_user_model "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/models/userModel.js"
click node_todo_model "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/models/todoModel.js"
click node_error_handler "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/utils/errorHandler.js"
click node_token "https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/utils/generateToken.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_entry,node_app_routes,node_signup,node_input,node_home,node_floating,node_auth_store,node_todo_store,node_user toneBlue
class node_api_server,node_auth_routes,node_todo_routes,node_auth_controller,node_todo_controller toneAmber
class node_db_config,node_user_model,node_todo_model,node_mongo toneMint
class node_error_handler,node_token toneRose
```

## Components

### Frontend

- [React Entry](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [App Routing](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign Up / Login](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/pages/SignUpIn.jsx): `frontend/src/pages/SignUpIn.jsx`
- [Form Input](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/components/Input.jsx): `frontend/src/components/Input.jsx`
- [Task Screen](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Floating Shapes](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/components/FloatingShap.jsx): `frontend/src/components/FloatingShap.jsx`
- [Auth Store](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/store/authStore.jsx): `frontend/src/store/authStore.jsx`
- [Task Store](https://github.com/tanjila-i/todo-mern-project/blob/main/frontend/src/store/todoStore.jsx): `frontend/src/store/todoStore.jsx`

### Backend API

- [Express Server](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/server.js): `backend/server.js`
- [Auth Routes](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/routes/userRoute.js): `backend/src/routes/userRoute.js`
- [Task Routes](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/routes/todoRoutes.js): `backend/src/routes/todoRoutes.js`
- [User Controller](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/controllers/userController.js): `backend/src/controllers/userController.js`
- [Task Controller](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/controllers/todoController.js): `backend/src/controllers/todoController.js`

### Persistence

- [DB Connection](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [User Model](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/models/userModel.js): `backend/src/models/userModel.js`
- [Task Model](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/models/todoModel.js): `backend/src/models/todoModel.js`
- **MongoDB**

### Auth Utilities

- [Error Helper](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/utils/errorHandler.js): `backend/src/utils/errorHandler.js`
- [Token Generator](https://github.com/tanjila-i/todo-mern-project/blob/main/backend/src/utils/generateToken.js): `backend/src/utils/generateToken.js`

### Other components

- **User**

## Connections

- User → Sign Up / Login: registers or logs in (evidence: `frontend/src/pages/SignUpIn.jsx`)
- User → Task Screen: manages tasks (evidence: `frontend/src/pages/Home.jsx`)
- React Entry → App Routing: renders (evidence: `frontend/src/main.jsx`)
- App Routing → Sign Up / Login: routes to (evidence: `frontend/src/App.jsx`)
- App Routing → Task Screen: routes to (evidence: `frontend/src/App.jsx`)
- App Routing → Floating Shapes: renders (evidence: `frontend/src/App.jsx`)
- Sign Up / Login → Form Input: renders (evidence: `frontend/src/pages/SignUpIn.jsx`)
- Sign Up / Login → Auth Store: calls (evidence: `frontend/src/pages/SignUpIn.jsx`)
- Task Screen → Auth Store: calls (evidence: `frontend/src/pages/Home.jsx`)
- Task Screen → Task Store: calls (evidence: `frontend/src/pages/Home.jsx`)
- Auth Store → Express Server: sends auth requests
- Task Store → Express Server: sends task requests
- Express Server → DB Connection: connects on startup (evidence: `backend/server.js`)
- Express Server → Auth Routes: mounts auth routes (evidence: `backend/server.js`)
- Express Server → Task Routes: mounts task routes (evidence: `backend/server.js`)
- Auth Routes → User Controller: dispatches (evidence: `backend/src/routes/userRoute.js`)
- Task Routes → Task Controller: dispatches (evidence: `backend/src/routes/todoRoutes.js`)
- User Controller → User Model: reads and writes (evidence: `backend/src/controllers/userController.js`)
- User Controller → Token Generator: generates token (evidence: `backend/src/controllers/userController.js`)
- User Controller → Error Helper: creates errors (evidence: `backend/src/controllers/userController.js`)
- Task Controller → Task Model: reads and writes (evidence: `backend/src/controllers/todoController.js`)
- Task Controller → Error Helper: creates errors (evidence: `backend/src/controllers/todoController.js`)
- DB Connection → MongoDB: connects
- User Model → MongoDB: persists users
- Task Model → MongoDB: persists tasks
