# multi-editor/frontend architecture

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

- Interactive diagram: https://gitdiagram.com/multi-editor/frontend
- Repository: https://github.com/multi-editor/frontend

## Overview

multi is a collaborative writing frontend where users sign in, create or join documents, edit together in real time, and collaborate through comments and AI assistance. Document work also includes revisions, agent profiles and tasks, as well as user presence. The graph maps the documented product areas and the principal editor, comment, and AI paths. Some feature implementations were not sampled, so their documented capabilities are included without speculative call links.

Main entry points: [`src/pages/document/page.js`](https://github.com/multi-editor/frontend/blob/main/src/pages/document/page.js) (Document page), [`src/App.js`](https://github.com/multi-editor/frontend/blob/main/src/App.js) (App routing), [`src/store/slices/documentApiSlice.js`](https://github.com/multi-editor/frontend/blob/main/src/store/slices/documentApiSlice.js) (Document API), [`src/features/SidebarCardComments/index.js`](https://github.com/multi-editor/frontend/blob/main/src/features/SidebarCardComments/index.js) (Comment cards)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and accounts"]
  node_app["App routing<br/>[App.js]"]
  node_auth["Authentication<br/>[useAuth.js]"]
end

subgraph group_documents["Documents and collaboration"]
  node_home["Document home<br/>[index.js]"]
  node_document["Document page<br/>[page.js]"]
  node_editor["Collaborative editor<br/>[QuillEditor.js]"]
  node_revisions["Document revisions<br/>[revision.js]"]
  node_presence["User presence<br/>[index.js]"]
  node_comments["Comment cards<br/>[index.js]"]
  node_sidebar["Sidebar interactions<br/>[useSidebar.js]"]
  node_commentreply["Comment replies<br/>[index.js]"]
end

subgraph group_assistance["AI and tasks"]
  node_agents["Agent profiles<br/>[page.js]"]
  node_tasks["Agent tasks<br/>[index.js]"]
  node_taskreview["Task activity review<br/>[TasksList.js]"]
  node_intelligence["AI prompts and emulator<br/>[Apis.js]"]
end

subgraph group_state["Client state and APIs"]
  node_api["API base<br/>[apiSlice.js]"]
  node_documentsapi["Document API"]
  node_usersapi["User API<br/>[userApiSlice.js]"]
  node_agentsapi["Agent API<br/>[agentApiSlice.js]"]
  node_sidebarstate["Sidebar state<br/>[sidebarSlice.js]"]
  node_socket["Realtime events<br/>[index.js]"]
end

subgraph group_research["Research instrumentation"]
  node_logger["Study logging<br/>[logger.js]"]
  node_studyalign["StudyAlign interactions<br/>[interactions.js]"]
end

node_user(("User"))

node_user -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_document
node_app -->|"routes to"| node_agents
node_user -->|"signs in"| node_auth
node_home -->|"creates and lists"| node_documentsapi
node_document -->|"renders editor"| node_editor
node_document -->|"initializes events"| node_socket
node_document -->|"loads document"| node_documentsapi
node_document -->|"renders comments"| node_comments
node_document -->|"renders task sidebar"| node_tasks
node_comments -->|"uses interactions"| node_sidebar
node_comments -->|"renders replies"| node_commentreply
node_sidebar -->|"requests AI"| node_intelligence
node_sidebar -->|"dispatches card updates"| node_sidebarstate
node_document -.->|"shows collaborators"| node_presence
node_document -.->|"offers revision history"| node_revisions
node_agents -.->|"manages agents"| node_agentsapi
node_taskreview -->|"starts task creation"| node_user
node_taskreview -->|"loads current user"| node_usersapi
node_documentsapi -->|"injects endpoints"| node_api
node_documentsapi -->|"fetches document agents"| node_agentsapi
node_usersapi -->|"injects endpoints"| node_api
node_usersapi -->|"fetches agents"| node_agentsapi
node_sidebarstate -->|"handles document results"| node_documentsapi
node_app -->|"initializes logging"| node_logger
node_logger -->|"uses study library"| node_studyalign

click node_app "https://github.com/multi-editor/frontend/blob/main/src/App.js"
click node_auth "https://github.com/multi-editor/frontend/blob/main/src/shared/auth/useAuth.js"
click node_home "https://github.com/multi-editor/frontend/blob/main/src/pages/home/index.js"
click node_document "https://github.com/multi-editor/frontend/blob/main/src/pages/document/page.js"
click node_editor "https://github.com/multi-editor/frontend/blob/main/src/lib/quill/QuillEditor.js"
click node_revisions "https://github.com/multi-editor/frontend/blob/main/src/features/revision/revision.js"
click node_presence "https://github.com/multi-editor/frontend/blob/main/src/features/UserPresence/index.js"
click node_comments "https://github.com/multi-editor/frontend/blob/main/src/features/SidebarCardComments/index.js"
click node_sidebar "https://github.com/multi-editor/frontend/blob/main/src/shared/sidebar/useSidebar.js"
click node_commentreply "https://github.com/multi-editor/frontend/blob/main/src/shared/CommentReply/index.js"
click node_agents "https://github.com/multi-editor/frontend/blob/main/src/pages/agents/page.js"
click node_tasks "https://github.com/multi-editor/frontend/blob/main/src/features/TasksSidebar/index.js"
click node_taskreview "https://github.com/multi-editor/frontend/blob/main/src/features/TaskProgress/TasksList.js"
click node_intelligence "https://github.com/multi-editor/frontend/blob/main/src/lib/intelligence/Apis.js"
click node_api "https://github.com/multi-editor/frontend/blob/main/src/store/slices/apiSlice.js"
click node_documentsapi "https://github.com/multi-editor/frontend/blob/main/src/store/slices/documentApiSlice.js"
click node_usersapi "https://github.com/multi-editor/frontend/blob/main/src/store/slices/userApiSlice.js"
click node_agentsapi "https://github.com/multi-editor/frontend/blob/main/src/store/slices/agentApiSlice.js"
click node_sidebarstate "https://github.com/multi-editor/frontend/blob/main/src/store/slices/sidebarSlice.js"
click node_socket "https://github.com/multi-editor/frontend/blob/main/src/lib/socket/index.js"
click node_logger "https://github.com/multi-editor/frontend/blob/main/src/lib/logger/logger.js"
click node_studyalign "https://github.com/multi-editor/frontend/blob/main/src/lib/studyAlign/interactions.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_auth,node_user toneBlue
class node_home,node_document,node_editor,node_revisions,node_presence,node_comments,node_sidebar,node_commentreply toneAmber
class node_agents,node_tasks,node_taskreview,node_intelligence toneMint
class node_api,node_documentsapi,node_usersapi,node_agentsapi,node_sidebarstate,node_socket toneRose
class node_logger,node_studyalign toneIndigo
```

## Components

### Entry and accounts

- [App routing](https://github.com/multi-editor/frontend/blob/main/src/App.js): `src/App.js`
- [Authentication](https://github.com/multi-editor/frontend/blob/main/src/shared/auth/useAuth.js): `src/shared/auth/useAuth.js`

### Documents and collaboration

- [Document home](https://github.com/multi-editor/frontend/blob/main/src/pages/home/index.js): `src/pages/home/index.js`
- [Document page](https://github.com/multi-editor/frontend/blob/main/src/pages/document/page.js): `src/pages/document/page.js`
- [Collaborative editor](https://github.com/multi-editor/frontend/blob/main/src/lib/quill/QuillEditor.js): `src/lib/quill/QuillEditor.js`
- [Document revisions](https://github.com/multi-editor/frontend/blob/main/src/features/revision/revision.js): `src/features/revision/revision.js`
- [User presence](https://github.com/multi-editor/frontend/blob/main/src/features/UserPresence/index.js): `src/features/UserPresence/index.js`
- [Comment cards](https://github.com/multi-editor/frontend/blob/main/src/features/SidebarCardComments/index.js): `src/features/SidebarCardComments/index.js`
- [Sidebar interactions](https://github.com/multi-editor/frontend/blob/main/src/shared/sidebar/useSidebar.js): `src/shared/sidebar/useSidebar.js`
- [Comment replies](https://github.com/multi-editor/frontend/blob/main/src/shared/CommentReply/index.js): `src/shared/CommentReply/index.js`

### AI and tasks

- [Agent profiles](https://github.com/multi-editor/frontend/blob/main/src/pages/agents/page.js): `src/pages/agents/page.js`
- [Agent tasks](https://github.com/multi-editor/frontend/blob/main/src/features/TasksSidebar/index.js): `src/features/TasksSidebar/index.js`
- [Task activity review](https://github.com/multi-editor/frontend/blob/main/src/features/TaskProgress/TasksList.js): `src/features/TaskProgress/TasksList.js`
- [AI prompts and emulator](https://github.com/multi-editor/frontend/blob/main/src/lib/intelligence/Apis.js): `src/lib/intelligence/Apis.js`

### Client state and APIs

- [API base](https://github.com/multi-editor/frontend/blob/main/src/store/slices/apiSlice.js): `src/store/slices/apiSlice.js`
- [Document API](https://github.com/multi-editor/frontend/blob/main/src/store/slices/documentApiSlice.js): `src/store/slices/documentApiSlice.js`
- [User API](https://github.com/multi-editor/frontend/blob/main/src/store/slices/userApiSlice.js): `src/store/slices/userApiSlice.js`
- [Agent API](https://github.com/multi-editor/frontend/blob/main/src/store/slices/agentApiSlice.js): `src/store/slices/agentApiSlice.js`
- [Sidebar state](https://github.com/multi-editor/frontend/blob/main/src/store/slices/sidebarSlice.js): `src/store/slices/sidebarSlice.js`
- [Realtime events](https://github.com/multi-editor/frontend/blob/main/src/lib/socket/index.js): `src/lib/socket/index.js`

### Research instrumentation

- [Study logging](https://github.com/multi-editor/frontend/blob/main/src/lib/logger/logger.js): `src/lib/logger/logger.js`
- [StudyAlign interactions](https://github.com/multi-editor/frontend/blob/main/src/lib/studyAlign/interactions.js): `src/lib/studyAlign/interactions.js`

### Other components

- **User**

## Connections

- User → App routing: opens app
- App routing → Document home: routes to (evidence: `src/App.js`)
- App routing → Document page: routes to (evidence: `src/App.js`)
- App routing → Agent profiles: routes to (evidence: `src/App.js`)
- User → Authentication: signs in (evidence: `src/shared/auth/useAuth.js`)
- Document home → Document API: creates and lists (evidence: `src/pages/home/index.js`)
- Document page → Collaborative editor: renders editor
- Document page → Realtime events: initializes events (evidence: `src/pages/document/page.js`)
- Document page → Document API: loads document (evidence: `src/pages/document/page.js`)
- Document page → Comment cards: renders comments (evidence: `src/pages/document/page.js`)
- Document page → Agent tasks: renders task sidebar (evidence: `src/pages/document/page.js`)
- Comment cards → Sidebar interactions: uses interactions (evidence: `src/features/SidebarCardComments/index.js`)
- Comment cards → Comment replies: renders replies (evidence: `src/features/SidebarCardComments/index.js`)
- Sidebar interactions → AI prompts and emulator: requests AI (evidence: `src/shared/sidebar/useSidebar.js`)
- Sidebar interactions → Sidebar state: dispatches card updates (evidence: `src/shared/sidebar/useSidebar.js`)
- Document page → User presence: shows collaborators
- Document page → Document revisions: offers revision history
- Agent profiles → Agent API: manages agents
- Task activity review → User: starts task creation (evidence: `src/features/TaskProgress/TasksList.js`)
- Task activity review → User API: loads current user (evidence: `src/features/TaskProgress/TasksList.js`)
- Document API → API base: injects endpoints (evidence: `src/store/slices/documentApiSlice.js`)
- Document API → Agent API: fetches document agents (evidence: `src/store/slices/documentApiSlice.js`)
- User API → API base: injects endpoints (evidence: `src/store/slices/userApiSlice.js`)
- User API → Agent API: fetches agents (evidence: `src/store/slices/userApiSlice.js`)
- Sidebar state → Document API: handles document results (evidence: `src/store/slices/sidebarSlice.js`)
- App routing → Study logging: initializes logging (evidence: `src/App.js`)
- Study logging → StudyAlign interactions: uses study library (evidence: `src/lib/logger/logger.js`)
