TrackStick Market Tracker is a full-stack stock dashboard built with Next.js App Router. It combines TradingView market widgets, stock search, authentication, watchlist foundations, and AI-powered email workflows.
- Authentication with Better Auth (email + password)
- Personalized onboarding profile during sign-up
- Search modal with keyboard shortcut (Ctrl/Cmd + K)
- TradingView-powered dashboard widgets:
- Market Overview
- Stock Heatmap
- Timeline/News
- Market Quotes
- Stock detail pages with multiple TradingView embeds:
- Symbol info
- Advanced candle chart
- Baseline chart
- Technical analysis
- Company profile
- Financials
- Watchlist data model in MongoDB
- Inngest workflows for:
- Personalized welcome email
- Daily AI-generated market news summary email
- Next.js 16 (App Router)
- React 19 + TypeScript
- Tailwind CSS 4
- Better Auth
- MongoDB + Mongoose
- Inngest + Gemini
- Nodemailer
- shadcn/ui + Radix UI + cmdk
- app/(auth): auth pages (sign-in, sign-up)
- app/(root): authenticated app pages (dashboard, stock details)
- app/api/inngest: Inngest route handlers
- components: UI and feature components
- database: MongoDB connection and models
- hooks: reusable frontend hooks
- lib/actions: server actions for auth, stocks, users, watchlist
- lib/inngest: Inngest client, prompts, and functions
- lib/nodemailer: mail transport and templates
Create a .env file in the project root and configure:
- NODE_ENV
- NEXT_PUBLIC_API_URL
- MONGODB_URI
- BETTER_AUTH_SECRET
- BETTER_AUTH_URL
- GEMINI_API_KEY
- INNGEST_DEV
- NODEMAILER_EMAIL
- NODEMAILER_PASSWORD
- NEXT_PUBLIC_FINNHUB_API_KEY
- FINNHUB_API_KEY (optional server-side override)
Notes:
- FINNHUB_API_KEY is checked first in server actions. If missing, NEXT_PUBLIC_FINNHUB_API_KEY is used.
- Do not commit real secrets to version control.
-
Install dependencies:
npm install
-
Create and fill your .env file.
-
Run the development server:
npm run dev
- npm run dev: start local development server
- npm run build: create production build
- npm run start: run production server
- npm run lint: run ESLint
- npm run test:db: verify MongoDB connectivity
- Better Auth is configured in lib/better-auth/auth.ts.
- Root layout checks session and redirects unauthenticated users to /sign-in.
- Middleware excludes static and public auth routes and protects the rest of the app.
Inngest functions are served at /api/inngest and include:
- sign-up-email: triggered on app/user.created
- daily-news-summary: triggered by event and daily cron
These functions fetch user context, gather market news, generate summaries with Gemini, and send emails via Nodemailer.
-
Build locally:
npm run build
-
Deploy to your preferred Next.js host (for example, Vercel).
-
Set all environment variables in the deployment platform.
-
Ensure /api/inngest is reachable for background events/webhooks.
- Core dashboard and auth flow are working.
- Watchlist button currently provides local UI toggling and can be extended to persist actions server-side.