Skip to content

πŸ’° A privacy-first, offline-capable personal finance PWA built with Eleventy (11ty), Tailwind CSS, and IndexedDB. Supports transactions with accounts and transfers, budgets with monthly usage, and robust offline caching via a service worker.

Notifications You must be signed in to change notification settings

brennanbrown/moneytree

Repository files navigation

Moneytree

A privacy-first, offline-capable personal finance PWA built with Eleventy (11ty), Tailwind CSS, and IndexedDB. Supports transactions with accounts and transfers, budgets with monthly usage, and robust offline caching via a service worker.

Getting Started

Prereqs: Node 18+ recommended.

npm install
npm run dev
  • App runs at http://localhost:8080 by default (Eleventy dev server)
  • CSS/JS bundles are emitted to src/assets/dist/
  • PWA service worker is served from src/assets/workers/sw.js and caches the app shell for offline

Scripts

  • npm run dev β€” Start Eleventy dev server + watch Tailwind and JS (esbuild)
  • npm run build β€” Production build (minified CSS/JS) + Eleventy output in _site/
  • npm run test β€” Run unit tests once
  • npm run test:watch β€” Run unit tests in watch mode

Structure

  • src/_includes/layouts/ β€” Nunjucks layouts
  • src/pages/ β€” App pages
  • src/assets/css/main.css β€” Tailwind entry
  • src/assets/js/app.js β€” App JS entry
  • src/assets/js/core/db.js β€” IndexedDB helpers and stores (transactions, categories, accounts, settings, receipts, budgets)
  • src/assets/workers/sw.js β€” Service worker
  • src/manifest.json β€” PWA manifest
  • tests/ β€” Vitest tests (happy-dom + fake-indexeddb)

Key pages:

  • src/pages/index.njk β€” Dashboard (account overview, recent transactions, budget summary)
  • src/pages/transactions/index.njk β€” Transactions (add, list, filters; supports transfers)
  • src/pages/budgets/index.njk β€” Budgets (create, list, monthly usage)
  • src/pages/categories/index.njk β€” Categories (seeded defaults, add)
  • src/pages/accounts/index.njk β€” Accounts (add, list)

Features

  • Transactions: expenses/income with category, account, date, description
  • Transfers: create two linked entries (outflow/inflow) with shared transferId
  • Filters: search by description, filter by category and account
  • Budgets: create monthly budgets per category; usage computed from current-month transactions
  • Dashboard: account overview, recent transactions, budget summary
  • PWA: offline-first app shell; stale-while-revalidate for assets; network-first with cache fallback

Testing

Uses Vitest with happy-dom and fake-indexeddb.

npm run test

Tests include:

  • DB helpers for transactions, categories, accounts, budgets
  • Transactions page (add, filters) and transfer linkage
  • Dashboard rendering
  • Service worker offline caching behavior

Development Notes

  • Data is stored locally in IndexedDB β€” privacy-first, no external APIs.
  • Seeding uses idempotent helpers to avoid duplicate categories in tests.
  • Make sure to hard-refresh to update the service worker after changes.

About

πŸ’° A privacy-first, offline-capable personal finance PWA built with Eleventy (11ty), Tailwind CSS, and IndexedDB. Supports transactions with accounts and transfers, budgets with monthly usage, and robust offline caching via a service worker.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published