# velicharlavarunreddy/o2h architecture

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

- Interactive diagram: https://gitdiagram.com/velicharlavarunreddy/o2h
- Repository: https://github.com/velicharlavarunreddy/o2h

## Overview

TaskFlow is a React task manager backed by an Express API and MySQL. Users register or log in, then manage their own tasks through a protected dashboard: search, filter, sort, paginate, view status statistics, create tasks, change status, and delete tasks. Frontend pages call API services; backend routes dispatch to controllers, which apply authentication and use models for persistence. The README documents dark mode and validation; those capabilities are represented without assuming unsampled implementation details. Some page-to-service relationships are documented but not directly excerpted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/App.jsx) (React app routes), [`frontend/src/services/authService.js`](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/services/authService.js) (Auth API client), [`frontend/src/pages/Dashboard.jsx`](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Dashboard.jsx) (Task dashboard), [`backend/app.js`](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/app.js) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["React app routes<br/>[App.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_register["Sign up<br/>[Register.jsx]"]
  node_protected["Route guard<br/>[ProtectedRoute.jsx]"]
  node_navbar["Navigation and theme<br/>[Navbar.jsx]"]
  node_dashboard["Task dashboard<br/>[Dashboard.jsx]"]
  node_stats["Progress stats<br/>[DashboardStats.jsx]"]
  node_taskcard["Task card<br/>[TaskCard.jsx]"]
  node_addtask["Create task form<br/>[AddTask.jsx]"]
  node_authsvc["Auth API client<br/>[authService.js]"]
  node_tasksvc["Task API client<br/>[taskService.js]"]
end

subgraph group_backend["API and security"]
  node_api["Express API<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_taskroutes["Task routes<br/>[taskRoutes.js]"]
  node_authmw["JWT verification<br/>[authMiddleware.js]"]
end

subgraph group_domain["Task and identity"]
  node_authcontroller["Auth operations<br/>[authController.js]"]
  node_taskcontroller["Task operations<br/>[taskController.js]"]
  node_user_model["User records<br/>[User.js]"]
  node_task_model["Task records<br/>[Task.js]"]
end

subgraph group_persistence["Persistence"]
  node_db[("MySQL connection<br/>[db.js]")]
end

node_user(("TaskFlow user"))
node_mysql[("MySQL database")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"protects route"| node_dashboard
node_app -->|"protects route"| node_addtask
node_app -->|"renders"| node_protected
node_app -->|"renders"| node_navbar
node_login -.->|"requests login"| node_authsvc
node_register -->|"requests signup"| node_authsvc
node_navbar -->|"uses auth"| node_authsvc
node_protected -->|"checks session"| node_authsvc
node_dashboard -->|"fetches tasks and stats"| node_tasksvc
node_dashboard -->|"renders"| node_stats
node_dashboard -->|"renders"| node_taskcard
node_dashboard -->|"navigates to"| node_addtask
node_addtask -->|"creates task"| node_tasksvc
node_tasksvc -->|"gets token"| node_authsvc
node_authsvc -->|"sends auth requests"| node_api
node_tasksvc -->|"sends task requests"| node_api
node_api -->|"mounts routes"| node_authroutes
node_api -->|"mounts routes"| node_taskroutes
node_api -->|"initializes"| node_db
node_authroutes -->|"dispatches to"| node_authcontroller
node_taskroutes -->|"checks JWT"| node_authmw
node_taskroutes -->|"dispatches to"| node_taskcontroller
node_authcontroller -->|"uses users"| node_user_model
node_taskcontroller -->|"uses tasks"| node_task_model
node_user_model -->|"queries"| node_db
node_task_model -->|"queries"| node_db
node_db -->|"connects and initializes"| node_mysql

click node_app "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/App.jsx"
click node_login "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Login.jsx"
click node_register "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Register.jsx"
click node_protected "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/ProtectedRoute.jsx"
click node_navbar "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/Navbar.jsx"
click node_dashboard "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Dashboard.jsx"
click node_stats "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/DashboardStats.jsx"
click node_taskcard "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/TaskCard.jsx"
click node_addtask "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/AddTask.jsx"
click node_authsvc "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/services/authService.js"
click node_tasksvc "https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/services/taskService.js"
click node_api "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/app.js"
click node_authroutes "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/routes/authRoutes.js"
click node_taskroutes "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/routes/taskRoutes.js"
click node_authcontroller "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/controllers/authController.js"
click node_authmw "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/middleware/authMiddleware.js"
click node_taskcontroller "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/controllers/taskController.js"
click node_user_model "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/models/User.js"
click node_task_model "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/models/Task.js"
click node_db "https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/config/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_app,node_login,node_register,node_protected,node_navbar,node_dashboard,node_stats,node_taskcard,node_addtask,node_authsvc,node_tasksvc toneBlue
class node_api,node_authroutes,node_taskroutes,node_authmw,node_mysql toneAmber
class node_authcontroller,node_taskcontroller,node_user_model,node_task_model toneMint
class node_db,node_user toneRose
```

## Components

### Frontend experience

- [React app routes](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Sign up](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [Route guard](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/ProtectedRoute.jsx): `frontend/src/components/ProtectedRoute.jsx`
- [Navigation and theme](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Task dashboard](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Progress stats](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/DashboardStats.jsx): `frontend/src/components/DashboardStats.jsx`
- [Task card](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/components/TaskCard.jsx): `frontend/src/components/TaskCard.jsx`
- [Create task form](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/pages/AddTask.jsx): `frontend/src/pages/AddTask.jsx`
- [Auth API client](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Task API client](https://github.com/velicharlavarunreddy/o2h/blob/varun/frontend/src/services/taskService.js): `frontend/src/services/taskService.js`

### API and security

- [Express API](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/app.js): `backend/app.js`
- [Auth routes](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Task routes](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/routes/taskRoutes.js): `backend/routes/taskRoutes.js`
- [JWT verification](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Task and identity

- [Auth operations](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Task operations](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/controllers/taskController.js): `backend/controllers/taskController.js`
- [User records](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/models/User.js): `backend/models/User.js`
- [Task records](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/models/Task.js): `backend/models/Task.js`

### Persistence

- [MySQL connection](https://github.com/velicharlavarunreddy/o2h/blob/varun/backend/config/db.js): `backend/config/db.js`

### Other components

- **TaskFlow user**
- **MySQL database**

## Connections

- TaskFlow user → React app routes: uses (evidence: `README.md`)
- React app routes → Sign in: routes to (evidence: `frontend/src/App.jsx`)
- React app routes → Sign up: routes to (evidence: `frontend/src/App.jsx`)
- React app routes → Task dashboard: protects route (evidence: `frontend/src/App.jsx`)
- React app routes → Create task form: protects route (evidence: `frontend/src/App.jsx`)
- React app routes → Route guard: renders (evidence: `frontend/src/App.jsx`)
- React app routes → Navigation and theme: renders (evidence: `frontend/src/App.jsx`)
- Sign in → Auth API client: requests login
- Sign up → Auth API client: requests signup (evidence: `frontend/src/pages/Register.jsx`)
- Navigation and theme → Auth API client: uses auth (evidence: `frontend/src/components/Navbar.jsx`)
- Route guard → Auth API client: checks session (evidence: `frontend/src/components/ProtectedRoute.jsx`)
- Task dashboard → Task API client: fetches tasks and stats (evidence: `frontend/src/pages/Dashboard.jsx`)
- Task dashboard → Progress stats: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Task dashboard → Task card: renders (evidence: `frontend/src/pages/Dashboard.jsx`)
- Task dashboard → Create task form: navigates to (evidence: `frontend/src/pages/Dashboard.jsx`)
- Create task form → Task API client: creates task (evidence: `frontend/src/pages/AddTask.jsx`)
- Task API client → Auth API client: gets token (evidence: `frontend/src/services/taskService.js`)
- Auth API client → Express API: sends auth requests (evidence: `frontend/src/services/authService.js`)
- Task API client → Express API: sends task requests (evidence: `frontend/src/services/taskService.js`)
- Express API → Auth routes: mounts routes (evidence: `backend/app.js`)
- Express API → Task routes: mounts routes (evidence: `backend/app.js`)
- Express API → MySQL connection: initializes (evidence: `backend/app.js`)
- Auth routes → Auth operations: dispatches to (evidence: `backend/routes/authRoutes.js`)
- Task routes → JWT verification: checks JWT (evidence: `backend/routes/taskRoutes.js`)
- Task routes → Task operations: dispatches to (evidence: `backend/routes/taskRoutes.js`)
- Auth operations → User records: uses users (evidence: `backend/controllers/authController.js`)
- Task operations → Task records: uses tasks (evidence: `backend/controllers/taskController.js`)
- User records → MySQL connection: queries (evidence: `backend/models/User.js`)
- Task records → MySQL connection: queries (evidence: `backend/models/Task.js`)
- MySQL connection → MySQL database: connects and initializes (evidence: `README.md`)
