Tradiator Documentation
QA tester reference covering every feature, screen, API endpoint, database table, and test scenario. Covers the full platform as of v1.0.
On this page
Overview
Tradiator is a trading journal and analytics platform for funded futures traders. Log trades, write daily playbook entries, track evaluation costs and payouts, analyze performance, and document strategies โ all in one dashboard.
Tech Stack
| Next.js 15 | App Router, Server Components |
| TypeScript | Strict mode throughout |
| Tailwind CSS | Dark + light mode theming |
| shadcn/ui | Radix-based component library |
| Recharts | Equity curve chart |
| Sonner | Toast notifications |
| Supabase | PostgreSQL + Auth + RLS |
| Vercel | Deployment (Serverless + Edge) |
| Next.js API Routes | REST endpoints at /api/* |
| Supabase Auth | Email/password, JWT sessions |
| Row Level Security | Per-user data isolation in DB |
Roles & Access
Three user roles. All role checks happen server-side via requireRole() on every page and API route โ cannot be bypassed from the client.
| Role | Can Do | Cannot Do |
|---|---|---|
| admin | Everything โ full data access, admin panel, role & plan changes, delete any account | Nothing |
| moderator | Admin panel (read), view all users/trades/journals, manage cooldowns | Change roles, delete accounts |
| user | Own dashboard, trades, journal, strategies, eval, settings | Admin panel, other users' data |
update public.profiles set role = 'admin' where email = 'you@example.com';Plans
Users can be on free, pro, or premium. Free users see a banner. Plan is stored in profiles.plan and the subscriptions table.
Dashboard
Main landing page after login. Route: /dashboard. Shows aggregate performance stats, equity curve, recent trades, and recent journal entries.
Stat Cards
| Stat | Calculation |
|---|---|
| Net P&L | Sum of (pnl โ commission) for all trades in selected time range |
| Win Rate | Count of trades where pnl > 0 รท total trades ร 100 |
| Profit Factor | Sum of winning P&L รท absolute sum of losing P&L |
| Avg W / L | Average winning and average losing trade amounts |
| Best Day % | Highest single-day net P&L as % of total P&L |
| Best DOW | Day of week with highest average net P&L across all trades |
Time Filters
Tabs across the top: Today, 1W, 1M, 3M, 6M, 1Y, All, Custom. Custom allows a date range picker. All stat cards and the equity curve respond to the active filter.
Log Win / Log Loss Buttons
Top-right on desktop (large buttons), floating pill buttons bottom-right on mobile. Log Win pre-fills direction as Long; Log Loss pre-fills as Short.
Recent Journal Feed
Right panel shows the last 3 journal entries with mood badge, title, bias, and notes preview.
Trade Logging
Every trade is stored in the trades table. Trades can be entered manually, created from the Trades page, or imported via CSV.
Trade Entry Form Fields
| Field | Type | Required | Notes |
|---|---|---|---|
| Date | date | โ | Defaults to today |
| Symbol | text | โ | ES, NQ, MES, MNQ, CL, GC, RTY, YM, Other |
| Direction | Long / Short | โ | Pre-filled by Log Win (Long) or Log Loss (Short) |
| Contracts | integer | โ | Defaults to 1 |
| Entry Price | decimal | โ | Used for R-multiple calculation |
| Exit Price | decimal | โ | Used for R-multiple calculation |
| Stop Price | decimal | โ | Used for R-multiple calculation |
| P&L | decimal | โ | Gross profit/loss before commission |
| Commission | decimal | โ | Default 0. Net P&L = pnl โ commission |
| Setup | text | โ | Free text, links conceptually to Strategies |
| Session | text | โ | London, NY Open, NY AM, NY PM, Asia |
| Grade | A+/A/B/C/D | โ | Quality grade for trade execution |
| Notes | text | โ | Free-text notes |
| Account | uuid | โ | Links to a trading account |
R-Multiple Auto-Calculation
// Long R = (exitPrice - entryPrice) / Math.abs(entryPrice - stopPrice) // Short R = (entryPrice - exitPrice) / Math.abs(entryPrice - stopPrice)
Trades Page โ /trades
Table of all trades. Supports multi-select bulk delete, inline edit via pencil icon, and click-to-detail.
Post-Trade Reflection Popup
If enabled in Preferences, a reflection dialog appears after logging any trade. Can be toggled off in Settings โ Preferences.
Playbook Calendar
Route: /journal/calendar. Monthly grid where each day cell shows that day's net P&L and trade count. Green = profit, Red = loss.
Cell Behavior
| Cell State | Action on Click | Visual Cue |
|---|---|---|
| Day with journal entry | Navigates to /journal/calendar/YYYY-MM-DD | Colored border + P&L + mood dot |
| Day without journal entry | Opens journal entry editor dialog | Empty cell with day number only |
| Today | Same as above based on entry status | Blue ring border |
| Outside current month | Not clickable | 10% opacity, greyed out |
Journal Day View
Route: /journal/calendar/YYYY-MM-DD. Full-page view for a specific trading day. Only reachable when a day has an existing journal entry.
All Sections Displayed
- Header Pills โ Mood, Bias, Star rating, Rules followed, Net P&L + trade count
- Pre-Market Plan โ Full text, whitespace preserved
- Post-Session Notes โ Notes written after the close
- Setups Traded โ Badge list
- Sessions Traded โ Badge list
- Improvement Focus โ One thing the trader was working on
- Trades Table โ Symbol, Direction, Contracts, Entry, Exit, Net P&L, R, Setup
Links to /journal/calendar?edit=YYYY-MM-DD โ auto-opens the entry editor.
Confirm dialog โ deletes via DELETE /api/journal-entries โ redirects to calendar.
Insights & Analytics
Route: /insights. All calculations happen server-side from trades and journal_entries tables on every page load.
Computed Metrics
| Metric | Formula |
|---|---|
| Win Rate | wins.length / trades.length ร 100 |
| Profit Factor | sum(winning pnl) รท abs(sum(losing pnl)) |
| Avg R-Multiple | Sum of r_multiple รท count of trades with r_multiple set |
| Best Month | Month with highest sum(pnl โ commission) |
| Rules Followed % | Entries where rules_followed = true รท total entries |
| Avg Rating | Average of journal_entries.rating (0โ5) |
Strategy Library
Route: /strategies. Stored in the strategies Supabase table โ not localStorage. Scoped per user via RLS.
Strategy Fields
| Field | Type | Description |
|---|---|---|
| Name | text (required) | e.g. "ICT OTE Long", "VWAP Reclaim" |
| Sessions | text[] | London, NY Open, NY AM, NY PM, Asia |
| Timeframes | text[] | 1m, 3m, 5m, 15m, 30m, 1h, 4h, Daily |
| Entry Conditions | text | Step-by-step entry rules |
| Confluences Required | text | Confirmation signals needed |
| Tags | text[] | Comma-separated. Shown as #tag chips. |
| Color | hex string | 8 options. Left-border accent on card. |
CRUD Flow
Eval Expenses & Payouts
Route: /eval. Stored in eval_expenses and eval_payouts Supabase tables โ not localStorage.
Types: Evaluation Fee, Reset Fee, Monthly Fee, Platform Fee, Other. Scrollable table (~10 rows), sorted newest first.
Fields: Date, Firm, Amount, Notes. Status always shows Paid. Scrollable, sorted newest first.
Stats Cards
| Card | Calculation |
|---|---|
| Total Expenses | Sum of all expense amounts |
| Total Payouts | Sum of all payout amounts |
| Net Profit | Total Payouts โ Total Expenses |
| Best Month | Month with highest (payouts โ expenses) net |
| ROI on Evals | (Net Profit รท Total Expenses) ร 100 |
๐ Congratulations Banner
When a payout is saved, a gold pill banner drops from the top center. Shows trophy icons, amount, and firm name. Auto-dismisses after 5 seconds.
CSV Import
Route: /import. Supports Tradovate, ProjectX/Rithmic, and Generic CSV formats.
- 1Select Platform
Choose: Tradovate, ProjectX, or Generic.
- 2Select Account
Pick which trading account to attribute these trades to.
- 3Paste CSV
Paste raw CSV text into the textarea.
- 4Preview Parsed Rows
System shows a preview table of mapped trades before import.
- 5Confirm Import
Sends to
POST /api/import-csvwhich bulk inserts into trades table.
Account Settings
Route: /settings. All changes save to Supabase in real time.
| Tab | What You Can Do |
|---|---|
| Profile | Edit full name. Change password (min 8 chars, must match confirmation). Email/role/plan are read-only. |
| Accounts | Add/edit/delete trading accounts. Types: funded, eval, live, PA. |
| Preferences | Timezone, default currency, language, post-trade popup toggle. |
| Subscription | View plan, billing period, cancel-at-period-end status. |
| Theme | Toggle dark/light mode. Accent color picker. |
| Sessions | View active login sessions. Revoke individual sessions. |
| Danger Zone | Clear All Trades (irreversible). Delete Account (all data deleted). |
API Reference
All routes under /api/* as Next.js Route Handlers. Every route verifies auth. Unauthenticated requests return 401.
Trades
| Method | Route | Description |
|---|---|---|
| POST | /api/trades | Create a trade. Calculates R server-side. |
| PATCH | /api/trades/update | Update an existing trade |
| DELETE | /api/trades | Delete a trade. RLS enforces ownership. |
Journal Entries
| Method | Route | Description |
|---|---|---|
| POST | /api/journal-entries | Upsert โ one entry per user per date |
| DELETE | /api/journal-entries | Delete by ID |
Strategies
| Method | Route | Description |
|---|---|---|
| GET | /api/strategies | List all for current user |
| POST | /api/strategies | Create new strategy |
| PATCH | /api/strategies | Update by ID (must be owner) |
| DELETE | /api/strategies | Delete by ID (must be owner) |
Eval Expenses & Payouts
| Method | Route | Description |
|---|---|---|
| GET | /api/eval-expenses | List all for current user |
| POST | /api/eval-expenses | Create expense |
| DELETE | /api/eval-expenses | Delete by ID |
| GET | /api/eval-payouts | List all for current user |
| POST | /api/eval-payouts | Create payout (triggers banner) |
| DELETE | /api/eval-payouts | Delete by ID |
Other
| Method | Route | Description |
|---|---|---|
| POST | /api/import-csv | Bulk insert trades from CSV data |
| DELETE | /api/delete-account | User self-deletion |
Error Format
// Success
{ data: {...} }
// Error
{ error: "Error message here" } // HTTP 400, 401, 403, or 500
Database Schema
All tables in public schema of Supabase (PostgreSQL 15). Every table has Row Level Security enabled.
profiles
| Column | Type | Notes |
|---|---|---|
| id | uuid PK | References auth.users โ cascade delete |
| text | Unique, not null | |
| role | text | user | moderator | admin. Default: user |
| plan | text | free | pro | premium. Default: free |
| banned | boolean | Default false |
| last_seen | timestamptz | Updated on every authenticated page load |
trades
| Column | Type | Notes |
|---|---|---|
| user_id | uuid FK | References profiles. Cascade delete. |
| trade_date | date | Not null |
| pnl | numeric(14,2) | Gross P&L before commission |
| commission | numeric(14,2) | Default 0 |
| r_multiple | numeric(8,2) | Calculated server-side. Nullable. |
| is_flagged | boolean | Default false |
journal_entries
| Column | Type | Notes |
|---|---|---|
| entry_date | date | Unique per user_id |
| bias | text | Bullish | Bearish | Neutral | null |
| mood | text | great | good | neutral | bad | terrible | null |
| rating | int | 0โ5 stars |
| setups | text[] | Array of setup names |
| sessions | text[] | Array of sessions traded |
| rules_followed | boolean | Nullable |
Other Tables
| Table | Purpose |
|---|---|
| accounts | Trading accounts (funded/eval/live/PA) |
| strategies | User strategy library |
| eval_expenses | Eval costs per user |
| eval_payouts | Payout records per user |
| cooldowns | Admin-placed trading cooldowns |
| user_settings | Per-user preferences |
| subscriptions | Stripe subscription data |
| admin_logs | Immutable audit log of all admin actions |
Auth & Security
Authentication Flow
requireRole() โ How It Works
const { user, profile } = await requireRole(["user", "moderator", "admin"]);
// 1. Gets JWT user from Supabase Auth
// 2. Fetches profile row from DB (role, banned, plan)
// 3. Checks role is in allowed array
// 4. Checks banned = false
// 5. Updates last_seen timestamp
// 6. Returns user + profile โ or redirects to /login
Security Summary
requireRole() or they're unprotected.Test Scenarios & Checklist
Each item should pass without errors on a fresh user account unless noted.
๐ Authentication
๐ Dashboard
๐น Trade Logging
๐ Playbook Calendar
๐ Journal Day View
๐๏ธ Strategies
๐ฐ Eval & Payouts
๐ฅ CSV Import
โ๏ธ Settings
๐ฑ Mobile
Tradiator Documentation ยท For internal tester use only ยท Do not distribute publicly