Skip to content

afadil/wealthfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo

Wealthfolio

A Beautiful and Boring Desktop Investment Tracker

Website Β· Discord Β· Twitter Β· Releases

Buy me a coffee button

Introduction

Wealthfolio App is a Beautiful and Boring Investment Tracker, with Local Data Storage. No Subscriptions, No Cloud.

Visit the app website at Wealthfolio App.

Screenshot

✨ Key Features

  • πŸ“Š Portfolio Tracking - Track your investments across multiple accounts and asset types
  • πŸ“ˆ Performance Analytics - Detailed performance metrics and historical analysis
  • πŸ’° Activity Management - Import and manage all your trading activities
  • 🎯 Goal Planning - Set and track financial goals with allocation management
  • πŸ”’ Local Data - All data stored locally with no cloud dependencies
  • 🧩 Extensible - Powerful addon system for custom functionality
  • 🌍 Multi-Currency - Support for multiple currencies with exchange rate management
  • πŸ“± Cross-Platform - Available on Windows, macOS, and Linux

🧩 Addon System

Wealthfolio features a powerful addon system that allows developers to extend functionality:

  • πŸ”Œ Easy Development - TypeScript SDK with full type safety and hot reload
  • πŸ”’ Secure - Comprehensive permission system with user consent
  • ⚑ High Performance - Optimized for speed with minimal overhead
  • 🎨 UI Integration - Add custom pages, navigation items, and components
  • πŸ“‘ Real-time Events - Listen to portfolio updates, market sync, and user actions
  • πŸ—„οΈ Full Data Access - Access to accounts, holdings, activities, and market data
  • πŸ” Secrets Management - Secure storage for API keys and sensitive data

Get started building addons: See the Addon Documentation Hub

Documentation for all Activity types, including the required form fields, is available in docs/activities/activity-types.md.

Roadmap

See ROADMAP.md.

πŸ“– Documentation

Core Application

  • Activity Types - Complete guide to all supported activity types and their required fields
  • Roadmap - Future plans and development roadmap

Addon Development

Quick Links

Getting Started

Prerequisites

Ensure you have the following installed on your machine:

Building from Source

  1. Clone the repository:

    git clone https://github.com/afadil/wealthfolio.git
    cd wealthfolio
  2. Install dependencies using pnpm:

    pnpm install
  3. Setup environment configuration:

    Copy the environment template and configure it for your setup:

    cp .env.example .env

    Update the .env file with your database path and other configuration as needed:

    # Database location
    DATABASE_URL=../db/wealthfolio.db
  4. Run in Development Mode:

Build and run the desktop application using Tauri:

pnpm tauri dev

Addon Development Mode

Addon hot reload servers now start only when you explicitly opt in.

For desktop development with Tauri:

VITE_ENABLE_ADDON_DEV_MODE=true pnpm tauri dev

For browser-only development (Vite only, no Tauri):

pnpm dev:addons

You can also set VITE_ENABLE_ADDON_DEV_MODE=true in your .env file to persist the setting.

  1. Build for Production:

Build the application for production:

pnpm tauri build

Web Mode (Browser + REST API server)

Run the web UI with a local Axum server with one command.

Quick Start

  1. Setup environment (optional but recommended):

    Copy the example environment file and customize it for your setup:

    cp .env.web.example .env.web

    Edit .env.web to configure database path, ports, and other settings as needed.

  2. Start both backend and Vite dev server:

    pnpm run dev:web

    The Vite dev server runs at http://localhost:1420 and proxies API calls to the Axum backend server.

Configuration

All configuration is done via environment variables in .env.web.

Server Configuration (WF_* variables):

  • WF_LISTEN_ADDR - Server bind address (default: 0.0.0.0:8080)
  • WF_DB_PATH - SQLite database path or directory (default: ./db/app.db)
    • If a directory is provided, app.db will be used inside it
  • WF_CORS_ALLOW_ORIGINS - Comma-separated list of allowed CORS origins (default: *)
    • Example: http://localhost:1420,http://localhost:3000
  • WF_REQUEST_TIMEOUT_MS - Request timeout in milliseconds (default: 30000)
  • WF_STATIC_DIR - Directory for serving static frontend assets (default: dist)
  • WF_SECRET_KEY - Required 32-byte key used for secrets encryption and JWT signing
  • WF_AUTH_PASSWORD_HASH - Argon2id PHC string enabling password-only authentication for web mode
  • WF_AUTH_TOKEN_TTL_MINUTES - Optional JWT access token expiry in minutes (default 60)
    • Generate with: openssl rand -base64 32
  • WF_SECRET_FILE - Optional path to secrets storage file (default: <data-root>/secrets.json)
  • WF_ADDONS_DIR - Optional path to addons directory (default: derived from database path)

Vite Configuration:

  • VITE_API_TARGET - Backend API URL for Vite proxy (default: http://127.0.0.1:8080)

Authentication (Web Mode)

  • Set WF_AUTH_PASSWORD_HASH to an Argon2id PHC string to require a password before accessing the Web App.

    You can generate the hash with online tools like argon2.online or the following command:

    argon2 "your-password" -id -e

    Copy the full output (starting with $argon2id$...) into .env.web.

  • Tokens are short-lived (default 60 minutes) and stored in memory on the client; refresh the page to re-authenticate.

Notes

  • The server logs the effective database path on startup
  • Environment variables from .env.web are loaded automatically by the dev:web script
  • Stop with Ctrl+C to shut down both processes gracefully

Server Only

Run just the HTTP server without the Vite dev server (from repo root):

cargo run --manifest-path src-server/Cargo.toml

The server accepts the same WF_* environment variables as documented in the Web Mode Configuration section above. You can set them inline or via .env.web:

WF_LISTEN_ADDR=127.0.0.1:8080 WF_DB_PATH=./db/app.db cargo run --manifest-path src-server/Cargo.toml

See Web Mode Configuration for a complete list of supported environment variables.

Docker

You can either pull the official Docker image or build it yourself locally.

Using the Pre-built Image

The latest server build is published to Docker Hub.

docker pull afadil/wealthfolio:latest

After pulling, use afadil/wealthfolio:latest in the run commands below. If you build the image locally, swap the image name back to wealthfolio.

Building the Image

Build the Docker image directly from source (no pre-build required):

docker build -t wealthfolio .

The build process:

  1. Builds frontend assets from source (pnpm install + pnpm vite build)
  2. Compiles Rust backend from source (cargo build --release)
  3. Creates minimal Alpine-based image with only the runtime artifacts

The final image includes:

  • Compiled frontend assets in /app/dist
  • wealthfolio-server binary at /usr/local/bin/wealthfolio-server
  • Alpine Linux base (small footprint)

Configuration

You can configure the container using either:

  1. Environment variables (inline with -e flag)
  2. Environment file (using --env-file flag)

Option 1: Create an environment file (recommended for production):

# Create a Docker-specific environment file
cat > .env.docker << 'EOF'
WF_LISTEN_ADDR=0.0.0.0:8088
WF_DB_PATH=/data/wealthfolio.db
WF_SECRET_KEY=<generate-with-openssl-rand>
WF_CORS_ALLOW_ORIGINS=*
WF_REQUEST_TIMEOUT_MS=30000
WF_STATIC_DIR=dist
EOF

Generate and add your secret key:

echo "WF_SECRET_KEY=$(openssl rand -base64 32)" >> .env.docker

Option 2: Use inline environment variables (simpler for testing):

See examples below for inline configuration.

Running the Container

All examples below use the published image (afadil/wealthfolio:latest). If you built locally, substitute your local tag (e.g., wealthfolio).

Using environment file (recommended):

docker run --rm -d \
  --name wealthfolio \
  --env-file .env.docker \
  -p 8088:8088 \
  -v "$(pwd)/wealthfolio-data:/data" \
  afadil/wealthfolio:latest

Basic usage (inline environment variables):

docker run --rm -d \
  --name wealthfolio \
  -e WF_LISTEN_ADDR=0.0.0.0:8088 \
  -e WF_DB_PATH=/data/wealthfolio.db \
  -p 8088:8088 \
  -v "$(pwd)/wealthfolio-data:/data" \
  afadil/wealthfolio:latest

Development mode (with CORS for local Vite dev server):

docker run --rm -it \
  --name wealthfolio \
  -e WF_LISTEN_ADDR=0.0.0.0:8088 \
  -e WF_DB_PATH=/data/wealthfolio.db \
  -e WF_CORS_ALLOW_ORIGINS=http://localhost:1420 \
  -p 8088:8088 \
  -v "$(pwd)/wealthfolio-data:/data" \
  afadil/wealthfolio:latest

Production with encryption (recommended):

docker run --rm -d \
  --name wealthfolio \
  -e WF_LISTEN_ADDR=0.0.0.0:8088 \
  -e WF_DB_PATH=/data/wealthfolio.db \
  -e WF_SECRET_KEY=$(openssl rand -base64 32) \
  -p 8088:8088 \
  -v "$(pwd)/wealthfolio-data:/data" \
  afadil/wealthfolio:latest

Environment Variables

The container supports all WF_* environment variables documented in the Web Mode Configuration section. Key variables:

  • WF_LISTEN_ADDR - Bind address (must use 0.0.0.0:PORT for Docker, not 127.0.0.1)
  • WF_DB_PATH - Database path (typically /data/wealthfolio.db)
  • WF_CORS_ALLOW_ORIGINS - CORS origins (set for dev/frontend access)
  • WF_SECRET_KEY - Required 32-byte key used for secrets encryption and JWT signing

Volumes

  • /data - Persistent storage for database and secrets
    • Database: /data/wealthfolio.db
    • Secrets: /data/secrets.json (encrypted with WF_SECRET_KEY)

Ports

  • 8088 - HTTP server (serves both API and static frontend)

Access the application at http://localhost:8088 after starting the container.

Important: The server must bind to 0.0.0.0 (all interfaces) inside the container to be accessible from your host machine. Binding to 127.0.0.1 will make the app only accessible from within the container.

Development with DevContainer

For a consistent development environment across all platforms, you can use the provided DevContainer configuration. This method requires fewer manual setup steps and provides an isolated environment with all necessary dependencies.

Prerequisites

Features

  • Pre-configured Tauri development environment
  • X11 virtual display with VNC access (port 5900)
  • Complete Rust development setup
  • GPU support (via Docker's --gpus=all flag)
  • Persistent data and build caches
  • Essential VS Code extensions pre-installed

Starting Development with DevContainer

  1. Clone the repository (if you haven't already):

    git clone https://github.com/afadil/wealthfolio.git
    cd wealthfolio
  2. Open in VS Code:

    • Open VS Code
    • Go to File > Open Folder
    • Select the wealthfolio directory
  3. Launch DevContainer:

    • Press F1 or Ctrl+Shift+P
    • Type "Remote-Containers: Reopen in Container"
    • Press Enter
  4. Wait for container build:

    • VS Code will build and configure the development container
    • This may take a few minutes on first run
  5. Start Development:

    • Once the container is ready, you can start development
    • All necessary tools and dependencies will be available

Addon Development

Wealthfolio supports a powerful addon ecosystem that allows developers to extend functionality with custom features.

Quick Start with Addons

  1. Create a new addon:

    npx @wealthfolio/addon-dev-tools create my-addon
    cd my-addon
    npm install
  2. Start development server:

    npm run dev:server
  3. Start Wealthfolio in addon development mode (in another terminal):

    VITE_ENABLE_ADDON_DEV_MODE=true pnpm tauri dev

Your addon will be automatically discovered and loaded with hot reload support!

Addon Features

  • 🎨 UI Integration: Add custom pages and navigation items
  • πŸ“Š Data Access: Full access to portfolio, accounts, and market data
  • πŸ“‘ Real-time Events: React to portfolio updates and user actions
  • πŸ” Secure Storage: Store API keys and sensitive data securely
  • ⚑ Hot Reload: Seamless development experience
  • πŸ”’ Permission System: Transparent security with user consent

Example Addons

Check out the addons/ directory for sample addons including:

  • Goal Progress Tracker: Visual goal tracking with calendar like interface
  • Investment Fees Tracker: Track and analyze investment fees

Resources

Technologies Used

Frontend

  • React: JavaScript library for building user interfaces.
  • React Router: Declarative routing for React.
  • Tailwind CSS: Utility-first CSS framework for styling.
  • Radix UI/Shadcn: Accessible UI components.
  • Recharts: Charting library built with React.
  • React Query: Data-fetching library for React.
  • Zod: TypeScript-first schema declaration and validation library.

Backend

  • Tauri: Framework for building tiny, secure, and fast desktop applications.
  • Rust: Systems programming language for core backend functionality.
  • SQLite: Embedded database for local data storage.
  • Diesel: Safe, extensible ORM and query builder for Rust.

Addon System

  • @wealthfolio/addon-sdk: TypeScript SDK for addon development with full type safety.
  • @wealthfolio/addon-dev-tools: CLI tools and development server for hot reload.
  • @wealthfolio/ui: Shared UI component library for consistent styling.

Development Tools

  • Vite: Next-generation frontend tooling.
  • TypeScript: Typed superset of JavaScript.
  • ESLint: Pluggable linting utility for JavaScript and JSX.
  • Prettier: Code formatter.
  • pnpm: Fast, disk space efficient package manager.
  • Turborepo: High-performance build system for JavaScript and TypeScript codebases.

Folder Structure

wealthfolio/
β”œβ”€β”€ src/                         # Main source code for the React application
β”‚   β”œβ”€β”€ addons/                  # Addon system core functionality
β”‚   β”œβ”€β”€ components/              # React components
β”‚   β”œβ”€β”€ pages/                   # Application pages and routes
β”‚   β”œβ”€β”€ hooks/                   # Custom React hooks
β”‚   └── lib/                     # Utility libraries and helpers
β”œβ”€β”€ src-core/                    # Core backend functionality (Rust)
β”œβ”€β”€ src-tauri/                   # Tauri-specific code for desktop app functionality
β”œβ”€β”€ addons/                      # Example and sample addons
β”‚   └── goal-progress-tracker/   # Goal Progress tracker addon example
β”œβ”€β”€ packages/                    # Shared packages and tools
β”‚   β”œβ”€β”€ addon-sdk/               # Addon SDK for developers
β”‚   β”œβ”€β”€ addon-dev-tools/         # Development tools and CLI
β”‚   └── ui/                      # Shared UI components library
β”œβ”€β”€ docs/                        # Documentation
β”‚   β”œβ”€β”€ addons/                  # Addon development documentation
β”‚   └── activities/              # Activity types documentation
β”œβ”€β”€ public/                      # Public assets
β”œβ”€β”€ db/                          # Database files and migrations
β”œβ”€β”€ LICENSE                      # License file
β”œβ”€β”€ README.md                    # Project documentation
β”œβ”€β”€ ROADMAP.md                   # Future plans and roadmap
β”‚
β”œβ”€β”€ packages/ui/components.json  # Shadcn UI generator config (monorepo)
β”œβ”€β”€ package.json                 # Node.js dependencies and scripts
β”œβ”€β”€ pnpm-lock.yaml               # Lock file for pnpm
β”œβ”€β”€ postcss.config.js            # PostCSS configuration
β”œβ”€β”€ tailwind.config.js           # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json                # TypeScript configuration
└── vite.config.ts               # Vite build tool configuration

Security & Data Storage

Local Data Storage

All your financial data is stored locally using SQLite database with no cloud dependencies:

  • Portfolio holdings and performance data
  • Trading activities and transaction history
  • Account information and settings
  • Goals and contribution limits

API Keys & Secrets

API credentials are securely stored using the operating system keyring through the keyring crate:

  • Core App: Use set_secret and get_secret commands for external services
  • Addons: Use the Secrets API (ctx.api.secrets) for addon-specific sensitive data
  • No Disk Storage: Keys never written to disk or configuration files

Permission System

Addons operate under a comprehensive permission system:

  • Automatic code analysis during installation
  • User consent required for data access
  • Risk-based security warnings
  • Transparent permission declarations

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

License

This project is licensed under the AGPL-3.0 license. See the LICENSE file for details.

🌟 Star History

Star History Chart

Enjoy managing your wealth with Wealthfolio! πŸš€

About

A Beautiful Private and Secure Desktop Investment Tracking Application

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors 25