# inkithai/productivity-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/inkithai/productivity-assistant
- Repository: https://github.com/inkithai/productivity-assistant

## Overview

Productivity Assistant is a React productivity workspace backed by an authenticated Express API, MongoDB, and an internal FastAPI AI service. Users manage tasks and related productivity data in the client; the API routes requests to domain controllers and persists state. AI-backed workflows—including natural-language task extraction, prioritization, day planning, note summaries, grounded chat, and semantic search—are exposed through the API gateway. The README documents the service boundaries; sampled source confirms task routing and persistence and semantic-search delegation, but most domain implementations were not sampled.

Main entry points: [`ai-service/app/main.py`](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/main.py) (AI HTTP service), [`server/src/models`](https://github.com/inkithai/productivity-assistant/tree/main/server/src/models) (MongoDB), [`server/src/app.js`](https://github.com/inkithai/productivity-assistant/blob/main/server/src/app.js) (HTTP application), [`server/src/routes/tasks.routes.js`](https://github.com/inkithai/productivity-assistant/blob/main/server/src/routes/tasks.routes.js) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Productivity client"]
  node_workspace["App workspace<br/>[App.jsx]"]
  node_taskui["Task workspace<br/>[TasksPage.jsx]"]
  node_otherui["Productivity views"]
  node_clientapi["API client<br/>[client.js]"]
  node_socketclient["Live client<br/>[socket.js]"]
end

subgraph group_api["Express API"]
  node_apiapp["HTTP application<br/>[app.js]"]
  node_taskroutes["Task routes<br/>[tasks.routes.js]"]
  node_taskcontroller["Task operations"]
  node_domainapi["Domain controllers"]
  node_searchsvc["Semantic search<br/>[search.service.js]"]
  node_aigateway["AI gateway"]
  node_auth["Authentication<br/>[auth.middleware.js]"]
end

subgraph group_data["Domain data and realtime"]
  node_mongo[("MongoDB")]
  node_realtime["Socket notifications<br/>[index.js]"]
  node_reminderjob["Reminder dispatch<br/>[reminderWorker.js]"]
end

subgraph group_ai["AI capabilities"]
  node_aiservice["AI HTTP service<br/>[main.py]"]
  node_extract["Task extraction<br/>[extraction.py]"]
  node_prioritize["Task prioritization<br/>[prioritization.py]"]
  node_planner["Day planner<br/>[planner.py]"]
  node_summarize["Note summaries<br/>[summarization.py]"]
  node_assistant["Grounded assistant<br/>[assistant.py]"]
  node_aisearch["AI semantic engine<br/>[search.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_workspace
node_workspace -->|"routes to"| node_taskui
node_user -.->|"uses"| node_otherui
node_taskui -->|"requests tasks"| node_clientapi
node_clientapi -->|"REST requests"| node_apiapp
node_socketclient -->|"Socket.IO"| node_realtime
node_apiapp -->|"mounts"| node_taskroutes
node_taskroutes -->|"authenticates"| node_auth
node_taskroutes -->|"dispatches"| node_taskcontroller
node_taskcontroller -->|"reads and writes"| node_mongo
node_apiapp -->|"mounts domain routes"| node_domainapi
node_domainapi -.->|"persists domain data"| node_mongo
node_taskcontroller -->|"emits updates"| node_realtime
node_reminderjob -.->|"dispatches scheduled"| node_mongo
node_searchsvc -->|"loads and updates"| node_mongo
node_searchsvc -->|"delegates search"| node_aigateway
node_aigateway -->|"HTTP calls"| node_aiservice
node_aiservice -->|"registers"| node_extract
node_aiservice -->|"registers"| node_prioritize
node_aiservice -->|"registers"| node_planner
node_aiservice -->|"registers"| node_summarize
node_aiservice -->|"registers"| node_assistant
node_aiservice -->|"registers"| node_aisearch
node_otherui -.->|"uses productivity APIs"| node_domainapi

click node_workspace "https://github.com/inkithai/productivity-assistant/blob/main/client/src/App.jsx"
click node_taskui "https://github.com/inkithai/productivity-assistant/blob/main/client/src/pages/TasksPage.jsx"
click node_otherui "https://github.com/inkithai/productivity-assistant/tree/main/client/src/pages"
click node_clientapi "https://github.com/inkithai/productivity-assistant/blob/main/client/src/api/client.js"
click node_socketclient "https://github.com/inkithai/productivity-assistant/blob/main/client/src/api/socket.js"
click node_apiapp "https://github.com/inkithai/productivity-assistant/blob/main/server/src/app.js"
click node_taskroutes "https://github.com/inkithai/productivity-assistant/blob/main/server/src/routes/tasks.routes.js"
click node_taskcontroller "https://github.com/inkithai/productivity-assistant/blob/main/server/src/controllers/tasks.controller.js"
click node_domainapi "https://github.com/inkithai/productivity-assistant/tree/main/server/src/controllers"
click node_searchsvc "https://github.com/inkithai/productivity-assistant/blob/main/server/src/services/search.service.js"
click node_aigateway "https://github.com/inkithai/productivity-assistant/blob/main/server/src/services/aiGateway.service.js"
click node_auth "https://github.com/inkithai/productivity-assistant/blob/main/server/src/middleware/auth.middleware.js"
click node_mongo "https://github.com/inkithai/productivity-assistant/tree/main/server/src/models"
click node_realtime "https://github.com/inkithai/productivity-assistant/blob/main/server/src/sockets/index.js"
click node_reminderjob "https://github.com/inkithai/productivity-assistant/blob/main/server/src/jobs/reminderWorker.js"
click node_aiservice "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/main.py"
click node_extract "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/extraction.py"
click node_prioritize "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/prioritization.py"
click node_planner "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/planner.py"
click node_summarize "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/summarization.py"
click node_assistant "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/assistant.py"
click node_aisearch "https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/search.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_workspace,node_taskui,node_otherui,node_clientapi,node_socketclient,node_user toneBlue
class node_apiapp,node_taskroutes,node_taskcontroller,node_domainapi,node_searchsvc,node_aigateway,node_auth toneAmber
class node_mongo,node_realtime,node_reminderjob toneMint
class node_aiservice,node_extract,node_prioritize,node_planner,node_summarize,node_assistant,node_aisearch toneRose
```

## Components

### Productivity client

- [App workspace](https://github.com/inkithai/productivity-assistant/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Task workspace](https://github.com/inkithai/productivity-assistant/blob/main/client/src/pages/TasksPage.jsx): `client/src/pages/TasksPage.jsx`
- [Productivity views](https://github.com/inkithai/productivity-assistant/tree/main/client/src/pages): `client/src/pages`
- [API client](https://github.com/inkithai/productivity-assistant/blob/main/client/src/api/client.js): `client/src/api/client.js`
- [Live client](https://github.com/inkithai/productivity-assistant/blob/main/client/src/api/socket.js): `client/src/api/socket.js`

### Express API

- [HTTP application](https://github.com/inkithai/productivity-assistant/blob/main/server/src/app.js): `server/src/app.js`
- [Task routes](https://github.com/inkithai/productivity-assistant/blob/main/server/src/routes/tasks.routes.js): `server/src/routes/tasks.routes.js`
- [Task operations](https://github.com/inkithai/productivity-assistant/blob/main/server/src/controllers/tasks.controller.js): `server/src/controllers/tasks.controller.js`
- [Domain controllers](https://github.com/inkithai/productivity-assistant/tree/main/server/src/controllers): `server/src/controllers`
- [Semantic search](https://github.com/inkithai/productivity-assistant/blob/main/server/src/services/search.service.js): `server/src/services/search.service.js`
- [AI gateway](https://github.com/inkithai/productivity-assistant/blob/main/server/src/services/aiGateway.service.js): `server/src/services/aiGateway.service.js`
- [Authentication](https://github.com/inkithai/productivity-assistant/blob/main/server/src/middleware/auth.middleware.js): `server/src/middleware/auth.middleware.js`

### Domain data and realtime

- [MongoDB](https://github.com/inkithai/productivity-assistant/tree/main/server/src/models): `server/src/models`
- [Socket notifications](https://github.com/inkithai/productivity-assistant/blob/main/server/src/sockets/index.js): `server/src/sockets/index.js`
- [Reminder dispatch](https://github.com/inkithai/productivity-assistant/blob/main/server/src/jobs/reminderWorker.js): `server/src/jobs/reminderWorker.js`

### AI capabilities

- [AI HTTP service](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/main.py): `ai-service/app/main.py`
- [Task extraction](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/extraction.py): `ai-service/app/routers/extraction.py`
- [Task prioritization](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/prioritization.py): `ai-service/app/routers/prioritization.py`
- [Day planner](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/planner.py): `ai-service/app/routers/planner.py`
- [Note summaries](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/summarization.py): `ai-service/app/routers/summarization.py`
- [Grounded assistant](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/assistant.py): `ai-service/app/routers/assistant.py`
- [AI semantic engine](https://github.com/inkithai/productivity-assistant/blob/main/ai-service/app/routers/search.py): `ai-service/app/routers/search.py`

### Other components

- **User**

## Connections

- User → App workspace: uses (evidence: `client/src/App.jsx`)
- App workspace → Task workspace: routes to (evidence: `client/src/App.jsx`)
- User → Productivity views: uses (evidence: `README.md`)
- Task workspace → API client: requests tasks (evidence: `client/src/pages/TasksPage.jsx`)
- API client → HTTP application: REST requests (evidence: `README.md`)
- Live client → Socket notifications: Socket.IO (evidence: `README.md`)
- HTTP application → Task routes: mounts (evidence: `server/src/app.js`)
- Task routes → Authentication: authenticates (evidence: `server/src/routes/tasks.routes.js`)
- Task routes → Task operations: dispatches (evidence: `server/src/routes/tasks.routes.js`)
- Task operations → MongoDB: reads and writes (evidence: `server/src/controllers/tasks.controller.js`)
- HTTP application → Domain controllers: mounts domain routes (evidence: `server/src/app.js`)
- Domain controllers → MongoDB: persists domain data (evidence: `server/src/controllers/tasks.controller.js`)
- Task operations → Socket notifications: emits updates (evidence: `server/src/controllers/tasks.controller.js`)
- Reminder dispatch → MongoDB: dispatches scheduled
- Semantic search → MongoDB: loads and updates (evidence: `server/src/services/search.service.js`)
- Semantic search → AI gateway: delegates search (evidence: `server/src/services/search.service.js`)
- AI gateway → AI HTTP service: HTTP calls (evidence: `README.md`)
- AI HTTP service → Task extraction: registers (evidence: `ai-service/app/main.py`)
- AI HTTP service → Task prioritization: registers (evidence: `ai-service/app/main.py`)
- AI HTTP service → Day planner: registers (evidence: `ai-service/app/main.py`)
- AI HTTP service → Note summaries: registers (evidence: `ai-service/app/main.py`)
- AI HTTP service → Grounded assistant: registers (evidence: `ai-service/app/main.py`)
- AI HTTP service → AI semantic engine: registers (evidence: `ai-service/app/main.py`)
- Productivity views → Domain controllers: uses productivity APIs
