# thisiskaii/intellidocs architecture

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

- Interactive diagram: https://gitdiagram.com/thisiskaii/intellidocs
- Repository: https://github.com/thisiskaii/intellidocs

## Overview

IntelliDocs is an academic document editor that imports and manages research documents, learns each user’s formatting behavior, and suggests formatting choices alongside writing assistance. The main path runs from the editor through authenticated API routes and prediction services to personalized suggestions and feedback; separate branches cover document conversion, collaboration, and professor review. The README documents major features not visible in the sampled excerpts; those are represented at their supported enclosing paths, with uncertain wiring omitted.

Main entry points: [`frontend/src/services/api.ts`](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/services/api.ts) (API client), [`server/src/controllers/documentController.ts`](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/documentController.ts) (Document operations), [`ml/src/main.py`](https://github.com/thisiskaii/intellidocs/blob/main/ml/src/main.py) (ML prediction API), [`frontend/src/pages/Document.tsx`](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/pages/Document.tsx) (Document workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Editor and workspace"]
  node_frontend["App routing<br/>[App.tsx]"]
  node_workspace["Document workspace<br/>[Document.tsx]"]
  node_editor["TipTap editor<br/>[TiptapEditor.tsx]"]
  node_writing_tools["Writing assistance"]
  node_client_api["API client<br/>[api.ts]"]
  node_collaboration["Yjs collaboration"]
end

subgraph group_api["Application API"]
  node_server["HTTP app<br/>[index.ts]"]
  node_auth["Authentication<br/>[authController.ts]"]
  node_documents["Document operations"]
  node_document_routes["Document routes<br/>[documentRoutes.ts]"]
  node_doc_store[("Document and share data<br/>[documentModel.ts]")]
  node_python_bridge["Python bridge<br/>[pythonBridge.ts]"]
end

subgraph group_learning["Prediction and learning"]
  node_formatting["Formatting services"]
  node_behavior["Behavior capture"]
  node_learning_skills["Personalization logic"]
  node_ml_api["ML prediction API<br/>[main.py]"]
  node_model_storage["Model storage<br/>[storage.py]"]
  node_duckdb[("Behavior feature store<br/>[main.py]")]
  node_grammar["Grammar and spelling"]
end

subgraph group_review["Review and integrations"]
  node_ai_chat["MCP assistant<br/>[mcpServer.ts]"]
  node_ai_client["Provider client<br/>[aiClient.ts]"]
  node_professor_review["Professor review"]
  node_drive["Drive import<br/>[driveController.ts]"]
end

node_writer(("Writer"))
node_professor(("Professor"))
node_supabase[("Supabase")]
node_redis[("Redis")]
node_llm_provider["LLM provider"]
node_google_drive["Google Drive"]

node_writer -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_workspace
node_workspace -->|"edits in"| node_editor
node_workspace -->|"requests"| node_client_api
node_editor -->|"uses"| node_writing_tools
node_client_api -->|"calls"| node_server
node_server -->|"mounts"| node_document_routes
node_document_routes -->|"dispatches"| node_documents
node_documents -->|"reads and writes"| node_doc_store
node_documents -->|"converts files"| node_python_bridge
node_python_bridge -->|"HTTP conversion"| node_ml_api
node_documents -->|"resolves shares"| node_supabase
node_server -->|"mounts auth routes"| node_auth
node_auth -->|"auth and profiles"| node_supabase
node_client_api -->|"requests formatting"| node_formatting
node_formatting -->|"invokes"| node_learning_skills
node_learning_skills -->|"predicts"| node_ml_api
node_ml_api -->|"loads models"| node_model_storage
node_model_storage -.->|"downloads and uploads"| node_supabase
node_ml_api -->|"queries sequences"| node_duckdb
node_behavior -->|"buffers behavior"| node_redis
node_behavior -->|"feeds learning"| node_learning_skills
node_formatting -->|"records feedback"| node_behavior
node_client_api -->|"requests checks"| node_grammar
node_writing_tools -->|"asks assistant"| node_ai_chat
node_ai_chat -->|"requests completion"| node_ai_client
node_ai_client -.->|"sends prompt"| node_llm_provider
node_professor -->|"reviews documents"| node_professor_review
node_professor_review -->|"accesses documents"| node_doc_store
node_client_api -->|"imports files"| node_drive
node_drive -.->|"exports and downloads"| node_google_drive
node_drive -->|"converts files"| node_python_bridge
node_writer -.->|"collaborates"| node_collaboration

click node_frontend "https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/App.tsx"
click node_workspace "https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/pages/Document.tsx"
click node_editor "https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/components/editor/TiptapEditor.tsx"
click node_writing_tools "https://github.com/thisiskaii/intellidocs/tree/main/frontend/src/components/editor"
click node_client_api "https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/services/api.ts"
click node_server "https://github.com/thisiskaii/intellidocs/blob/main/server/src/index.ts"
click node_auth "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/authController.ts"
click node_documents "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/documentController.ts"
click node_document_routes "https://github.com/thisiskaii/intellidocs/blob/main/server/src/routes/documentRoutes.ts"
click node_doc_store "https://github.com/thisiskaii/intellidocs/blob/main/server/src/models/documentModel.ts"
click node_python_bridge "https://github.com/thisiskaii/intellidocs/blob/main/server/src/ai/bridge/pythonBridge.ts"
click node_formatting "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/formattingController.ts"
click node_behavior "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/behaviorController.ts"
click node_learning_skills "https://github.com/thisiskaii/intellidocs/tree/main/server/src/skills"
click node_ml_api "https://github.com/thisiskaii/intellidocs/blob/main/ml/src/main.py"
click node_model_storage "https://github.com/thisiskaii/intellidocs/blob/main/ml/storage.py"
click node_duckdb "https://github.com/thisiskaii/intellidocs/blob/main/ml/src/main.py"
click node_grammar "https://github.com/thisiskaii/intellidocs/tree/main/ml/grammar"
click node_ai_chat "https://github.com/thisiskaii/intellidocs/blob/main/server/src/mcp/mcpServer.ts"
click node_ai_client "https://github.com/thisiskaii/intellidocs/blob/main/server/src/ai/aiClient.ts"
click node_professor_review "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/professorController.ts"
click node_drive "https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/driveController.ts"
click node_collaboration "https://github.com/thisiskaii/intellidocs/tree/main/frontend/src"

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_frontend,node_workspace,node_editor,node_writing_tools,node_client_api,node_collaboration toneBlue
class node_server,node_auth,node_documents,node_document_routes,node_doc_store,node_python_bridge,node_supabase,node_redis toneAmber
class node_formatting,node_behavior,node_learning_skills,node_ml_api,node_model_storage,node_duckdb,node_grammar toneMint
class node_ai_chat,node_ai_client,node_professor_review,node_drive toneRose
class node_writer,node_professor,node_llm_provider,node_google_drive toneIndigo
```

## Components

### Editor and workspace

- [App routing](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Document workspace](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/pages/Document.tsx): `frontend/src/pages/Document.tsx`
- [TipTap editor](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/components/editor/TiptapEditor.tsx): `frontend/src/components/editor/TiptapEditor.tsx`
- [Writing assistance](https://github.com/thisiskaii/intellidocs/tree/main/frontend/src/components/editor): `frontend/src/components/editor`
- [API client](https://github.com/thisiskaii/intellidocs/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Yjs collaboration](https://github.com/thisiskaii/intellidocs/tree/main/frontend/src): `frontend/src`

### Application API

- [HTTP app](https://github.com/thisiskaii/intellidocs/blob/main/server/src/index.ts): `server/src/index.ts`
- [Authentication](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/authController.ts): `server/src/controllers/authController.ts`
- [Document operations](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/documentController.ts): `server/src/controllers/documentController.ts`
- [Document routes](https://github.com/thisiskaii/intellidocs/blob/main/server/src/routes/documentRoutes.ts): `server/src/routes/documentRoutes.ts`
- [Document and share data](https://github.com/thisiskaii/intellidocs/blob/main/server/src/models/documentModel.ts): `server/src/models/documentModel.ts`
- [Python bridge](https://github.com/thisiskaii/intellidocs/blob/main/server/src/ai/bridge/pythonBridge.ts): `server/src/ai/bridge/pythonBridge.ts`

### Prediction and learning

- [Formatting services](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/formattingController.ts): `server/src/controllers/formattingController.ts`
- [Behavior capture](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/behaviorController.ts): `server/src/controllers/behaviorController.ts`
- [Personalization logic](https://github.com/thisiskaii/intellidocs/tree/main/server/src/skills): `server/src/skills`
- [ML prediction API](https://github.com/thisiskaii/intellidocs/blob/main/ml/src/main.py): `ml/src/main.py`
- [Model storage](https://github.com/thisiskaii/intellidocs/blob/main/ml/storage.py): `ml/storage.py`
- [Behavior feature store](https://github.com/thisiskaii/intellidocs/blob/main/ml/src/main.py): `ml/src/main.py`
- [Grammar and spelling](https://github.com/thisiskaii/intellidocs/tree/main/ml/grammar): `ml/grammar`

### Review and integrations

- [MCP assistant](https://github.com/thisiskaii/intellidocs/blob/main/server/src/mcp/mcpServer.ts): `server/src/mcp/mcpServer.ts`
- [Provider client](https://github.com/thisiskaii/intellidocs/blob/main/server/src/ai/aiClient.ts): `server/src/ai/aiClient.ts`
- [Professor review](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/professorController.ts): `server/src/controllers/professorController.ts`
- [Drive import](https://github.com/thisiskaii/intellidocs/blob/main/server/src/controllers/driveController.ts): `server/src/controllers/driveController.ts`

### Other components

- **Writer**
- **Professor**
- **Supabase**
- **Redis**
- **LLM provider**
- **Google Drive**

## Connections

- Writer → App routing: uses
- App routing → Document workspace: routes to
- Document workspace → TipTap editor: edits in
- Document workspace → API client: requests
- TipTap editor → Writing assistance: uses
- API client → HTTP app: calls
- HTTP app → Document routes: mounts
- Document routes → Document operations: dispatches
- Document operations → Document and share data: reads and writes
- Document operations → Python bridge: converts files
- Python bridge → ML prediction API: HTTP conversion
- Document operations → Supabase: resolves shares
- HTTP app → Authentication: mounts auth routes
- Authentication → Supabase: auth and profiles
- API client → Formatting services: requests formatting
- Formatting services → Personalization logic: invokes
- Personalization logic → ML prediction API: predicts
- ML prediction API → Model storage: loads models
- Model storage → Supabase: downloads and uploads
- ML prediction API → Behavior feature store: queries sequences
- Behavior capture → Redis: buffers behavior
- Behavior capture → Personalization logic: feeds learning
- Formatting services → Behavior capture: records feedback
- API client → Grammar and spelling: requests checks
- Writing assistance → MCP assistant: asks assistant
- MCP assistant → Provider client: requests completion
- Provider client → LLM provider: sends prompt
- Professor → Professor review: reviews documents
- Professor review → Document and share data: accesses documents
- API client → Drive import: imports files
- Drive import → Google Drive: exports and downloads
- Drive import → Python bridge: converts files
- Writer → Yjs collaboration: collaborates
