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](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
1. Create a Xendit account and get your API keys
2. Create a product with a recurring price (Rp 150.000/month)
3. Copy the API key to `XENDIT_API_KEY` in `.env.local`
4. Set up a webhook endpoint pointing to `https://your-domain.com/api/xendit/webhook`
5. Subscribe to `INVOICE_CREATED` and `INVOICE_PAID` events
The AI analysis endpoint requires an OpenRouter API key. It:
1. Push your code to GitHub
2. Import the repository in Vercel
3. Add all environment variables in Vercel settings
4. Deploy
Make sure to set all `.env` variables in your deployment platform.
MIT