A journal-first trading application. Journal first. Trades second.
- Pre-Market Check-In: Daily mindset assessment, sleep quality, market bias
- Emotion Tracking: Quick emotion capture throughout the trading day
- Trade Log: Full CRUD with 16-field trade logging
- Weekly Review: Structured reflection with setup analysis
- Analytics: Win rate, profit factor, setup performance
- Framework: Next.js 14 (App Router)
- Database: Neon (PostgreSQL) + Drizzle ORM
- Auth: JWT (jose) + bcryptjs
- Styling: Tailwind CSS
- Icons: Lucide React
-
Clone and install:
npm install
-
Configure environment:
cp .env.example .env
Edit
.env:DATABASE_URL: Your Neon connection stringJWT_SECRET: Generate withopenssl rand -base64 32
-
Push database schema:
npm run db:push
-
Run development server:
npm run dev
src/
├── app/
│ ├── (auth)/ # Login, Register pages
│ ├── (dashboard)/ # Journal, Trades, Review, Analytics
│ └── api/ # REST API routes
├── components/
│ ├── forms/ # PreMarketCheckin, TradeForm, etc.
│ ├── layout/ # Sidebar
│ └── ui/ # DailyStats, TradeList
├── db/
│ ├── schema.ts # Drizzle schema
│ └── index.ts # Neon connection
├── hooks/ # useAuth, useTrades, useCheckins, useEmotions
├── lib/
│ ├── auth.ts # JWT, sessions, password hashing
│ ├── calculations.ts # P&L, stats
│ └── validations.ts # Zod schemas
└── types/ # TypeScript types
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register new user |
| POST | /api/auth/login |
Login |
| POST | /api/auth/logout |
Logout |
| GET | /api/auth/me |
Get current user |
| GET/POST | /api/trades |
List/Create trades |
| GET/PATCH/DELETE | /api/trades/[id] |
Single trade operations |
| GET/POST | /api/checkins |
Daily check-ins (upsert) |
| GET/POST | /api/emotions |
Emotion captures |
| GET/POST | /api/entries |
Journal entries |
| GET/POST | /api/reviews |
Weekly reviews (upsert) |
- users: id, email, name, passwordHash
- trades: 16 fields including ticker, side, prices, P&L, setup, grade, lesson
- daily_checkins: mindset score, sleep, bias, focus
- emotion_captures: timestamp, emotions array, note
- journal_entries: date, type, content, emotion tags
- weekly_reviews: best/worst setup, errors, rules, reflection
npm run dev # Start dev server npm run build # Production build npm run db:push # Push schema to database npm run db:studio # Open Drizzle Studio