# akul29git/to-do-application architecture

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

- Interactive diagram: https://gitdiagram.com/akul29git/to-do-application
- Repository: https://github.com/akul29git/to-do-application

## Overview

This is a browser-based todo and project manager, with username-based account creation/login, project organization, todo and subtodo editing, completion tracking, and legacy browser-todo import. The main workflow routes users through authentication into project or todo views; React context providers own state changes and call the API service. The excerpts establish client-side calls, but do not show the server’s persistence implementation or confirm its endpoint wiring, so that relationship is marked unverified.

Main entry points: [`src/App.jsx`](https://github.com/akul29git/to-do-application/blob/main/src/App.jsx) (Router and providers), [`src/hooks/useProjects.js`](https://github.com/akul29git/to-do-application/blob/main/src/hooks/useProjects.js) (Project hook), [`src/services/db.js`](https://github.com/akul29git/to-do-application/blob/main/src/services/db.js) (HTTP API client), [`src/components/Header.jsx`](https://github.com/akul29git/to-do-application/blob/main/src/components/Header.jsx) (Navigation header)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application routing"]
  node_app["Router and providers<br/>[App.jsx]"]
  node_header["Navigation header<br/>[Header.jsx]"]
end

subgraph group_identity["Identity and onboarding"]
  node_login["Login and import<br/>[Login.jsx]"]
  node_authstate["User state<br/>[UserContext.jsx]"]
  node_authhook["Auth hook<br/>[useAuthUser.js]"]
end

subgraph group_projects["Project management"]
  node_projectsview["Projects view<br/>[Projects.jsx]"]
  node_projectstate["Project state"]
  node_projecthook["Project hook<br/>[useProjects.js]"]
  node_projectcontrols["Project controls<br/>[ConfirmDelete.jsx]"]
end

subgraph group_todos["Todo management"]
  node_todosview["Todos view<br/>[Todos.jsx]"]
  node_todostate["Todo state<br/>[TodosContext.jsx]"]
  node_todohook["Todo hook<br/>[useTodos.js]"]
  node_todoitem["Todo and subtodos<br/>[TodoItem.jsx]"]
  node_todoform["Todo form<br/>[Todoform.jsx]"]
end

subgraph group_shared["Shared client services"]
  node_service["HTTP API client<br/>[db.js]"]
  node_server["API server<br/>[index.js]"]
  node_validators["Input validation<br/>[validators.js]"]
  node_wordcount["Word counting<br/>[wordCount.js]"]
  node_dateformat["Date formatting<br/>[formatDateTime.js]"]
end

node_person(("User"))

node_person -->|"uses"| node_app
node_app -->|"provides"| node_authstate
node_app -->|"checks session"| node_authhook
node_app -->|"routes unauthenticated"| node_login
node_app -->|"routes projects"| node_projectsview
node_app -->|"routes todos"| node_todosview
node_app -->|"provides"| node_projectstate
node_app -->|"provides"| node_todostate
node_app -->|"renders"| node_header
node_login -->|"uses"| node_authhook
node_login -->|"validates username"| node_validators
node_login -->|"imports legacy todos"| node_service
node_authstate -->|"loads and saves users"| node_service
node_authhook -->|"reads context"| node_authstate
node_projectsview -->|"uses"| node_projecthook
node_projectsview -->|"reads todo counts"| node_todohook
node_projectsview -->|"renders confirmation"| node_projectcontrols
node_projectstate -->|"loads and mutates projects"| node_service
node_projecthook -->|"reads context"| node_projectstate
node_todosview -->|"uses"| node_todohook
node_todosview -->|"uses"| node_projecthook
node_todosview -->|"renders"| node_todoitem
node_todostate -->|"loads and mutates todos"| node_service
node_todohook -->|"reads context"| node_todostate
node_todoitem -->|"checks descriptions"| node_validators
node_todoitem -->|"formats timestamps"| node_dateformat
node_todoform -->|"uses"| node_projecthook
node_todoform -->|"validates input"| node_validators
node_validators -->|"counts words"| node_wordcount
node_header -->|"uses"| node_authhook
node_header -->|"uses"| node_projecthook
node_header -->|"uses"| node_todohook
node_service -.->|"sends API requests"| node_server

click node_app "https://github.com/akul29git/to-do-application/blob/main/src/App.jsx"
click node_login "https://github.com/akul29git/to-do-application/blob/main/src/pages/Login.jsx"
click node_authstate "https://github.com/akul29git/to-do-application/blob/main/src/context/UserContext.jsx"
click node_authhook "https://github.com/akul29git/to-do-application/blob/main/src/hooks/useAuthUser.js"
click node_projectsview "https://github.com/akul29git/to-do-application/blob/main/src/pages/Projects.jsx"
click node_projectstate "https://github.com/akul29git/to-do-application/blob/main/src/context/ProjectsContext.jsx"
click node_projecthook "https://github.com/akul29git/to-do-application/blob/main/src/hooks/useProjects.js"
click node_projectcontrols "https://github.com/akul29git/to-do-application/blob/main/src/components/ConfirmDelete.jsx"
click node_todosview "https://github.com/akul29git/to-do-application/blob/main/src/pages/Todos.jsx"
click node_todostate "https://github.com/akul29git/to-do-application/blob/main/src/context/TodosContext.jsx"
click node_todohook "https://github.com/akul29git/to-do-application/blob/main/src/hooks/useTodos.js"
click node_todoitem "https://github.com/akul29git/to-do-application/blob/main/src/components/TodoItem.jsx"
click node_todoform "https://github.com/akul29git/to-do-application/blob/main/src/components/Todoform.jsx"
click node_header "https://github.com/akul29git/to-do-application/blob/main/src/components/Header.jsx"
click node_service "https://github.com/akul29git/to-do-application/blob/main/src/services/db.js"
click node_server "https://github.com/akul29git/to-do-application/blob/main/server/index.js"
click node_validators "https://github.com/akul29git/to-do-application/blob/main/src/utils/validators.js"
click node_wordcount "https://github.com/akul29git/to-do-application/blob/main/src/utils/wordCount.js"
click node_dateformat "https://github.com/akul29git/to-do-application/blob/main/src/utils/formatDateTime.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_header,node_person toneBlue
class node_login,node_authstate,node_authhook toneAmber
class node_projectsview,node_projectstate,node_projecthook,node_projectcontrols toneMint
class node_todosview,node_todostate,node_todohook,node_todoitem,node_todoform toneRose
class node_service,node_server,node_validators,node_wordcount,node_dateformat toneIndigo
```

## Components

### Application routing

- [Router and providers](https://github.com/akul29git/to-do-application/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation header](https://github.com/akul29git/to-do-application/blob/main/src/components/Header.jsx): `src/components/Header.jsx`

### Identity and onboarding

- [Login and import](https://github.com/akul29git/to-do-application/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [User state](https://github.com/akul29git/to-do-application/blob/main/src/context/UserContext.jsx): `src/context/UserContext.jsx`
- [Auth hook](https://github.com/akul29git/to-do-application/blob/main/src/hooks/useAuthUser.js): `src/hooks/useAuthUser.js`

### Project management

- [Projects view](https://github.com/akul29git/to-do-application/blob/main/src/pages/Projects.jsx): `src/pages/Projects.jsx`
- [Project state](https://github.com/akul29git/to-do-application/blob/main/src/context/ProjectsContext.jsx): `src/context/ProjectsContext.jsx`
- [Project hook](https://github.com/akul29git/to-do-application/blob/main/src/hooks/useProjects.js): `src/hooks/useProjects.js`
- [Project controls](https://github.com/akul29git/to-do-application/blob/main/src/components/ConfirmDelete.jsx): `src/components/ConfirmDelete.jsx`

### Todo management

- [Todos view](https://github.com/akul29git/to-do-application/blob/main/src/pages/Todos.jsx): `src/pages/Todos.jsx`
- [Todo state](https://github.com/akul29git/to-do-application/blob/main/src/context/TodosContext.jsx): `src/context/TodosContext.jsx`
- [Todo hook](https://github.com/akul29git/to-do-application/blob/main/src/hooks/useTodos.js): `src/hooks/useTodos.js`
- [Todo and subtodos](https://github.com/akul29git/to-do-application/blob/main/src/components/TodoItem.jsx): `src/components/TodoItem.jsx`
- [Todo form](https://github.com/akul29git/to-do-application/blob/main/src/components/Todoform.jsx): `src/components/Todoform.jsx`

### Shared client services

- [HTTP API client](https://github.com/akul29git/to-do-application/blob/main/src/services/db.js): `src/services/db.js`
- [API server](https://github.com/akul29git/to-do-application/blob/main/server/index.js): `server/index.js`
- [Input validation](https://github.com/akul29git/to-do-application/blob/main/src/utils/validators.js): `src/utils/validators.js`
- [Word counting](https://github.com/akul29git/to-do-application/blob/main/src/utils/wordCount.js): `src/utils/wordCount.js`
- [Date formatting](https://github.com/akul29git/to-do-application/blob/main/src/utils/formatDateTime.js): `src/utils/formatDateTime.js`

### Other components

- **User**

## Connections

- User → Router and providers: uses (evidence: `src/App.jsx`)
- Router and providers → User state: provides (evidence: `src/App.jsx`)
- Router and providers → Auth hook: checks session (evidence: `src/App.jsx`)
- Router and providers → Login and import: routes unauthenticated (evidence: `src/App.jsx`)
- Router and providers → Projects view: routes projects (evidence: `src/App.jsx`)
- Router and providers → Todos view: routes todos (evidence: `src/App.jsx`)
- Router and providers → Project state: provides (evidence: `src/App.jsx`)
- Router and providers → Todo state: provides (evidence: `src/App.jsx`)
- Router and providers → Navigation header: renders (evidence: `src/App.jsx`)
- Login and import → Auth hook: uses (evidence: `src/pages/Login.jsx`)
- Login and import → Input validation: validates username (evidence: `src/pages/Login.jsx`)
- Login and import → HTTP API client: imports legacy todos (evidence: `src/pages/Login.jsx`)
- User state → HTTP API client: loads and saves users (evidence: `src/context/UserContext.jsx`)
- Auth hook → User state: reads context (evidence: `src/hooks/useAuthUser.js`)
- Projects view → Project hook: uses (evidence: `src/pages/Projects.jsx`)
- Projects view → Todo hook: reads todo counts (evidence: `src/pages/Projects.jsx`)
- Projects view → Project controls: renders confirmation (evidence: `src/pages/Projects.jsx`)
- Project state → HTTP API client: loads and mutates projects (evidence: `src/context/ProjectsContext.jsx`)
- Project hook → Project state: reads context (evidence: `src/hooks/useProjects.js`)
- Todos view → Todo hook: uses (evidence: `src/pages/Todos.jsx`)
- Todos view → Project hook: uses (evidence: `src/pages/Todos.jsx`)
- Todos view → Todo and subtodos: renders (evidence: `src/pages/Todos.jsx`)
- Todo state → HTTP API client: loads and mutates todos (evidence: `src/context/TodosContext.jsx`)
- Todo hook → Todo state: reads context (evidence: `src/hooks/useTodos.js`)
- Todo and subtodos → Input validation: checks descriptions (evidence: `src/components/TodoItem.jsx`)
- Todo and subtodos → Date formatting: formats timestamps (evidence: `src/components/TodoItem.jsx`)
- Todo form → Project hook: uses (evidence: `src/components/Todoform.jsx`)
- Todo form → Input validation: validates input (evidence: `src/components/Todoform.jsx`)
- Input validation → Word counting: counts words (evidence: `src/utils/validators.js`)
- Navigation header → Auth hook: uses (evidence: `src/components/Header.jsx`)
- Navigation header → Project hook: uses (evidence: `src/components/Header.jsx`)
- Navigation header → Todo hook: uses (evidence: `src/components/Header.jsx`)
- HTTP API client → API server: sends API requests
