# requarks/wiki architecture

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

- Interactive diagram: https://gitdiagram.com/requarks/wiki
- Repository: https://github.com/requarks/wiki

## Overview

Wiki.js is a web-based wiki for creating, editing, organizing, and managing pages and related content. A typical user workflow starts in the web interface, reaches the server API, and operates on page and tree models backed by the database; storage targets can also synchronize page and asset files. The repository additionally includes authentication, collaboration, notifications, administration, extensions, and MCP tooling. Arrows are limited to relationships visible in excerpts or the source index; several frontend-to-server and unsampled feature links are therefore omitted or marked unverified.

Main entry points: [`backend/index.ts`](https://github.com/requarks/wiki/blob/scarlett/backend/index.ts) (HTTP server), [`backend/models/storage.ts`](https://github.com/requarks/wiki/blob/scarlett/backend/models/storage.ts) (Storage targets), [`frontend/src/App.vue`](https://github.com/requarks/wiki/blob/scarlett/frontend/src/App.vue) (Wiki interface), [`backend/api/pages.ts`](https://github.com/requarks/wiki/blob/scarlett/backend/api/pages.ts) (Page endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Wiki interface<br/>[App.vue]"]
  node_filemanager["File manager<br/>[FileManager.vue]"]
  node_graphview["Page graph<br/>[engine.js]"]
end

subgraph group_server["Server and API"]
  node_server["HTTP server<br/>[index.ts]"]
  node_api["API routes<br/>[index.ts]"]
  node_pageapi["Page endpoints<br/>[pages.ts]"]
  node_storageapi["Storage endpoints<br/>[storage.ts]"]
end

subgraph group_content["Wiki content"]
  node_pages["Page model<br/>[pages.ts]"]
  node_tree["Content tree<br/>[tree.ts]"]
  node_assets["Assets<br/>[assets.ts]"]
  node_storage["Storage targets<br/>[storage.ts]"]
  node_fileformat["Page file mapping<br/>[storageFiles.ts]"]
  node_objectstorage["Object storage<br/>[storageObjects.ts]"]
  node_gitstorage["Git storage target<br/>[storage.ts]"]
end

subgraph group_platform["Platform services"]
  node_dbschema[("Database schema<br/>[schema.ts]")]
  node_scheduler["Job scheduler<br/>[scheduler.ts]"]
  node_collab["Live collaboration<br/>[collab.ts]"]
  node_notifications["Notifications<br/>[index.ts]"]
  node_auth["Authentication providers"]
end

subgraph group_extensions["Extensions"]
  node_mcp["MCP tools<br/>[index.ts]"]
  node_blocks["Content blocks<br/>[component.js]"]
end

node_user(("Wiki user"))

node_user -.->|"uses"| node_webapp
node_webapp -.->|"requests"| node_server
node_filemanager -.->|"requests"| node_server
node_webapp -.->|"renders"| node_graphview
node_server -->|"registers"| node_api
node_api -->|"registers"| node_pageapi
node_pageapi -->|"calls"| node_pages
node_pages -->|"queries"| node_dbschema
node_storageapi -->|"calls"| node_storage
node_storage -->|"uses"| node_dbschema
node_assets -->|"uses"| node_storage
node_assets -->|"uses"| node_tree
node_storage -->|"uses"| node_fileformat
node_objectstorage -->|"uses"| node_fileformat
node_gitstorage -->|"uses"| node_fileformat
node_gitstorage -->|"reads and writes"| node_storage
node_scheduler -->|"uses"| node_dbschema
node_collab -.->|"registers routes"| node_server
node_notifications -.->|"dispatches"| node_server
node_mcp -.->|"accesses"| node_pageapi
node_auth -.->|"provides login"| node_server

click node_webapp "https://github.com/requarks/wiki/blob/scarlett/frontend/src/App.vue"
click node_filemanager "https://github.com/requarks/wiki/blob/scarlett/frontend/src/components/FileManager.vue"
click node_graphview "https://github.com/requarks/wiki/blob/scarlett/frontend/src/graph/engine.js"
click node_server "https://github.com/requarks/wiki/blob/scarlett/backend/index.ts"
click node_api "https://github.com/requarks/wiki/blob/scarlett/backend/api/index.ts"
click node_pageapi "https://github.com/requarks/wiki/blob/scarlett/backend/api/pages.ts"
click node_storageapi "https://github.com/requarks/wiki/blob/scarlett/backend/api/storage.ts"
click node_pages "https://github.com/requarks/wiki/blob/scarlett/backend/models/pages.ts"
click node_tree "https://github.com/requarks/wiki/blob/scarlett/backend/models/tree.ts"
click node_assets "https://github.com/requarks/wiki/blob/scarlett/backend/models/assets.ts"
click node_dbschema "https://github.com/requarks/wiki/blob/scarlett/backend/db/schema.ts"
click node_storage "https://github.com/requarks/wiki/blob/scarlett/backend/models/storage.ts"
click node_fileformat "https://github.com/requarks/wiki/blob/scarlett/backend/helpers/storageFiles.ts"
click node_objectstorage "https://github.com/requarks/wiki/blob/scarlett/backend/helpers/storageObjects.ts"
click node_gitstorage "https://github.com/requarks/wiki/blob/scarlett/backend/modules/storage/git/storage.ts"
click node_scheduler "https://github.com/requarks/wiki/blob/scarlett/backend/core/scheduler.ts"
click node_collab "https://github.com/requarks/wiki/blob/scarlett/backend/core/collab.ts"
click node_notifications "https://github.com/requarks/wiki/blob/scarlett/backend/notifications/index.ts"
click node_mcp "https://github.com/requarks/wiki/blob/scarlett/backend/mcp/tools/index.ts"
click node_blocks "https://github.com/requarks/wiki/blob/scarlett/blocks/block-gallery/component.js"
click node_auth "https://github.com/requarks/wiki/tree/scarlett/backend/modules/authentication"

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_webapp,node_filemanager,node_graphview,node_user toneBlue
class node_server,node_api,node_pageapi,node_storageapi toneAmber
class node_pages,node_tree,node_assets,node_storage,node_fileformat,node_objectstorage,node_gitstorage toneMint
class node_dbschema,node_scheduler,node_collab,node_notifications,node_auth toneRose
class node_mcp,node_blocks toneIndigo
```

## Components

### Web client

- [Wiki interface](https://github.com/requarks/wiki/blob/scarlett/frontend/src/App.vue): `frontend/src/App.vue`
- [File manager](https://github.com/requarks/wiki/blob/scarlett/frontend/src/components/FileManager.vue): `frontend/src/components/FileManager.vue`
- [Page graph](https://github.com/requarks/wiki/blob/scarlett/frontend/src/graph/engine.js): `frontend/src/graph/engine.js`

### Server and API

- [HTTP server](https://github.com/requarks/wiki/blob/scarlett/backend/index.ts): `backend/index.ts`
- [API routes](https://github.com/requarks/wiki/blob/scarlett/backend/api/index.ts): `backend/api/index.ts`
- [Page endpoints](https://github.com/requarks/wiki/blob/scarlett/backend/api/pages.ts): `backend/api/pages.ts`
- [Storage endpoints](https://github.com/requarks/wiki/blob/scarlett/backend/api/storage.ts): `backend/api/storage.ts`

### Wiki content

- [Page model](https://github.com/requarks/wiki/blob/scarlett/backend/models/pages.ts): `backend/models/pages.ts`
- [Content tree](https://github.com/requarks/wiki/blob/scarlett/backend/models/tree.ts): `backend/models/tree.ts`
- [Assets](https://github.com/requarks/wiki/blob/scarlett/backend/models/assets.ts): `backend/models/assets.ts`
- [Storage targets](https://github.com/requarks/wiki/blob/scarlett/backend/models/storage.ts): `backend/models/storage.ts`
- [Page file mapping](https://github.com/requarks/wiki/blob/scarlett/backend/helpers/storageFiles.ts): `backend/helpers/storageFiles.ts`
- [Object storage](https://github.com/requarks/wiki/blob/scarlett/backend/helpers/storageObjects.ts): `backend/helpers/storageObjects.ts`
- [Git storage target](https://github.com/requarks/wiki/blob/scarlett/backend/modules/storage/git/storage.ts): `backend/modules/storage/git/storage.ts`

### Platform services

- [Database schema](https://github.com/requarks/wiki/blob/scarlett/backend/db/schema.ts): `backend/db/schema.ts`
- [Job scheduler](https://github.com/requarks/wiki/blob/scarlett/backend/core/scheduler.ts): `backend/core/scheduler.ts`
- [Live collaboration](https://github.com/requarks/wiki/blob/scarlett/backend/core/collab.ts): `backend/core/collab.ts`
- [Notifications](https://github.com/requarks/wiki/blob/scarlett/backend/notifications/index.ts): `backend/notifications/index.ts`
- [Authentication providers](https://github.com/requarks/wiki/tree/scarlett/backend/modules/authentication): `backend/modules/authentication`

### Extensions

- [MCP tools](https://github.com/requarks/wiki/blob/scarlett/backend/mcp/tools/index.ts): `backend/mcp/tools/index.ts`
- [Content blocks](https://github.com/requarks/wiki/blob/scarlett/blocks/block-gallery/component.js): `blocks/block-gallery/component.js`

### Other components

- **Wiki user**

## Connections

- Wiki user → Wiki interface: uses
- Wiki interface → HTTP server: requests
- File manager → HTTP server: requests
- Wiki interface → Page graph: renders
- HTTP server → API routes: registers (evidence: `backend/index.ts`)
- API routes → Page endpoints: registers (evidence: `backend/api/index.ts`)
- Page endpoints → Page model: calls (evidence: `backend/api/pages.ts`)
- Page model → Database schema: queries (evidence: `backend/models/pages.ts`)
- Storage endpoints → Storage targets: calls (evidence: `backend/api/storage.ts`)
- Storage targets → Database schema: uses (evidence: `backend/models/storage.ts`)
- Assets → Storage targets: uses (evidence: `backend/models/assets.ts`)
- Assets → Content tree: uses (evidence: `backend/models/assets.ts`)
- Storage targets → Page file mapping: uses (evidence: `backend/helpers/storageFiles.ts`)
- Object storage → Page file mapping: uses (evidence: `backend/helpers/storageObjects.ts`)
- Git storage target → Page file mapping: uses (evidence: `backend/modules/storage/git/storage.ts`)
- Git storage target → Storage targets: reads and writes (evidence: `backend/modules/storage/git/storage.ts`)
- Job scheduler → Database schema: uses (evidence: `backend/core/scheduler.ts`)
- Live collaboration → HTTP server: registers routes (evidence: `backend/index.ts`)
- Notifications → HTTP server: dispatches
- MCP tools → Page endpoints: accesses
- Authentication providers → HTTP server: provides login
