## What & why A queued historical-balance generator job exhausted the worker's 128MB PHP memory limit and **died on every retry** — Sentry `PHP-LARAVEL-49` + `PHP-LARAVEL-4A` (two fingerprints of the *same* poison message: identical `trace_id`/`message.id`, `retry.count` 1 then 2, OOM at slightly different `Arr.php` lines). ### Root cause (trace-confirmed) The Sentry trace localized the OOMing message to `App\Jobs\GenerateHistoricalRealEstateBalancesJob`, dispatched from `Settings\AccountController::store` for the "older than 12 months" slice of history. The fatal frame is `Arr::map` inside Eloquent's `AccountBalance::upsert()` value-prep (`addUniqueIds`/`addTimestamps` per-row `array_merge`, `Query\Builder::upsert` `Arr::flatten` bindings, and a compiled multi-row SQL string — all **O(n)** over the rows). `purchase_date` (`before_or_equal:today`) and `loan_start_date` (no constraint) had **no lower bound**, so a mistyped/ancient year (e.g. `0201`, `1080`) made the generator build a **multi-century monthly series** and hand it all to a single `upsert`, blowing past 128MB. ## The fix (two commits) 1. **`fix(balances): upsert historical balances in batches`** — build + upsert in batches of 500 (`UPSERT_CHUNK_SIZE`) in both `RealEstateBalanceGeneratorService` and `LoanBalanceGeneratorService`, instead of one giant operation. Same rows, same `(account_id, balance_date)` conflict target — peak memory is now bounded regardless of series length. Defense-in-depth. 2. **`fix(accounts): floor purchase/loan start dates at 1900`** — the actual root cause: add `after_or_equal:1900-01-01` to `purchase_date` and `loan_start_date`. Rejects the data-entry typos that drive the runaway series (and the resulting DB bloat / misleading multi-century net-worth ramp) while accepting any legitimately old asset in a personal-finance app. ## Review (two agents, before this PR) Both reviewed against the live trace and the code. - **Root cause & fix confirmed** — the batching caps exactly the `Arr::map`-over-N-rows frame from the trace; no independent OOM source exists (no per-row model events; `upsert` bypasses events). - **Chunking is correct** — the unique index `(account_id, balance_date)` exists, so the conflict target is real; `buildDateList` yields a strictly-increasing de-duplicated list, so batches are disjoint (no dropped/duplicated dates, no off-by-one). The fresh per-row `id` UUID is discarded on conflict → idempotent retries. - **No material user-facing regression.** Balance consumption (dashboard/net-worth) is date-range-clamped. Batching introduces a theoretical partial-write-on-mid-job-failure window, but it's idempotent and self-heals on retry — agents advised **against** wrapping it in a transaction (holds locks, doesn't help memory). Applied recommendation #2 (the date floor) as its own commit. Deferred (both agents agree): extracting the two near-identical generators into a shared base/trait — a larger refactor that shouldn't ride a hotfix. ## Tests - Regression test in each service: generate a ~46-year (>500-point) series and assert the batched writes produce no dropped/duplicated dates and keep endpoints anchored (crosses multiple batches). - Validation test: a pre-1900 `purchase_date` is rejected at `accounts.store`. Note: the PHP feature suite boots a MySQL testcontainer (Docker) that isn't available in my environment, so these were validated by static/`pint`/`php -l` locally and rely on CI for execution — auto-merge is gated on green CI. Fixes PHP-LARAVEL-49 Fixes PHP-LARAVEL-4A |
||
|---|---|---|
| .agents/skills | ||
| .claude | ||
| .cursor | ||
| .github | ||
| .opencode/skills | ||
| .pi | ||
| app | ||
| bootstrap | ||
| config | ||
| database | ||
| docker | ||
| docs | ||
| experiments | ||
| lang | ||
| public | ||
| resources | ||
| routes | ||
| screenshots | ||
| scripts | ||
| src/lib/crypto | ||
| storage | ||
| templates/coolify | ||
| tests | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .env.production.example | ||
| .gitattributes | ||
| .gitignore | ||
| .mcp.json | ||
| .php-cs-fixer.dist.php | ||
| .php-version | ||
| .prettierignore | ||
| .prettierrc | ||
| .release-it.json | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| Dockerfile | ||
| Dockerfile.production | ||
| LICENSE.md | ||
| LOCALIZATION.md | ||
| ONBOARDING.md | ||
| README.md | ||
| artisan | ||
| autoresearch-dashboard.md | ||
| autoresearch.jsonl | ||
| autoresearch.md | ||
| autoresearch.sh | ||
| boost.json | ||
| bun.lock | ||
| components.json | ||
| compose.yaml | ||
| composer.json | ||
| composer.lock | ||
| docker-compose.production.yml | ||
| eslint.config.js | ||
| falcode.json | ||
| opencode.json | ||
| package-lock.json | ||
| package.json | ||
| phpstan-baseline.neon | ||
| phpstan.neon | ||
| phpunit.xml | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.config.ts | ||
| vitest.setup.ts | ||
| whispermoney | ||
| worktree.sh | ||
README.md
Deutsch | Español | français | 日本語 | 한국어 | Português | Русский | 中文
Whisper Money
The most secure way to understand your finances.
Whisper Money is a privacy-first personal finance application that helps you track, categorize, and understand your spending—all while keeping your financial data encrypted and secure.
🎮 Try the Demo: Experience Whisper Money with our demo account - no registration required!
💬 Join our Community: Whether you're a user looking for help or a developer wanting to contribute, we'd love to have you in our Discord server! Share feedback, ask questions, discuss new features, or just hang out with fellow privacy enthusiasts.
Features
- 🔐 Privacy-first — Your data is never shared with third parties. You own it
- 🏦 Bank account management — Track multiple accounts in one place
- 📊 Transaction categorization — Automatic and manual categorization
- 🤖 Automation rules — Set up rules to auto-categorize transactions
- 📈 Financial insights — Understand your spending patterns
Tech Stack
- Backend: Laravel 12, PHP 8.4
- Frontend: React 19, Inertia.js v2, TypeScript
- Styling: Tailwind CSS v4
- Database: MySQL
- Cache/Queue: Redis
- Testing: Pest v4
Running Locally
Quick Start (Recommended)
The easiest way to get started is using our automated setup script:
bash <(curl -fsSL https://whisper.money/setup.sh)
After installation, just visit https://whisper.money.localhost in your browser.
Manual Setup
If you prefer to set up manually:
- Clone the repository:
git clone https://github.com/whisper-money/whisper-money.git
cd whisper-money
- Run the setup script:
whispermoney install
Available Commands
Important: You must run
whispermoney installbefore using any other command. If you skip the install step, commands likestartwill not work.
Once installed, you can use the whispermoney command for common tasks:
# Start all services
whispermoney start
# Stop all services
whispermoney stop
# Upgrade to latest version
whispermoney upgrade
# Interactive menu
whispermoney
Development Server
For active development with hot reloading:
composer run dev
This will concurrently start:
- PHP development server (via Portless HTTPS proxy)
- Queue worker
- Log viewer (Pail)
- Vite dev server
The application will be available at https://dev.whisper.money.localhost. In git worktrees, the branch name is automatically prepended (e.g. https://fix-ui.dev.whisper.money.localhost).
Running with Docker (Production Image)
For testing the production Docker image locally:
- Copy the production environment file:
cp .env.production.example .env
- Start the services:
docker compose -f docker-compose.production.yml up -d
The application will be available at http://localhost:8080.
To use a different port, set APP_PORT:
APP_PORT=3000 docker compose -f docker-compose.production.yml up -d
Deploying to Coolify
Whisper Money can be easily deployed to Coolify using our Docker Compose template.
Quick Deploy
- In Coolify, create a new resource and select Docker Compose
- Choose Empty Compose File as the source
- Paste the contents from our template: 👉 whisper-money.yaml
- Deploy!
The template includes:
- Whisper Money application container
- MySQL 8.0 database with health checks
- Persistent volumes for data and storage
- Auto-generated database credentials
Required Environment Variables
| Variable | Description |
|---|---|
RESEND_API_KEY |
Email service API key (for password resets, notifications) |
Note:
APP_KEYandAPP_URLare auto-configured. The container generates anAPP_KEYon first startup if not provided.
Optional Environment Variables
| Variable | Default | Description |
|---|---|---|
DRIP_EMAILS_ENABLED |
true |
Enable drip emails (welcome, onboarding, feedback) |
HIDE_AUTH_BUTTONS |
false |
Hide login/register buttons on landing page |
SUBSCRIPTIONS_ENABLED |
false |
Enable Stripe subscriptions |
STRIPE_KEY |
- | Stripe publishable key |
STRIPE_SECRET |
- | Stripe secret key |
STRIPE_WEBHOOK_SECRET |
- | Stripe webhook signing secret |
Star History
License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.