Skip to content

🪵 Experimental web front-end for @logseq deployed to the @cloudflare Pages Functions. Mirror of metaform on Codeberg. 👇

License

Notifications You must be signed in to change notification settings

vhscom/metaform

Repository files navigation

Metaform

Experimental web front-end for Logseq.

Features

  • Display Logseq data on the open web.
  • Edge-side page and block embeds.
  • Web form to upload Logseq JSON exports.
  • REST endpoints for page and block data.
  • Works with JavaScript disabled.

Demo

View pre-recorded live demo on Twitter.

How it works

  1. Upload triggers data extraction to Postgres database hosted on Supabase.
  2. Page assembled on-the-fly inside Cloudflare edge function using Web Workers.
  3. Functions perform server-side transclusion using recursive async reducer functions.
  4. API endpoints called whenever a reducer needs more data.
  5. Svelte components used to assemble display.
  6. Display logic searches content for embed tags and injects available data.

Performance

Lighthouse tests on Cloudflare have shown depth 6 page embeds with 300ms first paint.

Requirements

Online use

  1. Copy source to your own GitHub repo
  2. Create accounts on Supabase and Cloudflare Pages
  3. Run setup.sql in Supabase SQL editor
  4. Add Supabase environment variables
  5. Push commit to GitHub to deploy to Cloudflare
  6. Navigate to Pages site
  7. Upload Logseq JSON export from upload page

Development

You must have Bun and a recent Node.js LTS. Using fnm a Node.js LTS will be installed automatically.

  1. Copy source code into a working directory
  2. Create .env.local by copying .env.example (See Online use for settings.)
  3. Run command bun install to install dependencies
  4. Run setup.sql in the Supabase SQL editor
  5. Start dev server with bunx vite dev use h for help

Justfile

Just is like make only a little more forgiving. Installation instructions.

  • just list recipes
  • just supabase run supabase cli commands with bunx
  • just dev start a vite dev server with bun
  • just test run api tests with curl
  • just build build for production with vite
  • just preview preview build with vite
  • just clean spic and span edition
  • List recipes to view more