Skip to content

Latest commit

Β 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MoneyTrace

MoneyTrace

See your money's real future β€” inflation-adjusted portfolio projection

Compound growth & DCA simulation Β· Real vs. nominal value Β· AI financial assistant

🌐 Live Demo · GitHub

React TypeScript Vite Tailwind v4 Zustand Vercel License


MoneyTrace dashboard β€” portfolio parameters, summary cards, and year-by-year projection table


Why MoneyTrace?

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:

  • Core calculations run in your browser β€” no account or application database is required, and portfolio data stays in local storage. Optional AI requests send relevant context to the provider or demo proxy you select.
  • 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?").

Features

πŸ“ˆ 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 increases, withdrawals, optional estimated gain tax, and 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 β€” and sends its context only when you use the selected AI provider.
⚑ 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 No advertising trackers or analytics cookies; Vercel Web Analytics provides cookie-free aggregate usage metrics. Zustand persist keeps portfolio data in localStorage.

Screenshots

1. Dashboard

Dashboard: portfolio form and projection table

How: Start with the default scenario, ~10 years, and capture the main view (portfolio form + summary cards + table).

2. Charts

Charts: nominal vs real growth, reference currency, inflation impact

How: Scroll to the chart section β€” growth vs. real balance vs. invested capital, reference currency line, and inflation impact card.

3. Scenario comparison

Scenario comparison dialog

How: Create 2–3 scenarios (e.g. Market Growth vs. Conservative), open Compare and capture the side-by-side table.

4. AI Forecast modal

AI economic forecast modal

How: Open the AI Forecast modal, run a forecast, and capture the filled-in parameters.

5. AI Chat

AI financial assistant chat

How: Open the chat FAB (bottom-right), ask one of the question, and capture the conversation.

6. Settings

Settings dialog: AI provider configuration

How: Open the Settings dialog and capture the AI configuration (provider, key, model, base URL, Demo API toggle).

Tech Stack

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

SEO & Localized Routes

  • Turkish is served from /; English is served from /en. Information and legal pages have matching locale-specific URLs and reciprocal hreflang links.
  • npm run build prerenders all public routes, generates route-specific metadata and JSON-LD, creates sitemap.xml, robots.txt, and 404.html, then verifies the SEO output.
  • The canonical production origin is https://moneytrace.metee.com.tr, configured in APP_CONFIG.app.siteUrl.
  • Social previews use the localized 1200Γ—630 images in public/og-image-{tr,en}.png.

Getting Started

git clone https://github.com/Metee01/MoneyTrace.git
cd MoneyTrace
npm install
npm run dev      # β†’ http://localhost:5173

Useful scripts:

Script Purpose
npm run dev Start the Vite dev server
npm run build Typecheck, production build, static route generation, and SEO verification
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.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           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 by calculateProjection; 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.

Project Structure

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
β”œβ”€β”€ seo/              canonical routes, metadata, and browser head sync
└── types/            Shared TypeScript types
api/demo.ts           Vercel serverless Demo API proxy
scripts/              Static-page generation and SEO verification

Contributing & License

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 πŸ’Έ

About

A personal finance management application built with React, TypeScript, and Tailwind CSS.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages