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/.
- Install Node.js 22.12 or later and run
npm install. - Copy
.example.envto.envand fill in the Google OAuth and Supabase settings. - Add
http://localhost:8000/callbackas an authorized redirect URI for the Google OAuth client, then runnpm run devto start the local Astro development server at http://localhost:8000. - Run
npm test,npm run check, andnpm run buildbefore deploying.
For browser-based regression checks, follow MANUAL_TESTS.md.
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.
After the CLI package is published, run it with Node.js:
npx @chibat/leavesPass dev to connect to a local server at http://localhost:8000:
npx @chibat/leaves devThe package can be built and published from cli-package/:
npm run build:cli
cd cli-package
npm publish --access public- https://supabase.com/docs/guides/database
- https://getbootstrap.com/docs/5.2/getting-started/introduction/
- https://astro.build/
- https://preactjs.com/
npx wrangler login --device # for Dev Containers