# furquanis1/ajaia-doc-editor architecture

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

- Interactive diagram: https://gitdiagram.com/furquanis1/ajaia-doc-editor
- Repository: https://github.com/furquanis1/ajaia-doc-editor

## Overview

Ajaia Docs is a browser-based document editor with a React client and Express/SQLite API. Users switch among demo identities, browse owned and shared documents, create or import text files, edit titles and content with autosave, and share documents with other users. The API enforces ownership/sharing access and persists users, documents, and shares. The graph preserves these stages and the client/API and API/storage layers; the client-to-server link is dashed because the sampled API client and server excerpts do not show their HTTP integration together.

Main entry points: [`client/src/App.jsx`](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/App.jsx) (Route shell), [`client/src/AuthContext.jsx`](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/AuthContext.jsx) (Demo identity), [`client/src/Dashboard.jsx`](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/Dashboard.jsx) (Document dashboard), [`client/src/EditorView.jsx`](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/EditorView.jsx) (Document editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_identity["Demo identity<br/>[AuthContext.jsx]"]
  node_layout["App layout<br/>[Layout.jsx]"]
  node_dashboard["Document dashboard<br/>[Dashboard.jsx]"]
  node_editor["Document editor<br/>[EditorView.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_server["API service"]
  node_api["Express API<br/>[index.js]"]
end

subgraph group_storage["Persistence"]
  node_sqlite[("SQLite store<br/>[db.js]")]
end

node_user(("Document user"))

node_user -->|"uses"| node_app
node_app -->|"provides"| node_identity
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_editor
node_layout -->|"reads identity"| node_identity
node_dashboard -->|"reads identity"| node_identity
node_editor -->|"reads identity"| node_identity
node_dashboard -->|"requests documents"| node_api_client
node_editor -->|"loads and saves"| node_api_client
node_api_client -.->|"sends HTTP requests"| node_api
node_api -->|"queries and updates"| node_sqlite

click node_app "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/App.jsx"
click node_identity "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/AuthContext.jsx"
click node_layout "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/Layout.jsx"
click node_dashboard "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/Dashboard.jsx"
click node_editor "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/EditorView.jsx"
click node_api_client "https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/api.js"
click node_api "https://github.com/furquanis1/ajaia-doc-editor/blob/main/server/index.js"
click node_sqlite "https://github.com/furquanis1/ajaia-doc-editor/blob/main/server/db.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_identity,node_layout,node_dashboard,node_editor,node_api_client,node_user toneBlue
class node_api toneAmber
class node_sqlite toneMint
```

## Components

### React client

- [Route shell](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Demo identity](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/AuthContext.jsx): `client/src/AuthContext.jsx`
- [App layout](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/Layout.jsx): `client/src/Layout.jsx`
- [Document dashboard](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/Dashboard.jsx): `client/src/Dashboard.jsx`
- [Document editor](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/EditorView.jsx): `client/src/EditorView.jsx`
- [API client](https://github.com/furquanis1/ajaia-doc-editor/blob/main/client/src/api.js): `client/src/api.js`

### API service

- [Express API](https://github.com/furquanis1/ajaia-doc-editor/blob/main/server/index.js): `server/index.js`

### Persistence

- [SQLite store](https://github.com/furquanis1/ajaia-doc-editor/blob/main/server/db.js): `server/db.js`

### Other components

- **Document user**

## Connections

- Document user → Route shell: uses (evidence: `client/src/App.jsx`)
- Route shell → Demo identity: provides (evidence: `client/src/App.jsx`)
- Route shell → App layout: routes through (evidence: `client/src/App.jsx`)
- Route shell → Document dashboard: routes to (evidence: `client/src/App.jsx`)
- Route shell → Document editor: routes to (evidence: `client/src/App.jsx`)
- App layout → Demo identity: reads identity (evidence: `client/src/Layout.jsx`)
- Document dashboard → Demo identity: reads identity (evidence: `client/src/Dashboard.jsx`)
- Document editor → Demo identity: reads identity (evidence: `client/src/EditorView.jsx`)
- Document dashboard → API client: requests documents (evidence: `client/src/Dashboard.jsx`)
- Document editor → API client: loads and saves (evidence: `client/src/EditorView.jsx`)
- API client → Express API: sends HTTP requests
- Express API → SQLite store: queries and updates (evidence: `server/index.js`)
