-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture Overview
GitHub Copilot edited this page May 12, 2026
·
1 revision
mdedit.io is a server-rendered web application with a browser-based editor and a Node.js backend.
| Layer | Technology |
|---|---|
| Runtime | Node.js 20, Fastify |
| Database | SQLite (via db.js) |
| PDF export | Pandoc + XeLaTeX / paged.js |
| DOCX export | Pandoc |
| Citations | Pandoc Citeproc (CSL/JSON) |
| Diagrams | Mermaid.js |
| Math | KaTeX |
| Frontend | Vanilla JS, no framework |
| Containerization | Docker, Docker Compose |
server.js — Fastify server, all HTTP routes and API endpoints
db.js — SQLite database layer (documents, sessions, sharing)
public/
app.js — Client-side editor application
index.html — App shell
styles.css — Stylesheet
modules/ — Feature modules (AI, citations, outline, etc.)
vendor/ — Bundled third-party libraries (no external CDN dependency)
scripts/ — CI/validation scripts (visual-smoke, i18n-validate, etc.)
docs/ — Operational and product documentation
Browser → Fastify (server.js) → SQLite (db.js)
→ Pandoc (PDF/DOCX export)
→ External AI API (chat completion)
- Documents (pastes): stored in SQLite with UUID, Markdown content, title, shared flag
-
Sessions: HttpOnly cookie (
sid), server-side session in SQLite -
Assets: stored in
data/assets/
- Client sends Markdown + front matter + bibliography to
/api/export/pdf - Server writes temp files, calls Pandoc with the appropriate filters
- Pandoc runs Citeproc (citations), XeLaTeX or paged.js (layout), Mermaid/KaTeX
- Server returns the PDF blob, temp files are cleaned up in
finally
- Single-page app loaded from
public/index.html - No build step required — all assets are pre-bundled in
public/vendor/ - AI panel, Outline panel, and Preview panel share a single tab container
- Live preview updates debounced on each keystroke