Loading...
Loading...
A production-ready SaaS web application for tracking, analyzing, and improving your trading performance with AI-powered insights.
npm install
Copy .env.example to .env.local and update the values:
DATABASE_URL="file:./dev.db"
NEXTAUTH_SECRET="your-super-secret-key-change-this"
NEXTAUTH_URL="http://localhost:3000"
XENDIT_API_KEY="your-xendit-api-key"
XENDIT_CALLBACK_TOKEN="your-xendit-callback-token"
OPENROUTER_API_KEY="your-openrouter-api-key"
GOOGLE_CLIENT_ID="your-google-client-id"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
npx prisma migrate dev
npx prisma generate
npm run dev
Open http://localhost:3000 in your browser.
trademind-ai/
āāā prisma/
ā āāā schema.prisma # Database models (User, Trade)
ā āāā dev.db # SQLite database
āāā src/
ā āāā app/
ā ā āāā page.tsx # Landing page (hero, features, pricing)
ā ā āāā layout.tsx # Root layout with AuthProvider
ā ā āāā globals.css # TailwindCSS styles
ā ā āāā login/page.tsx # Login page
ā ā āāā register/page.tsx # Registration page
ā ā āāā dashboard/page.tsx # Trading journal dashboard
ā ā āāā analytics/page.tsx # Analytics with charts
ā ā āāā pricing/page.tsx # Pricing page
ā ā āāā settings/page.tsx # Settings page
ā ā āāā api/
ā ā āāā auth/ # NextAuth + Register endpoints
ā ā āāā trades/ # Trade CRUD endpoints
ā ā āāā analytics/ # Analytics data endpoint
ā ā āāā ai/analyze/ # AI analysis endpoint
ā ā āāā xendit/ # Xendit checkout + webhook
ā ā āāā csv/ # CSV export/import endpoints
ā āāā components/
ā ā āāā Navbar.tsx # Navigation bar
ā ā āāā TradeForm.tsx # Trade add/edit modal
ā ā āāā AuthProvider.tsx # NextAuth session provider
ā āāā lib/
ā ā āāā db.ts # Prisma client singleton
ā ā āāā utils.ts # Utility functions
ā ā āāā session.ts # Session helpers
ā ā āāā validations/
ā ā āāā trade.ts # Zod validation schemas
ā āāā types/
ā ā āāā next-auth.d.ts # NextAuth type extensions
ā āāā middleware.ts # Route protection middleware
āāā .env.example # Environment variables template
XENDIT_API_KEY in .env.localhttps://your-domain.com/api/xendit/webhookINVOICE_CREATED and INVOICE_PAID eventsThe AI analysis endpoint requires an OpenRouter API key. It:
id, email, name, password (hashed), plan (FREE/PRO), stripeCustomerId, createdAt, updatedAtid, userId, asset, type (LONG/SHORT), entryPrice, exitPrice, stopLoss, takeProfit, positionSize, result, notes, tags, createdAt, updatedAtMake sure to set all .env variables in your deployment platform.
MIT