Skip to content

Deploy from the command line

Use this path if you prefer a terminal. You need Bun, Node 20 or newer, and a Cloudflare account.

Terminal window
git clone https://github.com/homielab/noteflare
cd noteflare
bun install
bunx wrangler login
bun run deploy

bun run deploy builds the app, deploys the Worker (creating the D1 database on the first run) and applies the database migrations.

Then turn on Cloudflare Access. Set the variables in wrangler.jsonc on your computer and run bun run deploy again.

Terminal window
cp dev.vars.sample .dev.vars # DEV_USER_EMAIL=you@example.com, local only
bun run db:migrate:local
bun run dev:api # terminal 1: Worker + local D1 on :8787
bun run dev # terminal 2: Vite on :5173, proxies /api
bun run test

DEV_USER_EMAIL is honored only while the Access variables are empty and the request is to localhost, so it can never open a deployed app.

The service worker exists only in production builds. To try offline mode locally, run bun run build && bun run dev:api and open http://localhost:8787.