# wiem-kb/mern-todo architecture

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

- Interactive diagram: https://gitdiagram.com/wiem-kb/mern-todo
- Repository: https://github.com/wiem-kb/mern-todo

## Overview

MERN Todo is a single-user task manager: users add tasks, view the list, edit task text, toggle completion, and delete tasks. The React interface sends CRUD requests to an Express API; its controller validates and operates on Mongoose task records stored in MongoDB. The graph includes the principal UI components and backend layers. Frontend-to-API links are dashed because the configured API base URL is not shown, though the client requests and server routes are present.

Main entry points: [`client/src/ListItem.jsx`](https://github.com/wiem-kb/mern-todo/blob/main/client/src/ListItem.jsx) (Task actions), [`server/routes/todoRoutes.js`](https://github.com/wiem-kb/mern-todo/blob/main/server/routes/todoRoutes.js) (Todo routes), [`server/index.js`](https://github.com/wiem-kb/mern-todo/blob/main/server/index.js) (Server setup), [`client/src/ToDoList.jsx`](https://github.com/wiem-kb/mern-todo/blob/main/client/src/ToDoList.jsx) (Task form and fetch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["React interface"]
  node_app["App shell<br/>[App.jsx]"]
  node_todoform["Task form and fetch<br/>[ToDoList.jsx]"]
  node_list["Task actions<br/>[ListItem.jsx]"]
  node_skeleton["Loading skeleton"]
  node_tooltip["Action tooltips<br/>[Tooltip.jsx]"]
end

subgraph group_api["Express API"]
  node_server["Server setup<br/>[index.js]"]
  node_routes["Todo routes<br/>[todoRoutes.js]"]
  node_controller["Todo operations<br/>[todoController.js]"]
end

subgraph group_data["Task persistence"]
  node_model["Todo model<br/>[todoModel.js]"]
  node_mongodb[("MongoDB")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_todoform
node_todoform -->|"renders"| node_list
node_list -->|"wraps actions"| node_tooltip
node_list -->|"shows while loading"| node_skeleton
node_todoform -.->|"requests task CRUD"| node_routes
node_list -.->|"requests task updates"| node_routes
node_server -->|"mounts routes"| node_routes
node_server -->|"serves root handler"| node_controller
node_routes -->|"dispatches requests"| node_controller
node_controller -->|"queries records"| node_model
node_server -->|"connects to"| node_mongodb

click node_app "https://github.com/wiem-kb/mern-todo/blob/main/client/src/App.jsx"
click node_todoform "https://github.com/wiem-kb/mern-todo/blob/main/client/src/ToDoList.jsx"
click node_list "https://github.com/wiem-kb/mern-todo/blob/main/client/src/ListItem.jsx"
click node_skeleton "https://github.com/wiem-kb/mern-todo/blob/main/client/src/ListItemSkeleton.jsx"
click node_tooltip "https://github.com/wiem-kb/mern-todo/blob/main/client/src/Tooltip.jsx"
click node_server "https://github.com/wiem-kb/mern-todo/blob/main/server/index.js"
click node_routes "https://github.com/wiem-kb/mern-todo/blob/main/server/routes/todoRoutes.js"
click node_controller "https://github.com/wiem-kb/mern-todo/blob/main/server/controllers/todoController.js"
click node_model "https://github.com/wiem-kb/mern-todo/blob/main/server/models/todoModel.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_todoform,node_list,node_skeleton,node_tooltip,node_user toneBlue
class node_server,node_routes,node_controller toneAmber
class node_model,node_mongodb toneMint
```

## Components

### React interface

- [App shell](https://github.com/wiem-kb/mern-todo/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Task form and fetch](https://github.com/wiem-kb/mern-todo/blob/main/client/src/ToDoList.jsx): `client/src/ToDoList.jsx`
- [Task actions](https://github.com/wiem-kb/mern-todo/blob/main/client/src/ListItem.jsx): `client/src/ListItem.jsx`
- [Loading skeleton](https://github.com/wiem-kb/mern-todo/blob/main/client/src/ListItemSkeleton.jsx): `client/src/ListItemSkeleton.jsx`
- [Action tooltips](https://github.com/wiem-kb/mern-todo/blob/main/client/src/Tooltip.jsx): `client/src/Tooltip.jsx`

### Express API

- [Server setup](https://github.com/wiem-kb/mern-todo/blob/main/server/index.js): `server/index.js`
- [Todo routes](https://github.com/wiem-kb/mern-todo/blob/main/server/routes/todoRoutes.js): `server/routes/todoRoutes.js`
- [Todo operations](https://github.com/wiem-kb/mern-todo/blob/main/server/controllers/todoController.js): `server/controllers/todoController.js`

### Task persistence

- [Todo model](https://github.com/wiem-kb/mern-todo/blob/main/server/models/todoModel.js): `server/models/todoModel.js`
- **MongoDB**

### Other components

- **User**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Task form and fetch: renders (evidence: `client/src/App.jsx`)
- Task form and fetch → Task actions: renders (evidence: `client/src/ToDoList.jsx`)
- Task actions → Action tooltips: wraps actions (evidence: `client/src/ListItem.jsx`)
- Task actions → Loading skeleton: shows while loading (evidence: `client/src/ListItem.jsx`)
- Task form and fetch → Todo routes: requests task CRUD
- Task actions → Todo routes: requests task updates
- Server setup → Todo routes: mounts routes (evidence: `server/index.js`)
- Server setup → Todo operations: serves root handler (evidence: `server/index.js`)
- Todo routes → Todo operations: dispatches requests (evidence: `server/routes/todoRoutes.js`)
- Todo operations → Todo model: queries records (evidence: `server/controllers/todoController.js`)
- Server setup → MongoDB: connects to (evidence: `server/index.js`)
