Last Updated: February 7, 2026
This guide provides information about the project structure and how to work with the codebase.
# Install dependencies
npm install
# Prepare Nuxt (generate .nuxt directory)
npx nuxi prepare
# Start development server
npm run dev
# Run unit tests
npm test
# Run E2E tests (requires dev server)
npm run test:e2e
# Build for production
npm run build- Overall Progress: 92% Complete (Phases 1-5 complete, Phase 6 nearly complete)
- Code Base: ~10,370 lines across 11 composables, 6 pages, 4 components
- Test Coverage: 106 unit tests (79% statements, 65% functions, 94% branches), 47 E2E tests across 9 suites
- Build Size: 404 KB gzipped (1.68 MB uncompressed)
- Status: Production-ready, comprehensive testing complete
wallet/
├── composables/ # Vue composables for data access
│ ├── useDatabase.ts # Dexie database initialization
│ ├── useAccounts.ts # Account CRUD operations
│ ├── useBudgets.ts # Budget CRUD operations
│ ├── useLedger.ts # Ledger entry CRUD + balance calculations
│ ├── useExchangeRates.ts # Exchange rate management
│ ├── useTransactions.ts # High-level transaction API (Phase 2)
│ ├── useCurrency.ts # Currency utilities (Phase 2)
│ └── useNetworkStatus.ts # Network detection and PWA install (Phase 3)
├── components/ # Vue components
│ └── PWABanner.vue # PWA notifications and install prompt (Phase 3)
├── types/ # TypeScript type definitions
│ └── models.ts # Core data models
├── utils/ # Utility functions
│ └── validation.ts # Validation helpers
├── tests/ # Unit tests
│ ├── setup.ts # Test environment setup
│ ├── validation.test.ts
│ ├── ledger.test.ts
│ ├── accounts.test.ts
│ ├── budgets.test.ts
│ ├── transactions.test.ts # Phase 2 tests
│ ├── currency.test.ts # Phase 2 tests
│ └── balance-calculations.test.ts # Phase 2 tests
├── pages/ # Nuxt pages
│ └── index.vue # Home page with PWA status (Phase 3)
├── public/ # Static assets
│ ├── icon.svg # App icon source (Phase 3)
│ ├── icon-192x192.png # PWA icon small (Phase 3)
│ └── icon-512x512.png # PWA icon large (Phase 3)
├── docs/ # Documentation
│ ├── implementation/
│ │ ├── database-schema.md
│ │ └── plan.md
│ ├── deployment-guide.md
│ └── user-guide.md
└── app.vue # Root component with PWA banner (Phase 3)
# Development server
npm run dev
# Build for production
npm run build
# Generate static site
npm run generate
# Preview production build
npm run preview
# Run linter
npm run lint
# Fix linting issues
npm run lint:fix
# Run unit tests
npm test
# Run tests with UI
npm run test:ui
# Run tests with coverage
npm run test:coverage
# Run E2E tests (requires dev server)
npm run test:e2e
# Run E2E tests with UI
npm run test:e2e:ui
# Run E2E tests in headed mode (see browser)
npm run test:e2e:headedThe project uses Vitest for unit testing and Playwright for E2E testing:
- happy-dom for DOM simulation
- fake-indexeddb for IndexDB testing
- @vue/test-utils for Vue component testing
- Playwright for browser automation
- @axe-core/playwright for accessibility testing
- Unit Tests: 82.34% statements, 94.45% branches (65.21% functions - UI integration code not fully tested)
- Total Tests: 106 unit tests + 47 active E2E tests = 153 tests
Test Suites:
Unit Tests (106 total):
- Phase 1 (48 tests): validation, accounts, budgets, ledger
- Phase 2 (43 tests): transactions, currency, balance calculations
- Phase 4 (15 tests): sync engine, LWW conflict resolution
E2E Tests (47 active, 3 skipped):
- Phase 6: basic navigation, account/transaction management, offline functionality, accessibility, performance, budgets, reports, multi-currency
- ESLint: Configured with @nuxt/eslint for consistent code style
- TypeScript: Strict mode enabled for type safety
- Coverage Thresholds: 80% for lines, functions, branches, and statements
The project includes a GitHub Actions CI workflow (.github/workflows/ci.yml) that:
- Runs automatically on every pull request
- Can be triggered manually via GitHub Actions UI (workflow_dispatch)
- Executes linting with
npm run lint - Runs all tests with
npm test - Uses Node.js 20.x with npm caching for optimal performance
All pull requests must pass CI checks before merging.
The core data layer implements:
- Ledger Entries: Denormalized double-entry accounting with triple-truth currency system
- Accounts: Chart of accounts (asset, liability, income, expense, equity)
- Budgets: Budget categories and cost centers
- Exchange Rates: Historical exchange rate snapshots
- Recurring Rules: Templates for automatic transaction generation
- Offline-First: All data stored in IndexDB using Dexie.js
- Double-Entry Validation: Ensures all transactions balance to zero
- UUID-Based: Conflict-free ID generation for distributed systems
- Frozen Exchange Rates: Historical accuracy with immutable rates
- CRUD Operations: Complete data access layer for all entities
- Transactions must balance (sum of amounts = 0, tolerance: ±0.01)
- Accounts and budgets have immutable currencies
- Exchange rates must be positive
- Valid account types: asset, liability, income, expense, equity
The accounting engine provides high-level transaction APIs and calculations:
- Income Transactions: Record income with automatic double-entry (salary, freelance, etc.)
- Expense Transactions: Record expenses with automatic double-entry (groceries, utilities, etc.)
- Transfer Transactions: Move money between accounts
- Multi-Split Transactions: Complex transactions with multiple splits
- Multi-Currency Support: Automatic exchange rate lookup and conversion
- Point-in-Time Balance: Calculate account balance at any date
- Balance History: Get balance over a date range
- Net Worth Calculation: Sum of assets minus liabilities across all currencies
- Account Activity: Query transactions for an account
- Formatting: Locale-aware and custom currency formatting
- Parsing: Parse user input with currency symbols and thousand separators
- Conversion: Convert between currencies using exchange rates
- 34 Currencies: Support for major world currencies with symbols (including PEN)
The PWA capabilities enable offline-first operation and app installation:
- Auto-Update: Service worker updates automatically with user notification
- Offline Caching: All static assets (JS, CSS, HTML, images) cached for offline use
- Font Caching: Google Fonts cached with long-term expiration
- Background Sync: Ready for offline operation queuing
- Online/Offline Status: Real-time network state detection
- User Feedback: Visual indicators when offline
- Automatic Reconnection: Detects when network is restored
- Installable: Add to home screen on mobile and desktop
- Install Prompt: Customizable install banner
- Standalone Mode: Runs as separate app without browser UI
- App Icons: Multiple sizes (192x192, 512x512) for different devices
- PWABanner: Displays offline indicators, update notifications, and install prompts
- Network Status: Real-time online/offline detection with visual feedback
The sync engine enables optional cloud synchronization with user's own Firebase backend:
- BYOB Architecture: Bring Your Own Backend - users configure their own Firebase
- useFirebase Composable: Firebase initialization and connection management
- Configuration UI: User-friendly setup page for Firebase credentials
- Security Documentation: Complete guide for Firestore security rules
- useSync Composable: Bidirectional sync with Firestore
- Upload/Download: Efficient sync of ledger entries, accounts, budgets
- LWW Conflict Resolution: Last-Write-Wins based on
updated_attimestamps - Device Tracking: Persistent device ID for multi-device scenarios
- Auto-Sync: Automatic sync on network reconnection
- SyncStatus Component: Real-time visual indicators
- Manual Sync: On-demand sync button
- Error Handling: Clear error messages and recovery
- Last Sync Time: Human-readable timestamps
- Sync Metadata: All entities include
_device_id,_version,updated_at - Conflict Detection: Version tracking for optimistic concurrency
- Audit Trail: Track which device made changes
The user interface provides a complete, production-ready interface for all wallet features:
- AppLayout Component: Consistent navigation across all pages
- Responsive Menu: Mobile-friendly collapsible navigation
- Quick Actions: Dashboard with cards for common tasks
- Sync Status: Always-visible sync indicator
- Account List: Grouped by type (Asset, Liability, Equity, Income, Expense)
- Account CRUD: Create, edit, and delete accounts
- Balance Display: Real-time balance calculation per account
- Transaction Count: Show number of transactions per account
- Currency Lock: Currency immutable after creation
- Transaction List: Chronological view with search and filters
- Transaction Forms: Unified modal for Expense, Income, Transfer
- Smart Fields: Dynamic form fields based on transaction type
- Currency Support: 10 common currencies in selector
- Account/Budget Assignment: Dropdown selectors with validation
- Budget List: Grouped by category (Income/Expense)
- Budget CRUD: Create, edit, and delete budgets
- Spending Totals: Automatic calculation from transactions
- Transaction Count: Show usage per budget
- Net Worth: Assets - Liabilities calculation
- Income vs Expenses: All-time comparison with net
- Account Balances: List of all accounts with balances
- Budget Summary: Total spending/income per budget
- Recent Transactions: Last 10 with quick link to full list
All data access now follows Vue 3 composable patterns:
- useAccounts(): Returns reactive accounts + all account functions
- useBudgets(): Returns reactive budgets + all budget functions
- useLedger(): Returns reactive entries + all ledger functions
- useCurrency(): Returns all currency utilities
- useTransactions(): Returns transaction creation functions
The testing and optimization phase ensures production-ready quality:
- Playwright: Browser automation for E2E tests
- Test Suites: Navigation, CRUD operations, offline functionality
- CI Integration: Automated E2E tests on every PR
- Visual Regression: Screenshots on test failure
- Trace Files: Debug failed tests with Playwright traces
- Axe-core: Automated WCAG 2.1 AA compliance scanning
- Keyboard Navigation: Tab order and focus management tests
- Screen Reader: ARIA labels and semantic HTML verification
- Color Contrast: WCAG AA contrast ratio compliance
- Load Time: < 3 seconds page load target
- Bundle Size: 403 KB gzipped (1.67 MB uncompressed)
- Memory Leaks: Navigation stress testing
- Large Lists: 50+ item rendering performance
- npm audit: Critical vulnerabilities fixed
- Input Validation: XSS protection review
- Dependencies: Production dependencies clean
- BYOB Architecture: User-controlled data storage
See plan.md for:
- Phase 1: Core Data Layer (validation, accounts, budgets, ledger) ✅ COMPLETE
- Phase 2: Accounting Engine (transactions, currency, balance calculations) ✅ COMPLETE
- Phase 3: PWA Foundation (service worker, offline capabilities) ✅ COMPLETE
- Phase 4: Sync Implementation (Firestore BYOB, LWW conflict resolution) ✅ COMPLETE
- Phase 5: User Interface (transaction forms, reports, dashboards) ✅ COMPLETE
- Phase 6: Testing & Optimization (E2E tests, performance, accessibility) ✅ NEARLY COMPLETE
- ✅ E2E test infrastructure (Playwright)
- ✅ 47 active E2E tests across 9 test suites (3 skipped)
- ✅ Accessibility testing (WCAG 2.1 AA)
- ✅ Performance benchmarking
- ✅ CI/CD integration
- ✅ User and deployment documentation
- ⏳ Optional: Advanced performance optimizations (lazy loading, virtual scrolling)
Test Suites:
- Basic navigation (3 tests)
- Account management (4 tests)
- Transaction creation (4 tests)
- Offline functionality (1 test, 2 skipped)
- Accessibility (6 tests, 1 skipped)
- Performance (5 tests)
- Budget management (6 tests)
- Reports page (9 tests)
- Multi-currency (8 tests)
- Database Schema: Complete data models and schemas
- Implementation Plan: Phased development roadmap
- User Guide: End-user documentation
- Deployment Guide: Hosting and deployment instructions
- GitHub Copilot Instructions: Development guidelines
Please follow the existing code style and ensure all tests pass before submitting changes.
- Run linter:
npm run lint - Run tests:
npm test - Check coverage:
npm run test:coverage - Build project:
npm run build