Financial ToolLive

PortFin - Database portfolio dashboard

A full-stack Indian investment dashboard for trades, holdings, FIFO profit and loss, live prices, benchmarks, goals, tax estimates, and portfolio planning.

PortFin · Overview
Portfolio value₹ 24.8LPerformance
Goal progress72%On track
Allocation
Holdings
Database-backed portfolio performance, allocation, and goals
Overview

About PortFin - Database portfolio dashboard

This full-stack PortFin build stores Indian equity, ETF, and mutual-fund instruments and trades in PostgreSQL. It separates realized and unrealized performance, applies FIFO lot matching to sales, refreshes market prices, saves portfolio snapshots, and connects analytics with goals, benchmarks, estimated taxes, and rebalancing tools.

Product thinking

Challenge and approach

Challenge

Long-term portfolios need transaction-level calculations that simple holding summaries cannot provide. PortFin preserves lots and sell history so realized gains, remaining cost basis, XIRR, holding periods, and estimated LTCG or STCG treatment can be analysed consistently across the portfolio.

Approach

Every sell consumes the oldest available lots first and records matched holding periods for estimated tax classification. XIRR uses a Newton-Raphson solver, while weighted CAGR, portfolio snapshots, and indexed benchmark series support longer-term performance analysis.

Capabilities

Main features

01

Trade, instrument, holding, and snapshot management

02

FIFO sell matching with separate realized and unrealized profit and loss

03

Portfolio-wide and lot-level XIRR, CAGR, tax, and holding-period analytics

04

Benchmark comparison, alpha tracking, loss harvesting, and sector analysis

05

Goal planner, SIP projections, rebalancer, and wealth waterfall

06

Optional local Ollama portfolio advisor with streaming responses

Architecture

How the system is structured

  1. 01

    Next.js App Router pages and API routes provide the portfolio interface and server-side endpoints.

  2. 02

    PostgreSQL and Prisma model users, portfolios, instruments, trades, and point-in-time snapshots.

  3. 03

    The portfolio engine centralizes FIFO matching, XIRR, CAGR, estimated tax, and formatting rules.

  4. 04

    React context coordinates portfolio loading, state, and actions across dedicated dashboard views.

Implementation

Technology and data

Technology stack

  • Next.js
  • React
  • PostgreSQL
  • Prisma
  • Tailwind CSS
  • Chart.js
  • Ollama
  • Server-Sent Events

Data sources

  • Yahoo Finance stock and ETF prices
  • AMFI mutual-fund NAV data
  • NSE and BSE instrument files
  • User-entered portfolio trades

Engineering details

Technical considerations

PrivacyData and privacy
  • The optional AI advisor runs through a locally configured Ollama instance and requires no third-party AI API key.
  • Portfolio records are stored in the configured PostgreSQL database rather than embedded in page code.
Current scopeKnown limitations
  • Tax calculations are estimates and are not a substitute for advice from a chartered accountant.
  • The Nifty 50 comparison includes approximate hardcoded month-end values through April 2026 rather than a complete live benchmark feed.
  • Some analytics benchmark CAGR figures are dated and can diverge from current values.
  • AI responses are informational; PortFin is not a SEBI-registered investment adviser.
OperationsDeployment considerations
  • A PostgreSQL connection and generated Prisma client are required.
  • Yahoo Finance stock and ETF prices use a six-hour cache; AMFI NAV refresh is explicit.
  • The Ollama advisor is optional and requires a locally available model server.
  • The seed workflow clears and reimports trades, so it is intended for controlled setup data.

Use cases

What the project supports

  • Maintain an Indian equity, ETF, and mutual-fund transaction ledger
  • Analyse realized and unrealized performance with FIFO lot matching
  • Compare portfolio results with Indian market benchmarks
  • Plan goals, estimated taxes, loss harvesting, and rebalancing actions

Continue exploring

Financial Tool

Web application

RCharts

A modern, high-performance Indian Stock Market (NSE & BSE) technical analysis dashboard, charting suite, option chain analyzer, and screening tools built with Next.js 16 and React 19.

  • Next.js 16
  • React 19
  • +8

Financial Tool

Excel-based web dashboard

PortFin - Excel portfolio dashboard

A no-backend investment dashboard that turns mutual-fund and stock Excel files into portfolio analytics, planning tools, tax views, and action signals.

  • HTML5
  • CSS3
  • +4

Workflow Website

Web application

Panarwala & Associates

A responsive professional-services website that organizes tax consulting, preparation, and advisory information through reusable, accessible service pages.

  • React
  • CSS custom properties
  • +1