Personal Project · Built with AI

TradeTracker
Robinhood P&L Dashboard

A web application that parses Robinhood CSV exports and instantly visualizes your entire options and stock trading history — calls, puts, buys, and sells — with a color-coded dashboard and interactive treemap.

React + Vite Node.js + Express SQLite Recharts Treemap Options P&L FIFO Calculation AI-Assisted Build

The Problem

Robinhood gives you trades. Not clarity.

Active options traders on Robinhood can rack up hundreds of transactions — stock buys and sells, covered calls, cash-secured puts, long calls and puts — but the platform's built-in history gives you a flat list with no P&L grouping, no visual summary, and no way to quickly see which tickers are working and which are bleeding money.

I wanted to drop in my CSV export and immediately see: where am I up, where am I down, and how do all of my trades fit together visually.

The Solution

Instant visual clarity from a single upload.

TradeTracker accepts Robinhood's standard CSV export, parses every transaction, calculates P&L using FIFO for stocks and premium net for options, and renders two views:

  • Dashboard — per-ticker, per-trade-type cards with color-coded P&L intensity
  • Treemap — proportional area visualization where green = gains, red = losses, size = magnitude

Step 1 — Import

One drag-and-drop. That's it.

The upload flow detects the Robinhood CSV format automatically — Activity Date, Instrument, Trans Code, Quantity, Price, Amount — and redirects to your dashboard the moment processing completes. A warning banner reminds you this is an alpha build and to keep data private.

TradeTracker upload screen — drag and drop Robinhood CSV
Upload Screen — Empty state with CSV drag-and-drop zone

Step 2 — Dashboard

Your entire portfolio, at a glance.

The dashboard opens with a stats bar: Total P&L, Total Stock Trades, Option Sells, Option Buys, and total trade count. Below it, every ticker is listed alphabetically with up to five trade-type cards — Stock Trades, Call Sells, Put Sells, Call Buys, Put Buys — each color-coded by P&L intensity. Filter buttons let you sort by Portfolio, Highest Gains, or Highest Losses.

TradeTracker dashboard — P&L breakdown by ticker and trade type
Dashboard — Real data: Total P&L +$5,213 across 446 trades, per-ticker P&L cards
+$5,213
Total P&L
446
Total Trades
+$20,713
Options Sells
−$21,079
Stock Trades

Step 3 — Treemap

The whole portfolio in one frame.

The treemap is the centerpiece of the visual design. Box area is proportional to the absolute P&L of each position — bigger boxes mean bigger impact, positive or negative. Green intensifies toward dark green for gains over $5k; red intensifies toward dark red for losses over $5k. Top-left anchors the biggest winners, bottom-right anchors the biggest losers. The result is a single image that tells the entire story of your trading year.

TradeTracker treemap — hierarchical P&L visualization with color coding
Treemap Visualization — Stocks & Premium view: size ∝ |P&L|, green = gains, red = losses

Product Requirements

The spec that guided the build.

Before writing any code, a full product requirements document was drafted to define scope, data model, and feature behavior. Here's the core of it.

README.md — Robinhood Trade Tracker

Problem Statement

A personal web application to track and analyze Robinhood trades with a focus on options trading and stock sales. Robinhood's native interface offers no grouped P&L by ticker or trade type, making it difficult for active traders to understand their performance at a glance.

Core Features

  • CSV Upload — Import Robinhood trade data via drag-and-drop. Accepted columns: Activity Date, Instrument, Trans Code, Quantity, Price, Amount.
  • Dashboard View — Box-based P&L visualization grouped by ticker and trade type (Stock Trades, Call Sells, Put Sells, Call Buys, Put Buys).
  • Treemap Visualization — Interactive hierarchical view. Box size ∝ |P&L|. Same color coding as dashboard.
  • P&L Calculation — Stocks use FIFO (First In, First Out). Options use sum of premiums (credits minus debits).

Color Coding Logic

  • Light green/red — |P&L| < $1,000
  • Medium green/red — $1,000 ≤ |P&L| ≤ $5,000
  • Dark green/red — |P&L| > $5,000

Tech Stack

  • Frontend — React + Vite, Recharts (treemap), react-dropzone
  • Backend — Node.js + Express, Multer (file upload)
  • Database — SQLite via better-sqlite3 (local, no cloud required)
  • CSV Parsing — Regex pattern: TICKER STRIKE C/P MM/DD/YY to detect options

API Endpoints

  • POST /api/upload — Upload and parse CSV
  • GET /api/trades/summary — Dashboard data
  • GET /api/trades/treemap — Treemap data
  • GET /api/trades/stats — Overall statistics

Future Enhancements

  • Export P&L report to PDF
  • Date range filtering
  • Performance metrics (win rate, avg gain/loss)
  • Dark mode toggle
  • Mobile app version

The Build Journey

From prompt to working app.

This project was built using AI-assisted development in Claude — an AI code editor — where natural language prompts drove each phase from product spec to polished UI. Here are the key conversations that shaped the build.

Prompt 01 — Product Definition
"I want to build a web app that takes my Robinhood CSV and shows me my P&L for options and stocks. I do calls, puts, buys, and sells. I want a treemap that shows everything visually."
AI drafted the full product requirements, defined the data model (trades table, pl_summary, upload_history), and proposed the React + Node + SQLite stack as the lightest path to a working local app.
Prompt 02 — CSV Parsing Logic
"The Robinhood CSV has options written like 'AAPL 160 C 03/15/24' inside the Instrument field. Parse these correctly and distinguish call sells from put buys."
AI built a regex parser: TICKER STRIKE C/P MM/DD/YY. It auto-detected Trans Codes (STO, BTO, STC, BTC) to classify each option trade into the correct category.
Prompt 03 — P&L Calculation
"For stocks use FIFO. For options just sum the premiums — sells are credits, buys are debits. The net is the P&L."
AI implemented two separate calculation paths: a FIFO queue for stock trades that matches sells to the oldest open buy lots, and a simple premium accumulator for options grouped by ticker and trade type.
Prompt 04 — Dashboard Design
"I want each ticker as a row with up to 5 boxes — one per trade type. Color them green/red based on P&L, and make the color darker the bigger the number."
AI designed the three-tier color intensity system (light/medium/dark), built the TickerSection + TradeTypeBox component hierarchy, and added a stats overview bar at the top of the dashboard.
Prompt 05 — Treemap
"The treemap should show everything at once. Biggest gainers top-left, biggest losers bottom-right. Box size should reflect how big the position is."
AI integrated Recharts' treemap component, mapped P&L magnitude to box area, applied the same color-intensity palette, and structured 5 sections for each trade type with hover tooltips showing ticker + P&L details.
Prompt 06 — Polish & Alpha Banner
"Add an alpha warning so I don't accidentally upload real sensitive data. Style the header with the candle logo. Make it feel like a real trading tool."
AI added the amber alpha build warning banner, designed the TradeTracker logo with candlestick icon, and refined spacing, typography, and filter buttons (Portfolio / Highest Gains / Highest Losses) to give it a polished, product-quality feel.

Tech Stack

Built lean, runs locally, no cloud required.

All trade data stays on your machine. SQLite handles the database locally, so there's no backend to host and no data to expose. The React frontend and Express server run concurrently via a single npm run dev.

Frontend
React + Vite
Backend
Node.js + Express
Database
SQLite (local)
Visualization
Recharts Treemap
File Upload
Multer + react-dropzone
AI Build Tool
Claude by Anthropic

Reflections

What this project taught me about AI-native development.

The most interesting part of this build wasn't the code — it was watching how clearly-defined prompts compressed days of scoping into minutes. When I described the problem in trading terms (FIFO, STO, BTC, premium credits), the AI matched my domain language and produced accurate logic on the first pass.

The lesson: AI code generation is only as precise as the product thinking behind it. The PRD did the heavy lifting. The prompts were just precise instructions built on top of a clear spec. That's a UX skill — knowing exactly what you want before you build it.

Let's Connect

Open to new opportunities and collaborations. Drop me a line.

Get In Touch