Skip to content
chibatPublic

About

🍃Leaves - Microblog with Markdown

Topics

Resources

Stars

18 stars

Watchers

1 watching

Forks

Repository files navigation

logo

Leaves

Leaves is a Markdown microblog built with Astro and Preact. The web application runs on Cloudflare Workers and uses Supabase for storage and Google OAuth for sign-in.

Source code for https://leaves.chiba.dev/.

Pages and API endpoints use Astro's file-based routing under src/pages/. Interactive Preact components are rendered as Astro islands; page data needed for the initial post lists is loaded on the server and included in the HTML. Application code is organized under src/: shared UI in components/, interactive islands in islands/, browser code in client/, and server/data code in server/. The ~ import alias points to src/.

Development

  1. Install Node.js 22.12 or later and run npm install.
  2. Copy .example.env to .env and fill in the Google OAuth and Supabase settings.
  3. Add http://localhost:8000/callback as an authorized redirect URI for the Google OAuth client, then run npm run dev to start the local Astro development server at http://localhost:8000.
  4. Run npm test, npm run check, and npm run build before deploying.

For browser-based regression checks, follow MANUAL_TESTS.md.

Cloudflare Workers

Set LEAVES_AUTH_CLIENT_ID, LEAVES_AUTH_CLIENT_SECRET, SUPABASE_HOST, and SUPABASE_SERVICE_ROLE_KEY as Worker secrets or environment variables. Deploy with npm run deploy; npm run preview runs the built Worker locally.

Leaves CLI

After the CLI package is published, run it with Node.js:

npx @chibat/leaves

Pass dev to connect to a local server at http://localhost:8000:

npx @chibat/leaves dev

The package can be built and published from cli-package/:

npm run build:cli
cd cli-package
npm publish --access public

References


npx wrangler login --device # for Dev Containers

About

🍃Leaves - Microblog with Markdown

Topics

Resources

Stars

18 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages