Skip to content

Conversation

@atrtde
Copy link

@atrtde atrtde commented Jan 2, 2026

This PR introduces inflation awareness to the portfolio, so it's easier to understand how purchasing power changes over time and how inflation impacts real returns.

✨ What’s New

  • Inflation tracking by country
    Inflation rates can be tracked per country, with initial data sourced from World Bank CPI statistics.

  • Inflation-adjusted portfolio insights
    A new view compares nominal portfolio values with real (inflation-adjusted) values over time, making it easier to see the true performance of investments over time.

  • Inflation rate management
    A dedicated settings page allows users to view, add, edit, or remove inflation rates as needed.

Implementation Details

Backend (Rust)

  • Added a new inflation module with models, repositories, services, and traits

  • Introduced a database migration for an inflation_rates table storing yearly rates by country

  • Integrated the World Bank API to fetch CPI (Consumer Price Index) data

  • Exposed Tauri commands for:

    • CRUD operations on inflation rates
    • Inflation-adjusted portfolio calculations

Frontend (React)

  • New Inflation Insights page at /insights/inflation featuring an interactive chart comparing nominal vs real portfolio values
  • Country selector with automatic default based on the user’s base currency
  • Configurable reference date (month/day) for year-over-year comparisons
  • New settings page at /settings/inflation-rates for managing inflation data
  • Forms for adding and editing inflation rates, including data source tracking

Notes

  • Initial support for 8 countries: US, UK, Germany, France, Canada, Japan, Australia, and Switzerland
  • Calculates cumulative inflation starting from a user-selected base year
  • Visualizes purchasing power erosion over time
  • Uses the closest available valuation to a reference date (default: December 31st) for accurate year-end comparisons

Copilot AI review requested due to automatic review settings January 2, 2026 20:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces comprehensive inflation tracking capabilities to help users understand real portfolio performance adjusted for purchasing power changes over time.

Key Changes:

  • Backend inflation module with World Bank API integration for CPI data
  • New inflation rates management UI with CRUD operations
  • Interactive chart comparing nominal vs inflation-adjusted portfolio values
  • Database migration for storing inflation rates by country and year

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/routes.tsx Adds route for inflation rates settings page
src/pages/settings/settings-layout.tsx Adds navigation item for inflation settings
src/pages/settings/inflation-rates/inflation-rates-page.tsx Main settings page for managing inflation rates with country filtering
src/pages/settings/inflation-rates/components/inflation-rate-item.tsx Component for displaying individual inflation rate entries
src/pages/settings/inflation-rates/components/inflation-rate-form.tsx Form for creating/editing inflation rates
src/pages/settings/inflation-rates/components/inflation-rate-edit-modal.tsx Modal wrapper for inflation rate form
src/pages/settings/inflation-rates/use-inflation-rate-mutations.ts React hooks for inflation rate data fetching and mutations
src/pages/insights/portfolio-insights.tsx Adds inflation tab to portfolio insights
src/pages/insights/inflation/inflation-page.tsx Main inflation insights page with chart and configuration
src/pages/insights/inflation/components/inflation-chart.tsx Bar chart comparing nominal vs real values
src/lib/types.ts Type definitions for inflation models
src/lib/schemas.ts Zod validation schema for inflation rates
src/lib/query-keys.ts Query keys for React Query cache management
src/commands/inflation-rates.ts Frontend commands for Tauri/Web API calls
src-tauri/src/lib.rs Registers inflation Tauri commands
src-tauri/src/context/registry.rs Adds inflation service to service context
src-tauri/src/context/providers.rs Initializes inflation repository and service
src-tauri/src/commands/mod.rs Exports inflation command module
src-tauri/src/commands/inflation.rs Tauri command handlers for inflation operations
src-core/src/schema.rs Diesel schema for inflation_rates table
src-core/src/lib.rs Exports inflation module
src-core/src/inflation/mod.rs Module exports for inflation functionality
src-core/src/inflation/inflation_traits.rs Trait definitions for repository and service
src-core/src/inflation/inflation_service.rs Service implementation with World Bank API integration and calculations
src-core/src/inflation/inflation_repository.rs Repository implementation for database operations
src-core/src/inflation/inflation_model.rs Data models for inflation rates and World Bank API
src-core/migrations/2026-01-02-100000_create_inflation_rates/up.sql Creates inflation_rates table with indexes
src-core/migrations/2026-01-02-100000_create_inflation_rates/down.sql Migration rollback script

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant