OpenStock: Free Open-Source & Self-Hosted Stock Market Data Platform

OpenStock: Free Open-Source & Self-Hosted Stock Market Data Platform 113

A free, open-source, and self-hosted stock market data platform—a solid free alternative to expensive commercial tools. It offers real-time prices, custom alerts, and detailed company info, with all features permanently free for individual investors, students, and developers.

#Ai工具箱 #Ai开源项目

OpenStock: Free Open-Source & Self-Hosted Stock Market Data PlatformIntroduction

What is OpenStock?

OpenStock is an open-source stock market tool that can be regarded as a replacement for expensive commercial platforms. It offers features such as real-time price viewing, custom alerts, and detailed company information. All services are permanently free and aimed at individual investors, students, and developers.

OpenStock

Main Features of OpenStock

  • Login system: Log in using email and password, with data saved in MongoDB, and page access protected via Next.js middleware

  • Stock search: Fast search powered by Finnhub data, showing popular stocks when idle, supporting debounced queries, with the Ctrl+K shortcut to open the search box

  • Watchlist management: Each user's watchlist stocks are saved individually in the database

  • Stock detail page: Displays TradingView charts, technical indicators, basic company information, and financial data

  • Market overview: Includes stock heatmaps, quotes, and news

  • Onboarding: Collects information such as the user's country, investment goals, and risk preferences

  • Email alerts: Automatically sends personalized welcome emails and daily news summaries

OpenStock Technology

  • Frontend: Built with Next.js 15, React 19, and TypeScript, with the interface designed using Tailwind CSS and the shadcn/ui component library

  • Data: Stock data comes from the Finnhub API, and charts use TradingView embed components

  • Backend: MongoDB stores user data, Inngest handles automated tasks, and Nodemailer sends emails

Use Cases for OpenStock

  • Personal investment research: Deploy on your own server to avoid subscription fees

  • Teaching projects: Can be used as a hands-on project for courses in finance, data visualization, and more

  • Small investment communities: Can be deployed for team members to use, making it easy to share information internally

How to Deploy OpenStock:

  • Prerequisites: Node.js 20+, pnpm or npm, a MongoDB connection string (Atlas or local), a Finnhub API key (the free tier may have delays), optional Gmail (or SMTP), and an optional Gemini API key.

  • Local development:

  • Clone and install: git clone https://github.com/Open-Dev-Society/OpenStock.git && cd OpenStock && pnpm install (or npm install)

  • Configure .env and verify the database: pnpm test:db

  • Start development: pnpm dev (or npm run dev)

  • Run Inngest locally: npx inngest-cli@latest dev

  • Visit: http://localhost:3000

  • Docker deployment:

  • Start services: docker compose up -d mongodb && docker compose up -d --build

  • Sample local MongoDB connection: MONGODB_URI=mongodb://root:example@mongodb:27017/openstock?authSource=admin

  • Visit: http://localhost:3000

  • Key environment variables (examples):

MONGODB_URI、BETTER_AUTH_SECRET、BETTER_AUTH_URL=http://localhost:3000
FINNHUB_API_KEY、FINNHUB_BASE_URL=https://finnhub.io/api/v1(可选 NEXT_PUBLIC_FINNHUB_API_KEY)
GEMINI_API_KEY(可选)
NODEMAILER_EMAIL、NODEMAILER_PASSWORD(生产建议用专用 SMTP 服务
)

Notes:

  • OpenStock is for informational display only and does not provide actual trading functionality

  • Free data sources may have delays, and relevant terms of service must be followed when using them

  • It is recommended to use a professional email service in production rather than a personal Gmail account

OpenStock is essentially a free, self-hosted stock market software. The code is fully open source and built on a modern TypeScript tech stack. It is simple to run locally and can be customized and modified as needed.

Tools related to OpenStock: Free Open-Source & Self-Hosted Stock Market Data Platform