Skip to content

Commit 1cb6f09

Browse files
authored
Add Current Implementation section to docs (#484)
* add-architecture * replace-svg-with-mermaid
1 parent 602746c commit 1cb6f09

File tree

3 files changed

+44
-4
lines changed

3 files changed

+44
-4
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# -- General configuration ---------------------------------------------------
2525
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2626

27-
extensions = ["myst_parser", "sphinx.ext.autodoc"]
27+
extensions = ["myst_parser", "sphinx.ext.autodoc", "sphinxcontrib.mermaid"]
2828

2929
templates_path = ["_templates"]
3030
exclude_patterns = ["ts/**"]

docs/source/developer/architecture.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,47 @@
11
# Code Architecture
22

3-
## Current implementation
3+
## Current Implementation
44

5-
COMING...
5+
Jupyter Collaboration consists of several Python packages and frontend extensions:
6+
7+
- **jupyter_server_ydoc**:
8+
A Jupyter Server extension providing core collaborative models. It manages YDocument data structures tied to notebook files and exposes WebSocket endpoints for real-time updates. It integrates CRDTs into Jupyter’s file management and kernel system.
9+
10+
- **jupyter_collaboration**:
11+
A meta-package that bundles the backend (`jupyter_server_ydoc`) and frontend (JupyterLab and Notebook 7 UI extensions). It connects the collaborative frontend UX (status badges, shared cursors, etc.) with the backend.
12+
13+
### Key dependencies:
14+
15+
- **pycrdt-websocket**:
16+
WebSocket provider library used by the collaboration layer. It runs an async WebSocket server that synchronizes pycrdt documents by managing CRDT updates between clients and the shared server YDoc.
17+
18+
- **pycrdt-store**:
19+
Persistence layer for CRDT documents. Uses an SQLite-backed store (`.jupyter_ystore.db`) by default to checkpoint document history. Enables autosave and document state recovery after restarts or offline periods.
20+
21+
<div align="center">
22+
23+
```{mermaid}
24+
graph TD
25+
subgraph "Frontend Clients"
26+
JL["JupyterLab Client"]
27+
NB["Notebook Client"]
28+
end
29+
30+
subgraph "Jupyter Server"
31+
COLLAB["Collaboration Layer"]
32+
WS["WebSocket Provider (pycrdt-websocket)"]
33+
YDOC["Shared YDoc"]
34+
STORE["Persistent Store (pycrdt-store)"]
35+
end
36+
37+
JL -->|WebSocket| COLLAB
38+
NB -->|WebSocket| COLLAB
39+
COLLAB --> WS
40+
WS --> YDOC
41+
YDOC --> STORE
42+
```
43+
44+
</div>
645

746
## Early attempts
847

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ docs = [
3333
"jupyterlab>=4.4.0",
3434
"sphinx",
3535
"myst-parser",
36-
"pydata-sphinx-theme"
36+
"pydata-sphinx-theme",
37+
"sphinxcontrib-mermaid"
3738
]
3839

3940
[tool.ruff]

0 commit comments

Comments
 (0)