Open-Dev-Society/OpenStock
OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone
About Open-Dev-Society/OpenStock
Open-Dev-Society/OpenStock is an open-source project on GitHub, mainly written in TypeScript. OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts It currently holds 21,379 stars and 2,662 forks with 13 open issues, and was last pushed on 2026-11-04 (repository created 2025-09-28).
Project Overview
Git Homed tracks it on the Today's Trending board, currently at rank #61 with 66 new stars today.
GitHub Repository Details
README

OpenStock
Markets, minus the paywall. OpenStock is a free, open-source alternative to expensive market platforms: track prices, watch the whole market and dig into company insights. Use it at openstock-ods.vercel.app, or run your own copy with every feature.
❤️ 13,000+ people use OpenStock for free. Help keep it that way: sponsor from $5 a month, or read how OpenStock is funded.
[!NOTE]
OpenStock is community-built and not a brokerage. Market data may be delayed depending on the provider and your setup. Nothing here is financial advice.
📋 Table of Contents
1. 🔋 Features 2. ⏱️ How fresh is the data 3. ⚙️ Tech stack 4. 🤸 Quick start 5. 🔐 Environment variables 6. 🐳 Self-hosting: Docker, prebuilt image, one-click deploys, Vercel 7. 🧱 Project structure 8. 📡 How it works 9. 🌍 Market support 10. 🧪 Scripts and tests 11. 🤝 Contributing 12. 🏆 Contributors 13. 🛡️ Security 14. 📜 License 15. 🌱 Open Dev Society manifesto 16. 🙏 Acknowledgements 17. ❤️ Sponsor OpenStock
🔋 Features
Markets
- A dashboard for eight markets: US, India, Germany, Canada, Australia, Saudi Arabia, Crypto and Forex, with an index pulse, a sector heatmap, market leaders and top stories.
- Search every exchange Finnhub covers with ⌘K, and keep stocks open as browser-style tabs.
- TradingView candles with drawing tools (trend lines, Fibonacci, shapes, text) and fullscreen.
- Pick indicators once (SMA, EMA, Bollinger Bands, VWAP, RSI, MACD, Stochastic, ATR) and they stay on every chart.
- Financials, technicals and the company profile.
- Sentiment from Reddit, X, news and Polymarket (with an Adanos key).
- A watchlist of up to 50 stocks, saved to your account.
- Price alerts above or below a target, checked every 5 minutes and emailed to you (in realtime mode).
- A weekly, AI-written news digest by email every Monday.
- Email and password, plus Google and GitHub sign-in when configured; password reset and a profile page.
- Rate-limited sign-in, sign-up and password reset; resetting your password signs out your other devices.
- A changelog that credits everyone who contributed, a Wall of love, and an update banner in the app.
⏱️ How fresh is the data
Charts always stream live from TradingView. Quotes, watchlist prices and alerts come from Finnhub:
| | Quotes | Price alerts | Cost |
|---|---|---|---|
| Community: openstock-ods.vercel.app | Every hour, shared by everyone | No | Free |
| OpenStock Cloud (coming soon) | Every 15 seconds | By email | $5 a month |
| Self-hosted | Every hour, or every 15 seconds with NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime and your own Finnhub keys | By email, in realtime mode | Free |
⚙️ Tech stack
| | | |---|---| | App | Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS v4, shadcn/ui and Radix | | Accounts and data | Better Auth, MongoDB with Mongoose | | Market data | Finnhub, TradingView widgets, Adanos (sentiment) | | Background jobs | Inngest | | Email | Nodemailer (Gmail), Kit for the newsletter | | AI | Gemini, MiniMax or Siray | | Hosting | Vercel; a Docker image on GitHub Container Registry for self-hosting |
🤸 Quick start
You need Node.js 22 LTS, a MongoDB database (a free Atlas cluster, or the Docker setup) and a free Finnhub key.
git clone https://github.com/Open-Dev-Society/OpenStock.git
cd OpenStock
npm ci
cp .env.example .env # fill in MONGODB_URI, BETTER_AUTH_SECRET and FINNHUB_API_KEY
node scripts/check-env.mjs # checks your .env
npm run test:db # checks the MongoDB connection
npm run dev # http://localhost:3000
Welcome emails, price alerts and the weekly digest run as Inngest jobs. Locally, start Inngest's dev server alongside the app: npx inngest-cli@latest dev.
For production: npm run build && npm start.
🔐 Environment variables
Every variable is listed with comments in .env.example. The ones that matter:
| Variable | Needed | What it's for |
|---|---|---|
| MONGODB_URI | Yes | Your MongoDB database |
| BETTER_AUTH_SECRET | Yes | Signs sessions. Generate it with openssl rand -hex 32. Auth refuses to run in production without it |
| BETTER_AUTH_URL | Yes | The app's public URL, used for auth callbacks and links in emails |
| FINNHUB_API_KEY | Yes | Market data. Or put several free keys, comma-separated, in FINNHUB_API_KEYS: they're rotated, and each adds 60 requests a minute |
| NEXT_PUBLIC_OPENSTOCK_DATA_MODE | No | cached (hourly, the default) or realtime (every 15 seconds, with price alerts). Fixed when the app is built: rebuild after changing it |
| INNGEST_SIGNING_KEY, INNGEST_EVENT_KEY | In production | Background jobs: welcome emails, price alerts and the weekly digest |
| NODEMAILER_EMAIL, NODEMAILER_PASSWORD | No | Sending email through Gmail, with an app password. Without them, emails are skipped |
| GEMINI_API_KEY (or MiniMax or Siray) | No | AI-written welcome emails and the news digest |
| ADANOS_API_KEY | No | The sentiment card on stock pages |
| KIT_API_KEY, KIT_API_SECRET, KIT_WELCOME_FORM_ID | No | The weekly digest newsletter in Kit |
| GOOGLE_CLIENT_ID / _SECRET, GITHUB_CLIENT_ID / _SECRET | No | Social sign-in. Callbacks: <BETTER_AUTH_URL>/api/auth/callback/google and /github |
NEXT_PUBLIC_FINNHUB_API_KEY still works as a name for the Finnhub key. No key is ever sent to the browser.
🐳 Self-hosting
Docker Compose
Runs OpenStock and MongoDB together. MongoDB is only reachable inside the Docker network; it isn't published on your machine.
1. Fill in .env (see above). For the bundled database, choose a password and use it in both places. Letters and digits are simplest; @ : / ? # must be percent-encoded in the URI.
MONGO_ROOT_PASSWORD=change-me
MONGODB_URI=mongodb://root:change-me@mongodb:27017/openstock?authSource=admin
2. Start it: docker compose up -d --build
3. Open http://localhost:3000
The image build needs no secrets: every variable is read when the container starts, except NEXT_PUBLIC_OPENSTOCK_DATA_MODE, which Compose passes to the build from .env. Data lives in the mongo-data volume, and the MongoDB password is only applied when that volume is first created.
Prebuilt image
Every push to main publishes ghcr.io/open-dev-society/openstock for amd64 and arm64, tagged latest, sha-, and a version for each release (for example 2026.10.18). To use it, replace build: under openstock in docker-compose.yml with:
image: ghcr.io/open-dev-society/openstock:latest
then run docker compose pull && docker compose up -d. The prebuilt image runs in cached mode; build it yourself for realtime.
One-click deploys
Railway
OpenStock ships a railway.json that builds the Dockerfile, checks health on /sign-in and restarts on failure. The template above sets everything up; to do it by hand:
1. Create a project and add a MongoDB database (+ New → Database → MongoDB).
2. Add a service from this repository (+ New → GitHub Repo).
3. In the service's Variables, set:
MONGODB_URI=${{MongoDB.MONGO_URL}}
BETTER_AUTH_SECRET=${{secret(32)}}
BETTER_AUTH_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
FINNHUB_API_KEY=your_finnhub_key
GEMINI_API_KEY=your_gemini_api_key
INNGEST_SIGNING_KEY=your_inngest_signing_key
INNGEST_EVENT_KEY=your_inngest_event_key
NODEMAILER_EMAIL=youraddress@gmail.com
NODEMAILER_PASSWORD=your_gmail_app_password
4. Under Settings → Networking, generate a public domain and redeploy.
For background jobs, add your Railway domain as an app in the Inngest dashboard, pointing to https:///api/inngest. To turn on realtime mode, also set NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime; Railway passes it to the build.
Vercel
Import the repository, set the variables above for Production, and connect Inngest (its Vercel integration sets both keys). vercel.json pins functions to Mumbai (bom1), next to the hosted database; change it to the region nearest yours.
🧱 Project structure
app/
(marketing)/ public pages: landing, about, help, api-docs, sponsor, love, changelog, terms, /s/[ticker], /compare
(auth)/ sign-in, sign-up, forgot-password, reset-password
(root)/ the signed-in app: dashboard, watchlist, stocks/[symbol], profile
api/ auth/[...all] (Better Auth), inngest (background jobs), quotes (live prices)
components/ shell/ (sidebar, tabs), stocks/, watchlist/, landing/, marketing/, sponsors/, forms/, ui/ (shadcn)
database/ MongoDB connection and models (watchlist, alert)
lib/
actions/ server actions: auth, profile, watchlist, alerts, Finnhub, sentiment
better-auth/ auth setup (connects to MongoDB on first use, so builds need no database)
inngest/ background jobs and AI prompts
nodemailer/ email sending and templates
markets.ts the dashboard's markets market-data.ts cached vs realtime
changelog.ts releases and contributor credits sponsors.ts sponsors and tiers
rate-limit.ts MongoDB-backed limits for auth and live quotes
middleware.ts public marketing, /s and /compare pages; app pages redirect to sign-in
scripts/ check-env.mjs, test-db.mjs, and one-off maintenance scripts
__tests__/ Vitest tests
📡 How it works
- Finnhub: search, quotes, company profiles and news. Responses are cached and shared (for an hour, or 15 seconds in realtime mode), with timeouts and a key pool, so a slow upstream never hangs a page.
- TradingView: the chart, heatmap, financials, technicals and profile widgets.
- Adanos (optional): the sentiment card.
- Better Auth with MongoDB: accounts and sessions. Pages and server actions check the session on the server; the middleware only redirects signed-out visitors.
- Inngest runs the background jobs:
- Email: Nodemailer (Gmail) sends welcome, alert and password-reset emails; Kit sends the weekly digest.
🌍 Market support
| Market | Charts (TradingView embeds) | Quotes, watchlist prices, alerts (Finnhub free) |
|---|---|---|
| 🇺🇸 United States | Live | Yes |
| Crypto (Binance pairs) | Live | Yes |
| Forex | Live | No |
| 🇨🇦 Canada, 🇦🇺 Australia | Delayed | No |
| 🇸🇦 Saudi Arabia (Tadawul) | Blocked; delayed Yahoo Finance quotes instead | No |
| 🇮🇳 India (BSE; .NS symbols chart on BSE), 🇩🇪 Germany | End of day | No |
| London, Tokyo, Hong Kong, Korea and others | Candles blocked; financials, technicals and profile work | No |
The full table, and why some markets are limited, is in MARKET_SUPPORT.md.
🧪 Scripts and tests
| Command | What it does |
|---|---|
| npm run dev | Development server (Turbopack) |
| npm run build, npm start | Production build and server |
| npm test | Vitest tests (npm run test:watch to keep watching) |
| npm run lint | ESLint |
| npx tsc --noEmit | Type check. Builds skip type errors, so run this before opening a PR |
| npm run test:db | Checks the MongoDB connection |
| node scripts/check-env.mjs | Checks your .env |
🤝 Contributing
You belong here. Whether you're a student, a self-taught dev or a seasoned engineer, contributions are welcome.
1. Pick a good first issue, or open an issue to talk about an idea or a bug first.
2. Fork the repo, branch from main, then npm ci and cp .env.example .env.
3. Keep the pull request focused: a test for new logic, a screenshot for UI changes.
4. Before you open it, run npm test, npx tsc --noEmit and npm run lint.
Every merged pull request, and every issue that leads to a fix, is credited on the changelog and below. Be kind, guide beginners, no gatekeeping: that's the Open Dev Society way. Participation is covered by the Code of Conduct.
🏆 Contributors
OpenStock is built by everyone below: the people who wrote the code and the people whose issues led to a fix. Every release, and who made it happen, is on the changelog.
@ravixalgorithm founded and maintains OpenStock, and built it from the ground up: authentication, UI design, API and AI integration, and deployment.
![]() ravixalgorithm Maintainer · 36 PRs |
![]() keshav-005 7 PRs |
![]() akoweicollinxx 2 PRs |
![]() octo-patch 2 PRs |
![]() ahmaddirar-ios 1 PR |
![]() alexander-schneider 1 PR |
![]() BambaSatoru 1 PR |
![]() Bortlesboat 1 PR |
![]() chinnsenn 1 PR |
![]() Chukwuebuka-2003 1 PR |
![]() cosark 1 PR |
![]() cosmind-rusu 1 PR |
![]() CrixusWen 1 PR |
![]() ettoreciolli 1 PR |
![]() fuxicodex 1 PR |
![]() kuishou68 1 PR |
![]() Mubashirrrr 1 PR |
![]() muskanbandta23 1 PR |
GitHub Stars & Activity21,379Stars 2,662Forks 13Open issues TypeScriptLanguage GitHub PopularityGitHub stars21,379 Forks2,662 Open issues13 Primary languageTypeScript LicenseAGPL-3.0 Stars gained today66 Created2025-09-28 Last pushed2026-11-04 Trending HistoryDaily boardrank #61 · ▲ 66 stars Related GitHub Projects1 2 3 4 5 6 7 8 More Trending Repositories
|



















