A modern stock tracking application that provides real-time market data, personalized alerts, and detailed company insights powered by AI.
- Real-time Stock Tracking: Monitor live stock prices and market movements
- Interactive Charts: Multiple TradingView widgets including candlestick charts, heatmaps, and technical analysis
- Smart Watchlist: Track your favorite stocks with a personalized watchlist
- Market Overview: Comprehensive dashboard with market data, top stories, and market heatmaps
- Stock Details: In-depth company profiles, financials, and technical analysis for individual stocks
- AI-Powered Insights: Personalized welcome emails and news summaries powered by Gemini AI
- Email Notifications: Automated email alerts for market news and watchlist updates
- Secure Authentication: Email-based authentication with Better Auth
- Dark Mode: Beautiful dark theme optimized for long trading sessions
- Framework: Next.js 15.5.4 with App Router & Turbopack
- Frontend: React 19.1.0, TypeScript, TailwindCSS
- Authentication: Better Auth
- Database: MongoDB with Mongoose 8.19.1
- Market Data: Finnhub API for real-time stock data
- Charts: TradingView Widgets
- AI: Google Gemini API for content generation
- Background Jobs: Inngest for scheduled tasks
- Email: Nodemailer for transactional emails
- UI Components: Radix UI, Lucide Icons
- Forms: React Hook Form
- Styling: Tailwind CSS 4, shadcn/ui components
Before you begin, ensure you have the following installed:
- Node.js 20.x or higher
- npm or yarn or pnpm
- MongoDB instance (local or cloud like MongoDB Atlas)
You'll also need API keys from:
- Finnhub - for stock market data
- Google AI Studio - for Gemini API access
- SMTP credentials for email notifications
git clone https://github.com/Dev-muse/TickrMind.git
cd TickrMindnpm install
# or
yarn install
# or
pnpm installCreate a .env.local file in the root directory and add the following variables:
# Database
MONGODB_URI=your_mongodb_connection_string
# Authentication
BETTER_AUTH_SECRET=your_secret_key_here
BETTER_AUTH_URL=http://localhost:3000
# Finnhub API (Stock Market Data)
FINNHUB_API_KEY=your_finnhub_api_key
NEXT_PUBLIC_FINNHUB_API_KEY=your_finnhub_api_key
# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key
# Email Configuration (Nodemailer)
NODEMAILER_EMAIL=your_email@example.com
NODEMAILER_PASSWORD=your_app_specific_passwordNote:
- Generate
BETTER_AUTH_SECRETusing:openssl rand -base64 32 - For Gmail, use App Passwords for
NODEMAILER_PASSWORD
npm run test:dbThis will verify your MongoDB connection is working correctly.
npm run devOpen http://localhost:3000 in your browser to see the application.
TickrMind/
βββ app/ # Next.js App Router
β βββ (app)/ # Protected app routes
β β βββ page.tsx # Dashboard with market overview
β β βββ stocks/ # Stock detail pages
β βββ (auth)/ # Authentication routes
β β βββ sign-in/ # Sign in page
β β βββ sign-up/ # Sign up page
β βββ api/ # API routes
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ forms/ # Form components
β βββ ui/ # UI components (shadcn)
β βββ Header.tsx # Navigation header
β βββ SearchCommand.tsx # Stock search command palette
β βββ TradingViewWidget.tsx # TradingView widget wrapper
β βββ WatchlistButton.tsx # Add to watchlist button
βββ database/ # Database layer
β βββ models/ # Mongoose models
β βββ mongoose.ts # Database connection
βββ hooks/ # Custom React hooks
βββ lib/ # Utility functions
β βββ actions/ # Server actions
β β βββ auth.actions.ts # Authentication actions
β β βββ finnhub.actions.ts # Stock data fetching
β β βββ user.actions.ts # User operations
β β βββ watchlist.actions.ts # Watchlist management
β βββ better-auth/ # Auth configuration
β βββ ingest/ # Inngest functions & prompts
β βββ nodemailer/ # Email templates & sender
β βββ constants.ts # App constants & configs
β βββ utils.ts # Helper functions
βββ middleware/ # Next.js middleware
βββ public/ # Static assets
βββ scripts/ # Utility scripts
βββ types/ # TypeScript type definitions
βββ .env.local # Environment variables (create this)
The main dashboard (app/(app)/page.tsx) displays:
- Market overview with major indices
- Stock heatmap for market sentiment
- Latest market news timeline
- Real-time market quotes
Individual stock pages (app/(app)/stocks/[symbol]/page.tsx) show:
- Symbol information and pricing
- Advanced candlestick charts
- Technical analysis indicators
- Company profile and financials
- Baseline chart for performance tracking
Users can:
- Add stocks to their personal watchlist
- Receive email notifications about watchlist stocks
- Quick access to tracked stocks
- Welcome Email: Personalized based on user profile (investment goals, risk tolerance, preferred industry)
- News Summary: Daily digest of market news for watchlist stocks
# Start development server with Turbopack
npm run dev
# Build for production
npm run build
# Start production server
npm start
# Run ESLint
npm run lint
# Test database connection
npm run test:dbThe app uses Better Auth for authentication with:
- Email/password sign-up and sign-in
- Protected routes via middleware
- Session-based authentication
- Secure password handling
Protected routes (requiring authentication):
- Dashboard (
/) - Stock details (
/stocks/[symbol]) - Any route except sign-in, sign-up, and API routes
Managed by Better Auth (email, password hash, session data)
{
userId: string, // Reference to user
symbol: string, // Stock symbol (e.g., "AAPL")
company: string, // Company name
addedAt: Date // Timestamp
}- Push your code to GitHub
- Import project in Vercel
- Add all environment variables in Vercel dashboard
- Deploy
Ensure your deployment platform supports:
- Node.js 20+
- Environment variables configuration
- MongoDB connection (whitelist deployment IPs if using MongoDB Atlas)
Widget configurations are in lib/constants.ts. Customize:
- Chart types
- Colors and themes
- Symbols displayed
- Time intervals
Email templates are in lib/nodemailer/templates.ts. Customize:
- Welcome email content
- News summary format
- Styling
Background jobs are in lib/ingest/functions.ts:
sendSignUpEmail: Triggered on user registrationsendNewsSummaryEmail: Scheduled daily news digest
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is private and proprietary.
- Verify MongoDB URI in
.env.local - Check MongoDB Atlas IP whitelist
- Run
npm run test:dbto diagnose
- Finnhub free tier has rate limits
- Consider caching strategies for production
- Verify SMTP credentials
- For Gmail, use App Passwords
- Check firewall/network restrictions
For issues and questions, please open an issue on GitHub.
Built with β€οΈ by Dev-muse