OpenStock is a full-stack stock market analysis platform built for individual investors, students, and finance enthusiasts who want free, transparent access to real-time market data. It eliminates subscription barriers by combining public APIs with a polished UI, enabling users to monitor portfolios, receive AI-generated summaries, and track sentiment across news and social media — all without vendor lock-in.
Built with Next.js 15 (App Router), TypeScript, and Tailwind CSS, OpenStock uses Better Auth for secure user management, MongoDB for persistent data, Finnhub for market data, and TradingView for interactive charts. Automation is handled via Inngest for cron jobs and AI workflows, while Nodemailer delivers personalized email alerts. The app supports Docker deployment and can be self-hosted on any infrastructure.
What You Get
- Real-time stock tracking - Fetch live and delayed market data via Finnhub API with symbol lookup, price trends, and company profiles.
- Interactive TradingView charts - Embed full-featured candlestick, technical indicator, and heatmap visualizations directly in the app.
- Personalized watchlists - Users can create and save custom stock lists stored in MongoDB with unique symbol-per-user persistence.
- AI-powered email summaries - Inngest automates daily news digests and welcome emails using Gemini or other LLMs, tailored to user watchlists.
- Global command palette (Cmd+K) - Instantly search stocks, navigate dashboards, and trigger actions with a keyboard-driven interface.
- Sentiment insights integration - Optional analysis of Reddit, X.com, news, and Polymarket sentiment via Adanos API to supplement price data.
- Dark theme UI with shadcn/ui - Professionally designed interface using Radix UI primitives and Tailwind CSS v4 with accessible, responsive components.
- Email alerts via Nodemailer - Configure Gmail-based notifications for price thresholds or daily market summaries with app passwords.
Common Use Cases
- Tracking personal investments - An individual investor uses OpenStock to monitor their portfolio of tech stocks without paying for Bloomberg or Yahoo Finance subscriptions.
- Building a finance learning tool - A university professor deploys OpenStock to teach market analysis, letting students explore real data without paywalls.
- Running a free financial newsletter - A finance blogger uses AI-generated daily summaries to send personalized market updates to subscribers via email.
- Self-hosting a stock dashboard - A developer deploys OpenStock on a VPS to maintain full control over data and avoid third-party tracking or ads.
Under The Hood
Architecture
- Clear separation of concerns via React Server Components and App Router, isolating data-fetching logic from UI components using server actions and cached API utilities
- Event-driven background processing through Inngest, enabling asynchronous workflows like weekly summaries and stock alerts without blocking UI responses
- Multi-provider AI fallback system with dynamic routing between providers, ensuring resilience without hard-coded dependencies
- Centralized utility library for formatting, date, and market data logic, promoting reusability and consistency across server and client layers
- Dependency injection via environment variables and modular service exports, enhancing testability and environment-aware behavior
Tech Stack
- Modern React/Next.js stack with Server Components, TypeScript, and Turbopack for high-performance SSR/SSG
- Tailwind CSS with shadcn/ui and utility-first theming for consistent, accessible UI development
- MongoDB with Mongoose for data persistence, containerized via Docker Compose with health checks
- Vite-based Vitest for comprehensive unit and integration testing with environment mocking
- Dockerized deployment using optimized Node.js Alpine images and integrated observability tooling
Code Quality
- Extensive test coverage with realistic mocking of external dependencies and environment variables
- Clean separation of business logic into dedicated action files with pure function semantics
- Robust error handling with graceful degradation and explicit runtime validation of required configurations
- Consistent, domain-driven naming conventions that enhance readability and maintainability
- Strong TypeScript typing with interfaces and guards ensuring data integrity across API boundaries
- Strategic use of server-side caching and revalidation to maintain UI consistency without client-side state bloat
What Makes It Unique
- Integrated sentiment analysis engine that aggregates news, social, and financial data into unified market insights, going beyond price tracking
- Custom TradingView widget with dynamic full-screen expansion, delivering an immersive charting experience within the app
- Serverless event pipeline for automated alerts and user engagement workflows, decoupling financial triggers from UI
- OKLCH-based theming system that ensures perceptual color accuracy for financial visualizations in both light and dark modes
- Server-side watchlist and alert system with caching and upsert patterns, enabling real-time personalization without client state
- Unified search command with symbol autocompletion and direct watchlist integration, creating a cohesive portfolio management interface