portfolio-tracker
Self-hosted portfolio tracking web app with ASP.NET Core, React, PostgreSQL, and market data integration.
- ASP.NET Core
- React
- TypeScript
- EF Core
- PostgreSQL
- FastAPI
Purpose and Scope
A personal portfolio application for assets, buy/sell transactions, cash balances and prices. It presents open and closed positions, transaction history and portfolio totals. Manual prices can be supplied when provider data is unavailable or unsuitable.
Architecture and Repository Structure
PortfolioTracker.API: feature-based ASP.NET Core application for transactions, assets, prices and portfolio calculations.PortfolioTracker.Frontend: React and TypeScript interface using TanStack Query.market-data-service: FastAPI service exposing the borsapy provider over HTTP.tests: API integration tests, with frontend and Python tests in their own directories.
The API accesses PostgreSQL through EF Core. Market data integration lives in a separate Python service while portfolio calculations remain inside the API.
Workflow
Buys and sells are stored as Transactions. The API combines transactions and prices per asset to calculate positions. Derived records in PortfolioPositions supply position and summary reads for the interface.
Background jobs can refresh market prices, and manual overrides are supported. The read model can be rebuilt from transaction and price records.
Technical Decisions
Transactions are the source of truth; the positions table is a rebuildable read model. This separates presentation totals from original portfolio activity.
PortfolioCalculations computes weighted average cost from the remaining cost basis and tracks realised gains or losses. A closing tolerance handles small quantity remnants. The Python QuoteService normalises symbols and isolates stock/fund provider selection from the API.
Limits and Validation
Price availability depends on an external provider. Missing prices carry availability information in the price contract; uninterrupted coverage of every asset is not guaranteed. The repository describes a personal learning tool rather than a multi-user SaaS.
API, React and Python test files are present. This review read the calculations and data flow; it did not start the services or revalidate their test results.
Sources
Reviewed on 8 September 2026. Reviewed revision (9b049a4).