Open source · MIT · Self-hosted

Markdown notes that live in your own Google Drive.

Markyard is a fast, offline-capable notes app you host yourself on a single Cloudflare Worker. Every note stays a plain .md file in a Drive folder you own, so Drive for desktop, Obsidian or any other editor keep working alongside it.

Illustration of the Markyard interface, with sample content: file tree, rendered note with tasks and wikilinks, outline and backlinks.

Features

A real notes app, without handing over your notes

Markyard reads and writes your Drive folder directly. Close the tab, uninstall it, or switch tools: your files are still there, in a format every editor understands.

  • Drive is the source of truth

    Browse, create, rename, move and delete Markdown files and folders straight in your Drive folder, shortcuts included. No server-side database holds your notes.

  • Conflict-safe saves

    Every save is a compare-and-swap on the Drive ETag, so edits from another device, Drive for desktop or Drive's own editor are caught instead of silently overwritten. Conflicts open a side-by-side merge view.

  • Offline-first, live sync

    A local IndexedDB cache and an offline edit queue keep you writing without a connection, with optional offline pinning of the whole vault. Drive changes sync in the background.

  • Editor and rich preview

    A CodeMirror 6 editor with instant preview: GFM tables and checkboxes, syntax highlighting, KaTeX math, Mermaid diagrams, callouts and frontmatter properties.

  • Built for linked notes

    [[Wikilinks]] with autocomplete and backlinks, a Tasks dashboard across the vault, slash commands, templates and a Cmd+K palette with full-text search.

  • Attachments and history

    Paste or drop images into _attachments/, served from your own origin. Browse, diff and restore earlier Drive revisions of any note.

  • One deploy, many vaults

    Leave the root folder unset and each allowed Google account picks or creates its own isolated Drive vault, switchable anytime from Settings.

  • Optional cross-device state

    Turn on a Cloudflare D1 database to sync settings, the selected vault and your last open note across devices. Leave it off and the Worker stays stateless.

How it works

Your browser, one Worker, your Drive

A single Cloudflare Worker serves the installable web app and sits between your browser and Google as a backend-for-frontend. There is no other server to run.

  1. Browser PWA

    React 19, CodeMirror 6 and an IndexedDB cache. Installable on desktop and mobile.

  2. Cloudflare Worker

    Static assets plus the /api/* BFF, in TypeScript and Effect, deployed with Alchemy.

    Optional D1 (SQLite) for UI state

  3. Google Drive

    One folder of plain .md files and attachments that you own.

Security by design

  • Tokens stay on the server

    Google OAuth tokens never reach the browser. The Worker is a backend-for-frontend that makes every Drive call itself.

  • Sealed session cookies

    Sessions live in AES-256-GCM sealed, HttpOnly __Host- cookies, scoped to your origin.

  • Strict Content Security Policy

    The app runs under default-src 'self'. Link previews are fetched by the Worker with SSRF guards instead of loading third-party content.

The design choices are recorded as architecture decision records in docs/adr.

Self-host

Deploy your own in a few steps

You need Node.js 24+ and pnpm, a Google Cloud OAuth web client with the Drive API enabled, and a Cloudflare account.

  1. Clone and install

    Get the source and install the dependencies of the web app and the Worker.

    git clone https://github.com/giovacalle/markyard.git
    cd markyard
    pnpm install
  2. Configure

    Copy .env.example to .env, fill in your Google OAuth client, PUBLIC_ORIGIN and the allowed emails, and generate a cookie key. Add ${PUBLIC_ORIGIN}/api/auth/callback to your OAuth client's redirect URIs. Set ROOT_FOLDER_ID to your Drive folder, or remove it so each user picks their own vault.

    cp .env.example .env
    echo "1:$(openssl rand -hex 32)"
  3. Deploy to Cloudflare

    Optionally set CUSTOM_DOMAIN for your own hostname and ENABLE_STATE_DB=1 for D1 sync.

    pnpm exec alchemy login
    pnpm build
    pnpm exec alchemy deploy --stage prod

Your notes, your Drive, your Worker.

Markyard is free and open source under the MIT license.

Get Markyard on GitHub