See your money's real future — inflation-adjusted portfolio projection
Compound growth & DCA simulation · Real vs. nominal value · AI financial assistant
Most financial calculators show you nominal numbers — big future balances that quietly lose their purchasing power to inflation. MoneyTrace computes the numbers in today's money, so you see not only how much you'll have, but what it will actually buy.
It's an open-source, privacy-first investment projection engine:
- All calculations run in your browser — no servers, no accounts, no tracking, no database. Your data never leaves your device.
- Deterministic finance engine — pure, testable math orchestrated in
src/engine/; the UI only renders results. - AI that understands your portfolio — an optional chat assistant and forecast tool that reads your actual projection context and answers real questions (e.g. "What happens if I increase my DCA by 5% annually?").
| 📈 Real vs. Nominal value | Track both the raw balance and its inflation-adjusted purchasing power — two curves, one honest picture. |
| 💰 Compound growth & DCA engine | Simulate up to 50 years: initial capital, monthly DCA, annual contribution increase, withdrawals, withholding tax, inflation. |
| 💱 Multi-currency | USD, EUR, GBP, JPY, TRY, BRL, INR and more, with automatic locale-aware number formatting. |
| 📊 Reference currency tracking | Benchmark local-currency portfolios against USD (or any reference) with projected FX growth. |
| 🤖 AI Financial Assistant | Floating chat widget that analyzes your active projection — returns, horizons, DCA variants — client-side context, full privacy. |
| ⚡ AI Economic Forecasting | One click to estimate inflation, returns, and exchange rates, and auto-fill your portfolio inputs. |
| 🔑 Bring your own key | Gemini, OpenAI, or any OpenAI-compatible API (OpenRouter, Groq, Ollama, LM Studio…). A hosted Demo API mode lets visitors try the AI for free, with server-enforced quotas. |
| 🎯 Scenario management | Create, clone, edit, compare, and pin baseline scenarios — pre-seeded with Optimistic, Market Growth, Conservative, and Custom. |
| 📊 Interactive charts | Portfolio growth (nominal vs. real vs. invested), reference-currency valuation, and inflation impact visualizations. |
| 📁 Export & import | CSV export of year- and month-level tables; JSON backup/restore of all scenarios. |
| 🌐 i18n | English and Turkish, switch seamlessly. |
| 🔒 Privacy-first | Zero tracking, zero accounts; Zustand persist keeps everything in localStorage. |
How: Start with the default scenario, ~10 years, and capture the main view (portfolio form + summary cards + table).
How: Scroll to the chart section — growth vs. real balance vs. invested capital, reference currency line, and inflation impact card.
How: Create 2–3 scenarios (e.g. Market Growth vs. Conservative), open Compare and capture the side-by-side table.
How: Open the AI Forecast modal, run a forecast, and capture the filled-in parameters.
How: Open the chat FAB (bottom-right), ask one of the question, and capture the conversation.
How: Open the Settings dialog and capture the AI configuration (provider, key, model, base URL, Demo API toggle).
| Category | Choice |
|---|---|
| Frontend | React 19 · TypeScript · Vite 8 |
| Styling | Tailwind CSS v4 (@tailwindcss/vite) · @base-ui/react · CVA + cn() |
| State | Zustand + persist (localStorage) |
| Charts | Recharts |
| i18n | i18next · react-i18next |
| AI (client) | src/lib/ai-service.ts · ai-chat-service.ts — Gemini / OpenAI / OpenAI-compatible |
| Backend (optional) | Vercel Edge Function api/demo.ts + Upstash Redis quota counters |
git clone https://github.com/Metee01/MoneyTrace.git
cd MoneyTrace
npm install
npm run dev # → http://localhost:5173Useful scripts:
| Script | Purpose |
|---|---|
npm run dev |
Start the Vite dev server |
npm run build |
Typecheck (tsc -b) + production build |
npm run lint · npm run format |
ESLint · Prettier |
npm test |
Deterministic engine + store + AI tools tests (via tsx) |
🔑 Environment variables & demo proxy (for deploying your own instance)
| Variable | Where | Purpose |
|---|---|---|
VITE_DEMO_PROXY_URL |
.env / Vercel |
Enables the hosted Demo API option; points at /api/demo |
DEMO_API_KEY |
Vercel only | Shared demo key — lives in the edge function, never ships in the bundle |
The proxy in api/demo.ts enforces per-user quotas (5 forecasts / 15 chat messages), per-IP daily caps, a 3s chat cooldown, and optional persistent counters via Upstash Redis — see api/demo.ts for details.
┌──────────────────────────────┐ ┌──────────────────────────────┐
│ Browser │ │ Vercel (optional) │
│ PortfolioForm → engine/ │ AI │ /api/demo (Edge Function) │
│ (pure, deterministic) │ ───▶ │ • owns DEMO_API_KEY │
│ Zustand persist (local) │ │ • quota + rate limiting │
│ AI service / chat (BYOK) │ │ • Upstash Redis (optional) │
└──────────────────────────────┘ └──────────────────────────────┘
▲ all financial math
│ stays on device
src/engine/— pure, framework-free financial math (compound growth, inflation adjustment, currency conversion), orchestrated bycalculateProjection; deterministic, rounded to 2 decimals.src/config/index.ts— single source of truth (APP_CONFIG): app metadata, AI models, demo quotas, engine limits.- UI components never compute financials themselves — they only consume the engine.
src/
├── components/ UI — portfolio form, projection cards/table/charts,
│ scenarios, chat widget, layout
├── config/ APP_CONFIG — single source of truth (app, AI, engine)
├── engine/ Pure financial math (compound-growth, inflation-adjust, …)
├── lib/ AI services, demo-proxy client, formatters, export, i18n
├── store/ Zustand stores with persist (portfolio, settings)
├── locales/ en / tr translation dictionaries
└── types/ Shared TypeScript types
api/demo.ts Vercel serverless Demo API proxy
Found a bug or have an idea? Open an issue or PR — CONTRIBUTING.md has the details.
Released under the MIT License. Made for people who want to know the real price of their future 💸





