Zelife is a personal finance and task companion that keeps data local first and can optionally sync to your private GitHub Gist. It ships as an installable PWA (offline-first) with an in-app update prompt.
- Finance tracking with daily/monthly views, Jalali parsing, quick date navigation.
- Task manager with daily/monthly toggles.
- Optional GitHub Gist sync (token + gist ID + filename) for private backups.
- Manual/auto sync toggle, last sync status, and error reporting.
- PWA install, offline cache, and update prompt in Settings.
- Export financial data to clipboard (minified JSON).
- Language toggle (EN/FA); theme-aware UI.
- Full data reset (guarded by confirmation).
- UI: React 19 + TypeScript + Vite, Tailwind CSS utilities.
- State: Zustand with
persisttolocalStorage(finance-storagekey). - PWA:
vite-plugin-pwawithregisterType: "prompt"and a custompublic/sw.js. - Routing:
BrowserRouterwith base/(custom domainzelife.ir). - Build/dev: Bun scripts.
src/– app code (pages, components, hooks, store, utils).public/– static assets,sw.js,offline.html,CNAME.vite.config.ts– Vite + PWA setup (manifest, caching, base, scope)..github/workflows/deploy.yml– GitHub Pages build/deploy.
- Install deps:
npm install
- Dev server (port 5050 by default):
npm run dev
- Build:
npm run build
- Preview production build:
npm run preview
- Create a PAT with gist scope: https://github.com/settings/tokens
- Create or pick a Gist; copy its ID.
- In Settings → “Sync Data” (edit icon), fill:
- Token
- Gist ID
- Filename (e.g.,
data.json)
- Enable the Sync toggle. Manual sync via the sync icon; last action and errors display under Sync Data.
- SW registers immediately; updates use “prompt” mode (no auto
skipWaiting). - When a new version is ready, Settings status shows “Update available.”
- Click the status text (“Check for updates”) to force a check; choose “Update now” in the modal to activate the waiting SW.
- Offline: assets cached by Workbox config in
vite.config.tsand logic inpublic/sw.js. - Fallback:
404.html(copied fromindex.htmlin CI) enables SPA routing on GitHub Pages.
- Output:
dist/(includesCNAMEforzelife.ir). - CI:
.github/workflows/deploy.ymlinstalls with Bun, builds, copiesdist/index.html→dist/404.html, uploads artifact, and deploys viaactions/deploy-pages. - DNS for
zelife.ir:@A → 185.199.108.153 / 185.199.109.153 / 185.199.110.153 / 185.199.111.153wwwCNAME →<your-username>.github.io
- GitHub → Settings → Pages: set custom domain
zelife.ir, enforce HTTPS.
- Export financial data: Settings → “Export financial data” (clipboard JSON).
- Reset all data: Settings → “Reset Data” (irreversible).
- Storage: local-only by default (Zustand + localStorage); Gist sync is opt-in.
npm run dev– start dev servernpm run build– type-check then build for productionnpm run preview– serve the production build locallynpm run lint– lint the codebase
- Updates not appearing: open Settings and click the status (“Check for updates”); ensure the modal shows when a worker is waiting. Hard refresh if needed.
- Sync errors: verify PAT has
gistscope, Gist ID/filename are correct, and you’re online. - Routing 404s on Pages: ensure
dist/404.htmlexists (CI step) and Pages is serving from the latest deploy.