Skip to content

Latest commit

ย 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Dnyx Draft logo

Dnyx Draft

A local-first Markdown workspace: editor, live preview, multi-format file viewer, and BYOK AI writing assistant.

Built with Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4, Shadcn UI, Zustand, and Dexie.js.

License Framework Language Styling


๐Ÿš€ Key Features

Editing & Preview

  • โšก Real-Time Live Preview: Split-screen or full-screen rendering of GitHub Flavored Markdown (GFM) with AST-synchronized bidirectional scrolling.
  • ๐Ÿงฎ LaTeX Math: Inline ($E = mc^2$) and block equation rendering powered by KaTeX.
  • ๐Ÿ“Š Extended Diagram Engines: Mermaid, Markmap (mind maps), Vega-Lite (charts), PlantUML, Graphviz/DOT, D2, WaveDrom, ERD, Pikchr (via Kroki), ABC music notation (with audio playback), GeoJSON/TopoJSON maps (Leaflet), and a 3D STL model viewer (Three.js) โ€” every engine shares a zoom/pan/copy-SVG/download-PNG/fullscreen toolbar.
  • ๐Ÿ” Find & Replace: In-editor search (Ctrl+F) with match count, case sensitivity, whole word, and regex support, plus a workspace-wide global search/replace across all documents.
  • ๐Ÿ“ Insert Diagram: Searchable modal with 17 diagram templates across 9 categories.
  • ๐Ÿ“Š Interactive Table Builder: Visual spreadsheet-style modal to create, align, resize, and insert Markdown tables.
  • ๐Ÿ”„ Format & Data Converters: CSV/TSV โ†’ Markdown table converter, plus a JSON โ‡„ XML โ‡„ YAML โ‡„ CSV data format converter.
  • ๐Ÿงน Auto-Formatter: AST-based linter that aligns Markdown table columns and normalizes document structure.
  • ๐Ÿ“ˆ Document Diagnostics: Flesch Reading Ease score, word/syllable counts, reading time, and speaking time.
  • ๐ŸŽค Voice Dictation: Speech-to-text input via the Web Speech API.
  • โ†”๏ธ Text Direction & Alignment: LTR/RTL toggle plus left/center/right/justify alignment.
  • ๐Ÿ˜Š Emoji Picker: Full emoji database via @emoji-mart/react with cursor insertion.
  • ๐Ÿ“ฝ๏ธ Presentation Mode: Marp-style full-screen slide deck with keyboard navigation and progress tracking.
  • ๐Ÿ“š Template Hub: Pre-built starter templates (READMEs, technical RFCs, API specs, academic papers, meeting notes, feature tours).
  • ๐Ÿ•ธ๏ธ Knowledge Graph View: Force-directed graph of all documents linked by [[wikilinks]]/references, with zoom, pan, and click-to-open.
  • ๐Ÿงญ Command Palette: Keyboard-driven Cmd/Ctrl+K command palette for navigating actions, documents, and settings.

AI (Bring Your Own Key)

  • ๐Ÿค– AI Writing Actions: Summarize, fix grammar, rewrite, and shorten selected text or the whole document using your own Anthropic (Claude) or OpenAI API key.
  • ๐Ÿช„ AI Diagram Generation: Describe a diagram in plain language and get a ready-to-insert Mermaid block.
  • ๐Ÿ” Encrypted Key Vault: API keys are AES-GCM encrypted at rest in IndexedDB, unlocked per-session with a local passphrase โ€” keys never touch a Dnyx Draft server.

Files & Workspace

  • ๐Ÿ“ Folder Explorer & Tabs: Multi-document tabs, nested folders, search filtering, and favorites.
  • ๐Ÿ—‚๏ธ Multi-Format File Viewer: Beyond Markdown โ€” view and edit CSV/TSV tables, JSON/XML/YAML trees, XLSX spreadsheets, Jupyter notebooks, PDFs, images, code files (syntax highlighted), config files, and browse ZIP/archive contents, all in one workspace.
  • ๐Ÿ’ป Local Folder Mounting: Open and edit a real folder on your computer via the native File System Access API โ€” no upload required.
  • ๐Ÿ“ฅ Import Anything: Convert .docx, .html, and .pdf files to Markdown on import; import whole folders at once.
  • ๐Ÿ“ค Smart Export: Export to Markdown, HTML, Word (.docx), JSON, PDF (with diagram serialization), or a full ZIP of the workspace.
  • ๐ŸŒ GitHub Import: Pull Markdown files from public or private repositories using an encrypted Personal Access Token vault (AES-GCM, up to 50 tokens).
  • ๐Ÿ“ README Builder: Dedicated /readme-builder tool โ€” a guided, section-by-section wizard (features, tech stack, install steps, badges, folder structure, FAQ, etc.) that pulls live metadata from a GitHub repo and renders a polished, exportable README.
  • ๐Ÿ”’ Document Encryption Vault: Password-protect any individual document with AES-GCM.
  • ๐Ÿ•“ Version History: Per-document revision snapshots with line-by-line diffing and one-click restore.
  • ๐Ÿ—‘๏ธ Trash & Recovery: Dedicated trash window with restore and permanent delete.
  • ๐Ÿ’ฌ Comments: Threaded, anchored comment system with resolve/reopen, backed by IndexedDB.
  • ๐Ÿค Live Share: Polling-based real-time collaboration with host/editor/viewer roles, invite links, and 2-second content sync.
  • ๐Ÿ”— Share Snapshots: Fast, ephemeral read-only shareable links.

Platform

  • ๐Ÿ’พ Local-First & Privacy-First: Zero login required. All documents, folders, revisions, comments, and tokens persist locally via IndexedDB (Dexie.js).
  • ๐ŸŽจ Light & Dark Themes: High-contrast light theme and deep dark theme with zero FOUC via next-themes.
  • ๐ŸŒ 15-Language UI: EN, ZH, JA, KO, FR, DE, ES, PT-BR, RU, AR, HI, BG, TR, IT.
  • ๐Ÿ“ฑ PWA: Service worker with offline caching; installable as a standalone app.
  • ๐ŸŒ Marketing Site: Standalone landing app (apps/landing) showcasing the product.

๐Ÿ› ๏ธ Tech Stack & Architecture

  • Monorepo: Turborepo + pnpm workspaces
  • Framework: Next.js 16 (App Router) with Server Components & Streaming SSR, React 19
  • Language: 100% Strict TypeScript (zero JavaScript)
  • UI Components: Shadcn UI & Radix UI primitives
  • Styling: Tailwind CSS v4
  • State Management: Zustand
  • Local Storage: Dexie.js (IndexedDB)
  • Validation: Zod + React Hook Form
  • Error Handling: Sentry error boundaries
  • Testing: Vitest (unit/integration/benchmarks) + Playwright (E2E) + React Testing Library + jsdom
  • Tooling & Linter: Biome + Husky (commit-msg & pre-commit hooks) + Turborepo
  • Edge/Serverless: Cloudflare Pages Functions (functions/api) mirror the Next.js API routes for edge deployment
  • Containerization: Docker + docker-compose

๐Ÿ“ฆ Project Structure

Dnyx-Draft/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ web/                     # Next.js 16 (App Router) main application
โ”‚   โ”‚   โ”œโ”€โ”€ app/                 # Routes: editor, /readme-builder, /s/[id] (share), api/*
โ”‚   โ”‚   โ”œโ”€โ”€ components/          # editor, preview, viewers, modals, sidebar, navbar, graph
โ”‚   โ”‚   โ””โ”€โ”€ lib/                 # ai, crypto, db, export, format, import, i18n, store, utils
โ”‚   โ””โ”€โ”€ landing/                 # Marketing/landing site (Next.js)
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ @dnyx-draft/engine        # Shared Markdown AST parsing library
โ”‚   โ”œโ”€โ”€ @dnyx-draft/crypto-vault  # AES-256-GCM encryption package
โ”‚   โ”œโ”€โ”€ @dnyx-draft/storage       # Dexie.js database schemas
โ”‚   โ””โ”€โ”€ @dnyx-draft/ui            # Shared UI design tokens & theme library
โ”œโ”€โ”€ functions/
โ”‚   โ””โ”€โ”€ api/live-room.ts         # Cloudflare Pages Function mirror of Live Share API
โ”œโ”€โ”€ docs/                        # Full documentation suite
โ”‚   โ”œโ”€โ”€ llms/                    # AI/LLM cheatsheets (Next.js, Tailwind, shadcn, TS)
โ”‚   โ”œโ”€โ”€ wiki/                    # GitHub-wiki-style guides
โ”‚   โ”œโ”€โ”€ architecture.md          # Architecture & data flow
โ”‚   โ”œโ”€โ”€ DESIGN.md                # UI & design tokens specification
โ”‚   โ”œโ”€โ”€ PRD.md / BRD.md / TRD.md # Product/business/technical requirements
โ”‚   โ”œโ”€โ”€ PRODUCT.md               # Product vision & user personas
โ”‚   โ”œโ”€โ”€ setup.md                 # Local setup & installation
โ”‚   โ”œโ”€โ”€ testing.md               # Vitest & Playwright testing guide
โ”‚   โ”œโ”€โ”€ deployment.md            # Vercel, Docker, and Cloudflare deployment
โ”‚   โ””โ”€โ”€ troubleshooting.md       # Common solutions & FAQ
โ”œโ”€โ”€ tests/                       # unit, integration, e2e (Playwright), performance benches
โ”œโ”€โ”€ scripts/                     # setup-env.ts and other dev scripts
โ””โ”€โ”€ .github/                     # Workflows & Copilot instructions

๐Ÿ’ป Quick Start

1. Prerequisites

  • Node.js >= 20.x
  • pnpm >= 10.x

2. Installation

# Clone the repository
git clone https://github.com/dnyxtech/dnyx-draft.git
cd dnyx-draft

# Install dependencies
pnpm install

# Start development server (web app)
pnpm dev

Open http://localhost:3000 in your browser.

3. Other dev commands

pnpm dev:landing    # Run only the landing site
pnpm dev:all        # Run every app in the monorepo
pnpm build          # Production build of the web app
pnpm build:all      # Production build of every app

๐Ÿงช Testing & Code Quality

pnpm test           # Run Vitest unit/integration suite
pnpm test:watch     # Vitest in watch mode
pnpm test:e2e       # Playwright end-to-end tests
pnpm bench          # Vitest performance benchmarks
pnpm typecheck      # Type check all workspaces (Turborepo)
pnpm check          # Biome format & lint (auto-fix)
pnpm lint           # Lint all workspaces (Turborepo)

๐Ÿณ Docker

docker compose up --build

See docs/deployment.md for Vercel and Cloudflare deployment guides.


๐Ÿ’– Sponsor This Project

Sponsor

If Dnyx Draft saves you time, consider sponsoring the project on GitHub โ€” it helps fund ongoing development and maintenance. โญ Starring the repo helps too!


๐Ÿ“„ License

This project is open source and available under the MIT License.

About

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages