Skip to content

supat-roong/invest-track

Repository files navigation

πŸš€ InvestTrack: All-in-One Investment Tracker

Stop tracking your wealth in ten different places. See the Big Picture with InvestTrack.

invest-track-demo.mp4

πŸ“– The Story

Most investors face the same problem: Fragmentation.

One app for stocks, another for global funds, and a separate exchange for crypto. You have plenty of investments, but you don't have a Big Picture. Calculating your total net worth or realized PnL across all platforms is a manual nightmare.

InvestTrack was built to solve this. It's a personal investment analytics platform that consolidates data from multiple sources into a single, unified dashboard. It doesn't just show you what you have now; it tracks where you've been and helps you understand your investment journey.

Why InvestTrack?

  • Unified Vision: See your Stocks, Mutual Funds, Crypto, and Gold in one place.
  • Historical Analysis: Daily valuation and PnL tracking for a long-term perspective.
  • Tax-Ready: All trades are normalized and stored in a local database, simplifying your end-of-year reporting.
  • Privacy First: Your data stays on your machine in a local SQLite database.

✨ Features

  • Automated Statement Parsing β€” Drag and drop your broker PDF statements.
  • Direct API Integration β€” Seamlessly sync with exchange APIs to get live balances and trade history.
  • Multi-Currency Support β€” Track your portfolio in multiple base currencies (THB/USD) with automatic historical exchange rates.
  • Modern Dashboard β€” A beautiful, interactive Next.js dashboard for deep-dive analytics.
  • Smart Updates β€” Incremental processing keeps updates fast by only parsing new data.
  • Market Price Sync β€” Automatic fetching of daily prices via reliable financial APIs.

🏦 Supported Platforms

While InvestTrack is built to be extensible, it currently features deep support for major platforms in Thailand:

  • KBank Broker β€” Automated K-consolidated statement PDF parsing.
  • Dime! Broker β€” Monthly PDF report integration.
  • Binance TH β€” Real-time API sync for crypto balances and trades.
  • Generic CSV β€” Manual import for any other asset type.

πŸ› οΈ Tech Stack

  • Backend: Python 3.12 + uv
  • Database: SQLite (via sqlmodel)
  • Frontend: Next.js + Tailwind CSS + Recharts
  • Data Sources: yfinance (Stocks/Crypto/Gold), Thai SEC API (Mutual Funds)
  • Parsing: pypdf for automated broker statement extraction

πŸš€ Quick Start

1. Prerequisites

2. Setup

# Clone the repository
git clone https://github.com/supat-roong/invest-track.git
cd invest-track

# Install Python dependencies
uv sync

# Install Dashboard dependencies
cd dashboard && npm install && cd ..

# Configure Environment
cp .env.example .env
# Edit .env and add your PDF password and API keys

πŸ“‚ Data Structure

Place your raw data files in these directories for automatic parsing:

  • data/raw/kbank_pdf/ β€” KBank Broker Consolidated Statements
  • data/raw/dime_pdf/ β€” Dime! Monthly Statements
  • data/raw/binance_raw/ β€” Binance TH export files
  • data/raw/manual/ β€” manual_trades.csv for other assets

3. Usage

Update Portfolio Data Parses PDF statements and syncs APIs.

uv run main.py portfolio-update

Launch the Dashboard Starts the Next.js app.

uv run main.py dashboard
# Access at http://localhost:3000

πŸ€– Automation

InvestTrack can be scheduled to update your portfolio and market prices automatically every day.

Setup Daily Updates

We provide a script to automatically setup a cron job that runs at 1:00 AM daily. It will parse any new statements and then fetch the latest market prices.

# Setup the cron job
./scripts/setup_cron.sh

Disable Updates

If you want to stop the automated updates:

./scripts/disable_cron.sh

Checking Logs

You can monitor the output of the automated tasks by checking the cron.log file in the project root:

tail -f cron.log

🀝 Contributing & Open for Support

InvestTrack is an open project, and we welcome contributions from the community!

  • New Brokers: If you use a broker that isn't supported yet (e.g., SCB, InnovestX, or international brokers), feel free to contribute a new PDF parser or CSV template.
  • Bug Reports: Open an issue if you encounter any problems with parsing or valuation.
  • Feature Ideas: Suggestions for new dashboard visualizations or analytics are always welcome.

Check out the Contributing guidelines (coming soon) or just jump into the code!


πŸ“œ License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.

Contributors