🪵 Experimental web front-end for Logseq deployed to Cloudflare Pages Functions.
- TypeScript 58.9%
- Svelte 26%
- PLpgSQL 7.2%
- Just 4.6%
- JavaScript 1.8%
- Other 1.5%
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
- Upload triggers data extraction to Postgres database hosted on Supabase.
- Page assembled on-the-fly inside Cloudflare edge function using Web Workers.
- Functions perform server-side transclusion using recursive async reducer functions.
- API endpoints called whenever a reducer needs more data.
- Svelte components used to assemble display.
- 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
- Supabase instance with fresh project.
- Cloudflare Pages account.
- GitHub for simple Pages deployment
Online use
- Copy source to your own GitHub repo
- Create accounts on Supabase and Cloudflare Pages
- Run
setup.sqlin Supabase SQL editor - Add Supabase environment variables
- Push commit to GitHub to deploy to Cloudflare
- Navigate to Pages site
- 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.
- Copy source code into a working directory
- Create
.env.localby copying.env.example(See Online use for settings.) - Run command
bun installto install dependencies - Run
setup.sqlin the Supabase SQL editor - Start dev server with
bunx vite devusehfor help
Justfile
Just is like make only a little more forgiving. Installation instructions.
justlist recipesjust supabaserun supabase cli commands with bunxjust devstart a vite dev server with bunjust testrun api tests with curljust buildbuild for production with vitejust previewpreview build with vitejust cleanspic and span edition- List recipes to view more