Trading journal and P&L analytics for Indian retail traders. Import .xlsx transaction exports from INDmoney, Groww, Zerodha, or Motilal Oswal, auto-match trades using FIFO, and get deep performance analytics.
- Framework: Next.js 15 (App Router, Turbopack)
- Language: TypeScript (strict)
- Styling: Tailwind CSS + shadcn/ui (dark mode first)
- Fonts: Geist Sans (body), Geist Mono (numbers), IM Fell Great Primer (display headings)
- Auth: Clerk email OTP (
@clerk/nextjs) - Database: Neon Postgres + Prisma ORM
- Charts: Recharts
- File Parsing: xlsx
- URL State: nuqs
- Toasts: sonner
- Dates: date-fns
- Package Manager: pnpm
- Deployment: Vercel
- Node.js 18+
- pnpm
- Neon Postgres database (free tier works)
- Clerk account (free tier works)
# Install dependencies
pnpm install
# Copy env file and fill in your credentials
cp .env.example .env.local
cp .env.example .env
# Generate Prisma client
pnpm prisma generate
# Push schema to database
pnpm prisma db push
# Seed demo data (optional)
pnpm prisma db seed
# Start dev server
pnpm devCreate .env and .env.local with:
DATABASE_URL= # Neon pooled connection string
DIRECT_URL= # Neon direct connection string
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
CLERK_SECRET_KEY=
NEXT_PUBLIC_APP_URL=http://localhost:3000Prisma CLI reads from
.env, Next.js reads from.env.local. Both need the DB URLs.
pnpm dev # Start dev server (Turbopack)
pnpm build # Production build
pnpm lint # Run linter
pnpm prisma generate # Generate Prisma client
pnpm prisma db push # Push schema to database
pnpm prisma db seed # Seed demo data
pnpm prisma studio # Open Prisma Studio| Route | Description |
|---|---|
/ |
Landing page |
/login |
Email OTP login (password fallback in dev) |
/dashboard |
KPI cards, cumulative/monthly P&L charts, stats |
/insights |
Risk models, Kelly criterion, risk of ruin, day-of-week analysis |
/path-to-profitability |
Goal setting, position sizing, scenario simulator |
/calendar |
Monthly heatmap of daily P&L |
/journal |
Trade table with sorting, filtering, inline editing, CSV export |
/import |
Drag-drop .xlsx upload, FIFO matching preview, import history |
/demo/* |
Read-only demo mode with seeded data (no auth required) |
- Upload
.xlsxexport from INDmoney, Groww, Zerodha, or Motilal Oswal - Parse both Equity and FNO sheets (skip metadata rows 0–5, header at row 6)
- Filter
Order Status === "Executed"rows - Group by symbol → FIFO match BUY/SELL (partial fills supported)
- Unmatched BUYs become OPEN trades
- Preview matched trades → confirm → save to DB
- Duplicate detection by fileName + userId
- All monetary values: Indian number system (
₹1,23,456.78) - All dates:
DD MMM YYYY - Financial Year: Apr 1 → Mar 31 (e.g. FY 2025-26)
- Currency: INR only
- Supports Equity and F&O, Long and Short trades
src/
├── actions/ # Server actions (analytics, trades, import, etc.)
├── app/
│ ├── (auth)/login/ # Login page
│ ├── (app)/ # Authenticated routes (dashboard, journal, etc.)
│ └── demo/ # Demo mode (no auth)
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── layout/ # Sidebar, demo banner
│ ├── landing/ # Landing page sections (hero, features, etc.)
│ ├── dashboard/ # KPI cards, charts, filters
│ ├── journal/ # Trade table, inline editors
│ ├── import/ # File upload, preview, history
│ ├── insights/ # Advanced analytics
│ ├── calendar/ # Heatmap grid
│ └── path-to-profitability/
├── lib/
│ ├── prisma.ts # Prisma singleton
│ ├── fifo.ts # FIFO trade matching
│ ├── format.ts # INR formatting, dates
│ ├── fy-utils.ts # Financial year utilities
│ └── parsers/ # Broker-specific .xlsx parsers
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.ts # Demo data seeder
├── types/index.ts # Shared TypeScript types
└── middleware.ts # Clerk auth + route protection