中文 | English
Turn your daily scribbles into Steam-style patch notes. Local, private, offline-first — no accounts, no servers, data lives only on your machine. It goes online only at the moment you hit “Generate” to call the LLM.
| Today · Input & Generate | Result · Patch Notes Card |
|---|---|
![]() |
![]() |
Left: Today — draft input + one-click generate. Right: Steam-style patch notes card with stackable “More savage / More game-ish” re-rolls, screenshot & copy.
- Today — Write 3–10 lines about your day → Steam-style card. Stackable
[More savage] / [More game-ish]re-rolls; auto-saved per day - History — Grouped by month, newest first. Open any day to view the original card, screenshot / copy / delete
- Reports — Pick a month → auto-aggregate (active days · section counts · 6-stat avg · top Buff/Nerf) → generate
Major Release - Backup — Export / import full JSON for cross-device migration. Same date overwrites, confirmation before import
- Settings — OpenAI-compatible (OpenRouter / DashScope / DeepSeek / Moonshot) Base URL / Key / Model / Temperature 0–2 / Reasoning toggle / Extra params + connection test
- i18n — Full bilingual UI (EN / 中文), default
EN, toggle in header or Settings. Preference persisted tolocalStorage:lpn_lang
Details: one entry per day, version vYY.M.D[.N] auto-increments; draft localStorage:lpn_draft auto-saved; zero animation inside the card for stable screenshots.
Requirements Node.js ≥ 20
# 1. Install (China mirror if needed --registry=https://registry.npmmirror.com)
npm install
# if install scripts are blocked
npm install-scripts approve esbuild workerd && npm rebuild esbuild workerd
# 2. Init local DB (once)
npx wrangler d1 execute DB --local --file schema.sql
# 3. Build + start
npm run build
npm run dev:full # wrangler dev :8787Open http://localhost:8787, then go to Settings to configure your API Key.
HMR dev: in another terminal
npm run dev(Vite :5173 proxies/api→ 8787)
You own the key. Two ways:
- Recommended: Settings → paste Key → Save → Test connection (green). Key is stored in local D1, UI only shows masked
sk-or-v1…1042 - Manual: write
OPENROUTER_KEY=sk-xxxxin.dev.varsat repo root (already in.gitignore)
Default: OpenRouter · stealth/ox-alpha (free). To switch provider just change Base URL / Model / Key in Settings — no code change needed.
| Page | What it does |
|---|---|
| Today | Input today’s events → generate card, stack savage/game-ish, re-roll overwrites the day |
| History | By month, view original card, screenshot, copy, delete |
| Reports | Aggregate by month + generate Major Release |
| Backup | Full JSON export / import |
| Settings | All OpenAI-compatible settings + language + connectivity test |
Default EN. Toggle via the EN / 中文 button in the top nav or Settings → Language. Stored in localStorage. Patch content language follows the model’s output (prompts are bilingual-ready).
- Local DB:
.wrangler/state/v3/d1/.../db.sqlite(SQLite, survives restarts) - Migrate to another machine:
- Option 1: Backup → Export JSON → Import on new machine
- Option 2: Copy the whole
.wrangler/statefolder to the same path on the new machine
- Draft:
localStorage:lpn_draft(separate from DB)
Never wrangler deploy or expose this project to the public internet:
- No auth — anyone on the internet could burn your API Key
- Key is stored plaintext in local D1, safe only on
localhost
package.json has no deploy script on purpose; do not add one in CI. /.dev.vars is in .gitignore — rotate immediately if leaked.
Vite · React 19 · TypeScript 5 · Tailwind 4 · React Bits (FaultyTerminal / SplitText / ClickSpark / ShinyText / SpotlightCard / CountUp) · Cloudflare Worker (local runtime only) · D1 SQLite · html2canvas-pro · Custom i18n (EN/zh persisted)
npm test # vitest (schema / monthly / text / dates / worker-lib)
npm run build # tsc --noEmit + vite build- Slow / failed generation: ox-alpha is a reasoning model, 10–30s is normal. Hit retry on failure. Temperature-related 400s are auto-retried (strip temperature → strip json_mode)
- Port in use:
npx wrangler dev --port <other>and updatevite.config.tsproxy target - Use on phone / LAN: Only localhost is intentional. To open to LAN at your own risk:
npx wrangler dev --ip 0.0.0.0(no auth) - wrangler hangs and won’t exit: Known local quirk — the command already succeeded, just
Ctrl+C
Issues / PRs welcome. Please read AGENTS.md first (agent skills entry, directory & testing conventions, branch & commit spec).
MIT — see LICENSE.
All rights reserved by your life · generated by Life Patch Diary

