# roshini-28/todo-app architecture

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

- Interactive diagram: https://gitdiagram.com/roshini-28/todo-app
- Repository: https://github.com/roshini-28/todo-app

## Overview

This is a full-stack task and project-management app with authentication and an optional AI assistant. The principal workflow runs from the dashboard through frontend API calls to FastAPI routes, business services, and MongoDB, with results returned to the UI. The README documents task filtering, search, sorting, page organization, and AI suggestions. The tree and excerpts show both a traditional AI suggestion route and a separate agent-based AI stack; where their wiring is not explicit, the graph avoids asserting it.

Main entry points: [`frontend/app/page.js`](https://github.com/roshini-28/todo-app/blob/main/frontend/app/page.js) (Dashboard), [`backend/main.py`](https://github.com/roshini-28/todo-app/blob/main/backend/main.py) (FastAPI entry), [`backend/routes/auth.py`](https://github.com/roshini-28/todo-app/blob/main/backend/routes/auth.py) (Auth routes), [`backend/middleware/auth_middleware.py`](https://github.com/roshini-28/todo-app/blob/main/backend/middleware/auth_middleware.py) (Auth guard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_dashboard["Dashboard<br/>[page.js]"]
  node_task_ui["Task controls<br/>[TodoList.js]"]
  node_task_item["Task item<br/>[TodoItem.js]"]
  node_page_ui["Project navigation<br/>[Sidebar.js]"]
  node_task_forms["Task forms<br/>[AddTaskModal.js]"]
  node_edit_form["Edit task<br/>[EditTaskModal.js]"]
  node_search_ui["Search and filters<br/>[SearchBar.js]"]
  node_ai_chat_ui["AI chat<br/>[AIChat.js]"]
  node_frontend_auth["Auth client<br/>[auth.js]"]
  node_frontend_api["API client<br/>[api.js]"]
end

subgraph group_backend["Backend API and domain"]
  node_api_entry["FastAPI entry<br/>[main.py]"]
  node_task_routes["Task routes<br/>[tasks.py]"]
  node_page_routes["Page routes<br/>[pages.py]"]
  node_auth_routes["Auth routes<br/>[auth.py]"]
  node_task_service["Task operations<br/>[task_service.py]"]
  node_page_service["Page operations<br/>[page_service.py]"]
end

subgraph group_identity["Identity and persistence"]
  node_auth_service["Token service<br/>[auth_service.py]"]
  node_auth_middleware["Auth guard<br/>[auth_middleware.py]"]
  node_user_service["User accounts<br/>[user_service.py]"]
  node_mongo[("MongoDB<br/>[mongodb.py]")]
end

subgraph group_ai["AI assistance"]
  node_ai_routes["AI endpoints<br/>[ai.py]"]
  node_ai_chat_route["Agent chat route<br/>[ai.py]"]
  node_ai_service["Suggestion service<br/>[ai_service.py]"]
  node_agent_service["Todo agent<br/>[todo_agent.py]"]
  node_todo_tools["Todo tools<br/>[todo_tools.py]"]
  node_llm_client["LLM client<br/>[litellm_client.py]"]
  node_provider_config["Provider configuration<br/>[settings.py]"]
  node_llm_providers["Provider adapters<br/>[providers.py]"]
  node_llm_service["Chat generation<br/>[ai_service.py]"]
end

node_user(("User"))
node_llm_external(("LLM providers"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"renders"| node_task_ui
node_dashboard -->|"renders"| node_page_ui
node_dashboard -->|"opens"| node_task_forms
node_dashboard -->|"opens"| node_edit_form
node_dashboard -->|"renders"| node_search_ui
node_task_ui -->|"renders"| node_task_item
node_dashboard -->|"checks session"| node_frontend_auth
node_dashboard -->|"loads and updates"| node_frontend_api
node_dashboard -->|"renders"| node_ai_chat_ui
node_frontend_auth -->|"sends auth requests"| node_auth_routes
node_frontend_api -->|"sends REST requests"| node_api_entry
node_api_entry -->|"registers"| node_task_routes
node_api_entry -->|"registers"| node_page_routes
node_api_entry -->|"registers"| node_auth_routes
node_api_entry -->|"registers"| node_ai_routes
node_api_entry -->|"registers"| node_ai_chat_route
node_task_routes -->|"calls"| node_task_service
node_page_routes -->|"calls"| node_page_service
node_auth_routes -->|"calls"| node_user_service
node_auth_routes -->|"creates tokens"| node_auth_service
node_task_routes -->|"requires user"| node_auth_middleware
node_page_routes -->|"requires user"| node_auth_middleware
node_auth_middleware -->|"validates token"| node_auth_service
node_auth_middleware -->|"loads user"| node_user_service
node_task_service -->|"reads and writes"| node_mongo
node_page_service -->|"reads and writes"| node_mongo
node_user_service -->|"reads and writes"| node_mongo
node_ai_routes -->|"calls"| node_ai_service
node_ai_chat_route -->|"calls"| node_llm_service
node_agent_service -->|"uses tools"| node_todo_tools
node_agent_service -->|"generates with"| node_llm_client
node_todo_tools -->|"uses task operations"| node_task_service
node_todo_tools -->|"uses page operations"| node_page_service
node_llm_client -->|"selects provider"| node_llm_providers
node_llm_providers -->|"reads settings"| node_provider_config
node_llm_service -->|"reads settings"| node_provider_config
node_llm_service -->|"requests completion"| node_llm_external

click node_dashboard "https://github.com/roshini-28/todo-app/blob/main/frontend/app/page.js"
click node_task_ui "https://github.com/roshini-28/todo-app/blob/main/frontend/components/TodoList.js"
click node_task_item "https://github.com/roshini-28/todo-app/blob/main/frontend/components/TodoItem.js"
click node_page_ui "https://github.com/roshini-28/todo-app/blob/main/frontend/components/Sidebar.js"
click node_task_forms "https://github.com/roshini-28/todo-app/blob/main/frontend/components/AddTaskModal.js"
click node_edit_form "https://github.com/roshini-28/todo-app/blob/main/frontend/components/EditTaskModal.js"
click node_search_ui "https://github.com/roshini-28/todo-app/blob/main/frontend/components/SearchBar.js"
click node_ai_chat_ui "https://github.com/roshini-28/todo-app/blob/main/frontend/components/AIChat.js"
click node_frontend_auth "https://github.com/roshini-28/todo-app/blob/main/frontend/services/auth.js"
click node_frontend_api "https://github.com/roshini-28/todo-app/blob/main/frontend/services/api.js"
click node_api_entry "https://github.com/roshini-28/todo-app/blob/main/backend/main.py"
click node_task_routes "https://github.com/roshini-28/todo-app/blob/main/backend/routes/tasks.py"
click node_page_routes "https://github.com/roshini-28/todo-app/blob/main/backend/routes/pages.py"
click node_auth_routes "https://github.com/roshini-28/todo-app/blob/main/backend/routes/auth.py"
click node_task_service "https://github.com/roshini-28/todo-app/blob/main/backend/services/task_service.py"
click node_page_service "https://github.com/roshini-28/todo-app/blob/main/backend/services/page_service.py"
click node_auth_service "https://github.com/roshini-28/todo-app/blob/main/backend/services/auth_service.py"
click node_auth_middleware "https://github.com/roshini-28/todo-app/blob/main/backend/middleware/auth_middleware.py"
click node_user_service "https://github.com/roshini-28/todo-app/blob/main/backend/services/user_service.py"
click node_mongo "https://github.com/roshini-28/todo-app/blob/main/backend/database/mongodb.py"
click node_ai_routes "https://github.com/roshini-28/todo-app/blob/main/backend/routes/ai.py"
click node_ai_chat_route "https://github.com/roshini-28/todo-app/blob/main/backend/app/api/routes/ai.py"
click node_ai_service "https://github.com/roshini-28/todo-app/blob/main/backend/services/ai_service.py"
click node_agent_service "https://github.com/roshini-28/todo-app/blob/main/backend/app/agents/todo_agent.py"
click node_todo_tools "https://github.com/roshini-28/todo-app/blob/main/backend/app/tools/todo_tools.py"
click node_llm_client "https://github.com/roshini-28/todo-app/blob/main/backend/app/ai/litellm_client.py"
click node_provider_config "https://github.com/roshini-28/todo-app/blob/main/backend/app/config/settings.py"
click node_llm_providers "https://github.com/roshini-28/todo-app/blob/main/backend/app/ai/providers.py"
click node_llm_service "https://github.com/roshini-28/todo-app/blob/main/backend/app/services/ai_service.py"

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_dashboard,node_task_ui,node_task_item,node_page_ui,node_task_forms,node_edit_form,node_search_ui,node_ai_chat_ui,node_frontend_auth,node_frontend_api,node_user toneBlue
class node_api_entry,node_task_routes,node_page_routes,node_auth_routes,node_task_service,node_page_service toneAmber
class node_auth_service,node_auth_middleware,node_user_service,node_mongo toneMint
class node_ai_routes,node_ai_chat_route,node_ai_service,node_agent_service,node_todo_tools,node_llm_client,node_provider_config,node_llm_providers,node_llm_service toneRose
class node_llm_external toneIndigo
```

## Components

### Frontend experience

- [Dashboard](https://github.com/roshini-28/todo-app/blob/main/frontend/app/page.js): `frontend/app/page.js`
- [Task controls](https://github.com/roshini-28/todo-app/blob/main/frontend/components/TodoList.js): `frontend/components/TodoList.js`
- [Task item](https://github.com/roshini-28/todo-app/blob/main/frontend/components/TodoItem.js): `frontend/components/TodoItem.js`
- [Project navigation](https://github.com/roshini-28/todo-app/blob/main/frontend/components/Sidebar.js): `frontend/components/Sidebar.js`
- [Task forms](https://github.com/roshini-28/todo-app/blob/main/frontend/components/AddTaskModal.js): `frontend/components/AddTaskModal.js`
- [Edit task](https://github.com/roshini-28/todo-app/blob/main/frontend/components/EditTaskModal.js): `frontend/components/EditTaskModal.js`
- [Search and filters](https://github.com/roshini-28/todo-app/blob/main/frontend/components/SearchBar.js): `frontend/components/SearchBar.js`
- [AI chat](https://github.com/roshini-28/todo-app/blob/main/frontend/components/AIChat.js): `frontend/components/AIChat.js`
- [Auth client](https://github.com/roshini-28/todo-app/blob/main/frontend/services/auth.js): `frontend/services/auth.js`
- [API client](https://github.com/roshini-28/todo-app/blob/main/frontend/services/api.js): `frontend/services/api.js`

### Backend API and domain

- [FastAPI entry](https://github.com/roshini-28/todo-app/blob/main/backend/main.py): `backend/main.py`
- [Task routes](https://github.com/roshini-28/todo-app/blob/main/backend/routes/tasks.py): `backend/routes/tasks.py`
- [Page routes](https://github.com/roshini-28/todo-app/blob/main/backend/routes/pages.py): `backend/routes/pages.py`
- [Auth routes](https://github.com/roshini-28/todo-app/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Task operations](https://github.com/roshini-28/todo-app/blob/main/backend/services/task_service.py): `backend/services/task_service.py`
- [Page operations](https://github.com/roshini-28/todo-app/blob/main/backend/services/page_service.py): `backend/services/page_service.py`

### Identity and persistence

- [Token service](https://github.com/roshini-28/todo-app/blob/main/backend/services/auth_service.py): `backend/services/auth_service.py`
- [Auth guard](https://github.com/roshini-28/todo-app/blob/main/backend/middleware/auth_middleware.py): `backend/middleware/auth_middleware.py`
- [User accounts](https://github.com/roshini-28/todo-app/blob/main/backend/services/user_service.py): `backend/services/user_service.py`
- [MongoDB](https://github.com/roshini-28/todo-app/blob/main/backend/database/mongodb.py): `backend/database/mongodb.py`

### AI assistance

- [AI endpoints](https://github.com/roshini-28/todo-app/blob/main/backend/routes/ai.py): `backend/routes/ai.py`
- [Agent chat route](https://github.com/roshini-28/todo-app/blob/main/backend/app/api/routes/ai.py): `backend/app/api/routes/ai.py`
- [Suggestion service](https://github.com/roshini-28/todo-app/blob/main/backend/services/ai_service.py): `backend/services/ai_service.py`
- [Todo agent](https://github.com/roshini-28/todo-app/blob/main/backend/app/agents/todo_agent.py): `backend/app/agents/todo_agent.py`
- [Todo tools](https://github.com/roshini-28/todo-app/blob/main/backend/app/tools/todo_tools.py): `backend/app/tools/todo_tools.py`
- [LLM client](https://github.com/roshini-28/todo-app/blob/main/backend/app/ai/litellm_client.py): `backend/app/ai/litellm_client.py`
- [Provider configuration](https://github.com/roshini-28/todo-app/blob/main/backend/app/config/settings.py): `backend/app/config/settings.py`
- [Provider adapters](https://github.com/roshini-28/todo-app/blob/main/backend/app/ai/providers.py): `backend/app/ai/providers.py`
- [Chat generation](https://github.com/roshini-28/todo-app/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`

### Other components

- **User**
- **LLM providers**

## Connections

- User → Dashboard: uses (evidence: `README.md`)
- Dashboard → Task controls: renders (evidence: `frontend/app/page.js`)
- Dashboard → Project navigation: renders (evidence: `frontend/app/page.js`)
- Dashboard → Task forms: opens (evidence: `frontend/app/page.js`)
- Dashboard → Edit task: opens (evidence: `frontend/app/page.js`)
- Dashboard → Search and filters: renders (evidence: `frontend/app/page.js`)
- Task controls → Task item: renders (evidence: `frontend/components/TodoList.js`)
- Dashboard → Auth client: checks session (evidence: `frontend/app/page.js`)
- Dashboard → API client: loads and updates (evidence: `frontend/app/page.js`)
- Dashboard → AI chat: renders (evidence: `frontend/app/page.js`)
- Auth client → Auth routes: sends auth requests (evidence: `README.md`)
- API client → FastAPI entry: sends REST requests (evidence: `README.md`)
- FastAPI entry → Task routes: registers (evidence: `backend/main.py`)
- FastAPI entry → Page routes: registers (evidence: `backend/main.py`)
- FastAPI entry → Auth routes: registers (evidence: `backend/main.py`)
- FastAPI entry → AI endpoints: registers (evidence: `backend/main.py`)
- FastAPI entry → Agent chat route: registers (evidence: `backend/main.py`)
- Task routes → Task operations: calls (evidence: `backend/routes/tasks.py`)
- Page routes → Page operations: calls (evidence: `backend/routes/pages.py`)
- Auth routes → User accounts: calls (evidence: `backend/routes/auth.py`)
- Auth routes → Token service: creates tokens (evidence: `backend/routes/auth.py`)
- Task routes → Auth guard: requires user (evidence: `backend/routes/tasks.py`)
- Page routes → Auth guard: requires user (evidence: `backend/routes/pages.py`)
- Auth guard → Token service: validates token (evidence: `backend/middleware/auth_middleware.py`)
- Auth guard → User accounts: loads user (evidence: `backend/middleware/auth_middleware.py`)
- Task operations → MongoDB: reads and writes (evidence: `backend/services/task_service.py`)
- Page operations → MongoDB: reads and writes (evidence: `backend/services/page_service.py`)
- User accounts → MongoDB: reads and writes (evidence: `backend/services/user_service.py`)
- AI endpoints → Suggestion service: calls (evidence: `backend/routes/ai.py`)
- Agent chat route → Chat generation: calls (evidence: `backend/app/api/routes/ai.py`)
- Todo agent → Todo tools: uses tools (evidence: `backend/app/agents/todo_agent.py`)
- Todo agent → LLM client: generates with (evidence: `backend/app/agents/todo_agent.py`)
- Todo tools → Task operations: uses task operations (evidence: `backend/app/tools/todo_tools.py`)
- Todo tools → Page operations: uses page operations (evidence: `backend/app/tools/todo_tools.py`)
- LLM client → Provider adapters: selects provider (evidence: `backend/app/ai/litellm_client.py`)
- Provider adapters → Provider configuration: reads settings (evidence: `backend/app/ai/providers.py`)
- Chat generation → Provider configuration: reads settings (evidence: `backend/app/services/ai_service.py`)
- Chat generation → LLM providers: requests completion (evidence: `backend/app/services/ai_service.py`)
