A clear, cheerful notebook for Markdown, media, and encrypted backups.
Fresh is a personal notebook built with SvelteKit and deployed as a Cloudflare Worker. It keeps note metadata in D1, file attachments in R2, and account access behind GitHub OAuth or a registered passkey.
- Markdown notes with KaTeX math, syntax highlighting, GitHub alerts, emoji, links, tables, and tags
- Interactive task lists that update the saved Markdown directly from the rendered note
- Titles derived automatically from the first level-one heading
- Search, favorites, tag filters, responsive navigation, and rich attachment previews
- Personal Kanban boards with custom columns, editable cards, drag and menu movement
- Consistent overflow and right-click actions for notes, attachments, tags, boards, columns, and cards
- Images, audio, video, PDFs, documents, archives, and other files stored in R2
- Passkey sign-in with in-app device registration and management
- Password-encrypted
.freshupbackups with merge and replace import modes - A public Fresh landing page and responsive notebook at
/app
| Layer | Technology |
|---|---|
| Application | SvelteKit, Svelte 5, TypeScript |
| Runtime | Cloudflare Workers with Static Assets |
| Data | Cloudflare D1, Drizzle ORM |
| Files | Cloudflare R2 |
| Authentication | Better Auth, GitHub OAuth, WebAuthn passkeys |
| Markdown | Markdown-It, KaTeX, Highlight.js |
| Validation | Zod, Vitest, ESLint, svelte-check |
Requirements: Node.js 24 LTS (recommended), npm, and a GitHub OAuth app for sign-in. Supported Node.js ranges are ^22.13.0, ^24.0.0, or >=26.0.0.
npm install
cp .env.example .env
npm run db:migrate:local
npm run devConfigure the OAuth app with this local callback URL:
http://localhost:5173/api/auth/callback/github
Then fill the local environment file:
| Variable | Purpose |
|---|---|
GITHUB_CLIENT_ID |
GitHub OAuth application ID |
GITHUB_CLIENT_SECRET |
GitHub OAuth application secret |
BETTER_AUTH_SECRET |
Long random secret used to sign authentication state |
BETTER_AUTH_URL |
Application origin, normally http://localhost:5173 |
Vite reads .env. Wrangler reads .dev.vars, so copy the same local values there when running Wrangler commands directly. Both files are ignored by Git. Keep real credentials out of source control and commit only the provided example files.
npm run check # Svelte and TypeScript diagnostics
npm run lint # ESLint
npm test # Unit tests
npm run build # Production build
npm run db:migrate:local # Apply migrations to local D1
npm run db:migrate:prod # Apply migrations to remote D1
npm run deploy # Build and deploy with WranglerThe Worker expects these bindings from wrangler.jsonc:
DB: a D1 database namedfreshATTACHMENTS: an R2 bucket namedfresh-attachmentsASSETS: the generated SvelteKit static assets
Create the D1 database and R2 bucket in your Cloudflare account, update the D1 database ID, apply the migrations, and store production credentials with Wrangler secrets before the first deployment.
npx wrangler secret put GITHUB_CLIENT_ID
npx wrangler secret put GITHUB_CLIENT_SECRET
npx wrangler secret put BETTER_AUTH_SECRET
npm run db:migrate:prod
npm run deploySet BETTER_AUTH_URL to the production origin in the Worker environment and add the matching production callback URL to the GitHub OAuth app.
Fresh exports notes, tags, and attachments into a .freshup archive. Encryption happens in the browser with AES-256-GCM using a PBKDF2-SHA-256 key derived from the backup password. The password is never stored in the archive or sent to the server during export.
The current FRESHUP1 format remains import-compatible with backups created before the project was renamed to Fresh.
Fresh is available under the Apache License 2.0.