18 Years of Investing and I Was Still Winging It
This app was born out of desperation.
Over 18 years I'd accumulated 60-70 long-term stock picks with no systematic way to evaluate them. Then I started swing trading volatile picks like MSTR. Then a friend introduced me to scalp trading. Suddenly I had three completely different strategies running in the same accounts with no way to separate them — and no real policies governing any of it.
Trailmark.trading is what I built to fix that. It's a scorecard and analytics system for reviewing, journaling, and planning trades across all three strategies. Three months in development, built out of genuine need.
Building Trailmark forced me to get serious about the theory too. I read The Intelligent Investor by Benjamin Graham — twice, actually, in parallel. A 2003 print and a 2024 print, because Jason Zweig's commentary has evolved significantly between editions. Reading them side by side turned out to be as interesting as the original text.


The system has been authored by myself and AI using cursor. Here are the details reported out of the IDE using Opus 4.6.
The 5-Minute Briefing for a Senior Dev
What is this?
Trailmark is a trading journal and portfolio analytics platform for individual investors who run multiple strategies simultaneously. The core insight is that most traders don't just do one thing — they scalp, they swing-trade, and they hold long-term positions — but every tool on the market forces you to lump them together. Trailmark separates Scalp, Swing, and Hold into first-class strategy lanes, each with their own trade views, journal system, and performance metrics.It's a single-user product today (the founder's own tool), but built with multi-tenancy via Supabase RLS from day one.
Tech Stack (one breath)
Next.js 14 App Router, TypeScript, Supabase (Postgres + Auth), deployed presumably on Vercel. Styling is a custom theme object with inline styles — no Tailwind, no CSS-in-JS library. OpenAI for LLM-powered statement parsing. Sentry for error tracking. No test suite. No CI/CD pipeline checked in.
Architecture in 60 Seconds
- app/ — ~90 files. Standard App Router with dashboard/ as the protected area. Heavy route tree: trades, portfolio, performance, journal, investments, import-csv, settings, integrations, ATP.
- components/ — ~85 files, feature-organized. Clean separation. Client components with 'use client'.
- lib/ — ~58 files. This is where the real logic lives: portfolio performance (TWR calculations), position health analysis, evaluation engine, tax lot tracking, CSV/PDF parsers, broker adapters (Webull, ETRADE).
- hooks/ — 14 custom hooks. useUser, useTrades, useLivePrices, usePersistedState (hydration-safe localStorage). No Redux/Zustand — all local state + Context for complex flows.
- app/api/ — RESTful routes with consistent auth-check patterns. Portfolio, journal, accounts, backtesting, statement parsing, Webull integration.
- supabase/migrations/ — 32 migration files. Key tables: trades, accounts, snapshots, cashflows, monthly_returns, position_metrics, position_evaluations, daily_journals, journal_entries, tasks, broker_integrations.
- docs/ — 198 files (!). Extremely well-documented with architecture docs, specs, and implementation status tracking.
What's Interesting / What Works Well
- Strategy-first data model — The entire schema and UI respects the Scalp/Swing/Hold separation. This is the product's differentiator and it's deeply embedded.
- Evaluation engine — CQRS-inspired read model. Positions get classified into states like COMPOUNDING, STALLED, DEAD_CAPITAL with suggested actions (HOLD, TRIM, EXIT_CANDIDATE). Sophisticated stuff.
- Multi-source ingestion — CSV import, PDF statement parsing (with LLM fallback), Webull API integration, manual entry. The import-csv page is the workhorse.
- Agent Task Protocol (ATP) — A homegrown task management system with database-backed tasks, LLM-powered ingestion, and a dedicated UI. It's how dev work is tracked and prioritized — effectively a lightweight project management tool built into the product.
- Documentation discipline — 20+ spec documents, architecture diagrams, user guides. For a solo-developer project, this is unusually thorough.
What Will Raise Your Eyebrows
- import-csv/page.tsx is ~5,950 lines. It's the heart of the product's data ingestion and it's a monolith — parsing, UI, state management, duplicate detection, tax lot assignment, all in one file. This is the single biggest refactoring target.
- Zero tests. No Jest, no Vitest, no Cypress, no Playwright. No test scripts in package.json. The evaluation engine, portfolio calculations, and import logic are all untested.
- No CI/CD pipeline. No GitHub Actions, no Vercel config checked in. Deploys are presumably manual or Vercel auto-deploy from main. (YES THEY AUTO-DEPLOY FROM MAIN)
- Inline styles everywhere. There's a well-structured theme.ts object, but it's applied via inline style={} props rather than CSS modules, Tailwind, or a styling library. Works, but makes responsive design and pseudo-selectors harder. (I HATE CSS WITH CURSOR- LOOKING FOR MORE HELP HERE!)
- No .env.example. New developers would need to reverse-engineer which env vars are needed (NEXT_PUBLIC_SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY, OPENAI_API_KEY, POLYGON_API_KEY, SENTRY_*).
- Some feature overlap — There's both a /dashboard/investments/ and /dashboard/portfolio/ route. The investments route appears to be legacy and in the process of being deprecated, but both still exist.
Where Development Is Headed
Based on the spec documents and recent migrations:
- Import system overhaul — SPEC_IMPORT_IMPROVEMENT_PARSER_GENERATOR.md suggests a parser-generator approach to replace the monolithic import page.
- Journal system expansion — Position-level journals for Swing/Hold, planning entries, intent tracking. Recent migrations (add_position_journal_entries.sql) confirm active work here.
- Tax lot tracking — SPEC_TAX_LOT_TRACKING.md — proper cost-basis tracking for Hold positions.
- Portfolio deprecation — PLAN_HOLD_HEALTH_CARD_AND_PORTFOLIO_DEPRECATION.md — consolidating the investments/portfolio routes.
- Backtesting engine — SPEC_STRATEGY_BASED_BACKTESTING_ENGINE.md — a strategy backtesting system is specced out.
If I Had to Prioritize the Review
- Start with lib/ — this is where the business logic lives and where bugs would be most expensive. The evaluation engine, portfolio performance calculations, and tax lot logic are the crown jewels.
- Then import-csv/page.tsx — understand the data ingestion pipeline. It's the entry point for all trade data and the most complex single file.
- Then the API routes — check the auth patterns, data validation, and error handling.
- Then the migration files — understand the data model and look for missing indexes or constraints.
The codebase is the work of a disciplined solo developer who documents heavily and builds methodically. The main risks are the usual solo-dev ones: no tests, no peer review history, and a few files that grew too large before being split. The architecture is sound — it just needs hardening.
If you are interested in an early look, visit trailmark.trading and request alpha access.