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, forever free.
docs(readme): rewrite the README for how OpenStock works today
ravixalgorithm3b06d08c2787
diff --git a/.env.example b/.env.examplenew file mode 100644index 0000000..61ac65b--- /dev/null+++ b/.env.example@@ -0,0 +1,59 @@+# Copy to .env and fill in. Check it with: node scripts/check-env.mjs+# Every variable is read at runtime except NEXT_PUBLIC_*, which Next.js fixes when the app is built.++# --- Required ---------------------------------------------------------------+# MongoDB: Atlas (mongodb+srv://...) or the Docker Compose database below+MONGODB_URI=mongodb+srv://<user>:<password>@<cluster>/openstock?retryWrites=true&w=majority+# Signs sessions. Generate with: openssl rand -hex 32 (the app refuses to run auth in production without it)+BETTER_AUTH_SECRET=+# Public URL of the app, used in auth callbacks and email links+BETTER_AUTH_URL=http://localhost:3000+# Finnhub key (free at finnhub.io). Several free keys, comma-separated, are rotated: each adds 60 requests/min+FINNHUB_API_KEY=+# FINNHUB_API_KEYS=key_one,key_two++# --- Market data ------------------------------------------------------------+# "cached" (default): quotes refresh hourly, shared by everyone. "realtime": every 15 s, with email price alerts.+# Fixed at build time: rebuild after changing it (docker compose passes it to the build).+# NEXT_PUBLIC_OPENSTOCK_DATA_MODE=cached++# Sentiment card on stock pages (Reddit, X, news, Polymarket)+# ADANOS_API_KEY=+# ADANOS_API_BASE_URL=https://api.adanos.org++# --- Background jobs (Inngest) ---------------------------------------------+# Locally run `npx inngest-cli@latest dev` instead. In production both are required, or no welcome emails,+# price alerts or weekly digest are sent.+# INNGEST_SIGNING_KEY=+# INNGEST_EVENT_KEY=++# --- AI (personalised welcome email and news digest) -----------------------+# Provider: gemini (default), minimax or siray. A configured provider is also used as a fallback.+# AI_PROVIDER=gemini+# GEMINI_API_KEY=+# GEMINI_MODEL=gemini-2.5-flash-lite+# MINIMAX_API_KEY=+# MINIMAX_MODEL=MiniMax-M3+# MINIMAX_BASE_URL=https://api.minimax.io/v1+# SIRAY_API_KEY=++# --- Email -------------------------------------------------------------------+# Gmail address + app password (myaccount.google.com → Security → App passwords). Without them, emails are skipped.+# NODEMAILER_EMAIL=+# NODEMAILER_PASSWORD=+# Kit (ConvertKit): the weekly news digest broadcast and the welcome form+# KIT_API_KEY=+# KIT_API_SECRET=+# KIT_WELCOME_FORM_ID=++# --- Social sign-in -----------------------------------------------------------+# Each provider turns on only when its ID is set. Callbacks: <BETTER_AUTH_URL>/api/auth/callback/google and /github+# GOOGLE_CLIENT_ID=+# GOOGLE_CLIENT_SECRET=+# GITHUB_CLIENT_ID=+# GITHUB_CLIENT_SECRET=++# --- Docker Compose only ------------------------------------------------------+# Root password for the bundled MongoDB; use the same one in MONGODB_URI, e.g.+# MONGODB_URI=mongodb://root:<password>@mongodb:27017/openstock?authSource=admin+# MONGO_ROOT_PASSWORD=diff --git a/.gitignore b/.gitignoreindex 5ef6a52..7b8da95 100644--- a/.gitignore+++ b/.gitignore@@ -32,6 +32,7 @@ yarn-error.log*# env files (can opt-in for committing if needed).env*+!.env.example# vercel.verceldiff --git a/README.md b/README.mdindex 357310e..6fb9762 100644--- a/README.md+++ b/README.md@@ -25,549 +25,366 @@</p><div align="center"><br />- <a href="#" target="_blank">- <img src="./public/assets/images/dashboard.png" alt="Project Banner" />- </a>- © Open Dev Society. This project is licensed under AGPL-3.0; if you modify, redistribute, or deploy it (including as a web service), you must release your source code under the same license and credit the original authors.+ <a href="https://openstock-ods.vercel.app"><img src="./public/assets/images/dashboard.png" alt="OpenStock: the landing page with the market hours dial, index pulse and live charts" /></a>+ <br />+ <br />++ **[Open OpenStock](https://openstock-ods.vercel.app)** · [Changelog](https://openstock-ods.vercel.app/changelog) · [Self-host it](#self-hosting) · [Sponsor](#sponsors) · [Discord](https://discord.gg/JkJ8kfxgxB)+<br />- <br/><div><img src="https://img.shields.io/badge/-Next.js-black?style=for-the-badge&logoColor=white&logo=next.js&color=000000" alt="Next.js badge" /><img src="https://img.shields.io/badge/-TypeScript-black?style=for-the-badge&logoColor=white&logo=typescript&color=3178C6"/><img src="https://img.shields.io/badge/-Tailwind%20CSS-black?style=for-the-badge&logoColor=white&logo=tailwindcss&color=38B2AC"/><img src="https://img.shields.io/badge/-shadcn/ui-black?style=for-the-badge&logoColor=white&logo=shadcnui&color=000000"/>- <img src="https://img.shields.io/badge/-Radix%20UI-black?style=for-the-badge&logoColor=white&logo=radixui&color=000000"/><img src="https://img.shields.io/badge/-Better%20Auth-black?style=for-the-badge&logoColor=white&logo=betterauth&color=000000"/><img src="https://img.shields.io/badge/-MongoDB-black?style=for-the-badge&logoColor=white&logo=mongodb&color=00A35C"/><img src="https://img.shields.io/badge/-Inngest-black?style=for-the-badge&logoColor=white&logo=inngest&color=000000"/>- <img src="https://img.shields.io/badge/-Nodemailer-black?style=for-the-badge&logoColor=white&logo=gmail&color=EA4335"/><img src="https://img.shields.io/badge/-TradingView-black?style=for-the-badge&logoColor=white&logo=tradingview&color=2962FF"/><img src="https://img.shields.io/badge/-Finnhub-black?style=for-the-badge&logoColor=white&color=30B27A"/>- <img src="https://img.shields.io/badge/-CodeRabbit-black?style=for-the-badge&logoColor=white&logo=coderabbit&color=9146FF"/>+ <img src="https://img.shields.io/badge/-Docker-black?style=for-the-badge&logoColor=white&logo=docker&color=2496ED"/></div></div># OpenStock-OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, watch the whole market, and explore detailed company insights — built openly, for everyone, forever free.+**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](https://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](https://github.com/sponsors/ravixalgorithm/sponsorships?frequency=recurring&amount=5), or read [how OpenStock is funded](#sponsors).-Note: OpenStock is community-built and not a brokerage. Market data may be delayed based on provider rules and your configuration. Nothing here is financial advice.+> [!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. ✨ [Introduction](#introduction)-2. 🌍 [Open Dev Society Manifesto](#manifesto)-3. ⚙️ [Tech Stack](#tech-stack)-4. 🔋 [Features](#features)-5. 🤸 [Quick Start](#quick-start)-6. 🐳 [Docker Setup](#docker-setup)-7. 🚂 [Deploy on Railway](#deploy-on-railway)-8. 🔐 [Environment Variables](#environment-variables)-9. 🧱 [Project Structure](#project-structure)-10. 📡 [Data & Integrations](#data--integrations)-11. 🌍 [Market Support](#market-support)-12. 🧪 [Scripts & Tooling](#scripts--tooling)-13. 🤝 [Contributing](#contributing)-14. 🛡️ [Security](#security)-15. 📜 [License](#license)+1. 🔋 [Features](#features)+2. ⏱️ [How fresh is the data](#data-freshness)+3. ⚙️ [Tech stack](#tech-stack)+4. 🤸 [Quick start](#quick-start)+5. 🔐 [Environment variables](#environment-variables)+6. 🐳 [Self-hosting](#self-hosting): Docker, prebuilt image, one-click deploys, Vercel+7. 🧱 [Project structure](#project-structure)+8. 📡 [How it works](#data--integrations)+9. 🌍 [Market support](#market-support)+10. 🧪 [Scripts and tests](#scripts--tooling)+11. 🤝 [Contributing](#contributing)+12. 🏆 [Contributors](#contributors)+13. 🛡️ [Security](#security)+14. 📜 [License](#license)+15. 🌱 [Open Dev Society manifesto](#manifesto)16. 🙏 [Acknowledgements](#acknowledgements)17. ❤️ [Sponsor OpenStock](#sponsors)-## ✨ Introduction <a name="introduction"></a>+## 🔋 Features <a name="features"></a>-OpenStock is a modern stock market app powered by Next.js (App Router), shadcn/ui and Tailwind CSS, Better Auth for authentication, MongoDB for persistence, Finnhub for market data, and TradingView widgets for charts and market views.+**Markets**+- A dashboard for seven markets: US, India, Germany, Canada, Australia, 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.-## 🌍 Open Dev Society Manifesto <a name="manifesto"></a>+**Stock pages**+- 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).-We live in a world where knowledge is hidden behind paywalls. Where tools are locked in subscriptions. Where information is twisted by bias. Where newcomers are told they’re not “good enough” to build.+**Watchlist and alerts**+- 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.-We believe there’s a better way.+**Accounts**+- 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.-- Our Belief: Technology should belong to everyone. Knowledge should be open, free, and accessible. Communities should welcome newcomers with trust, not gatekeeping.-- Our Mission: Build free, open-source projects that make a real difference:- - Tools that professionals and students can use without barriers.- - Knowledge platforms where learning is free, forever.- - Communities where every beginner is guided, not judged.- - Resources that run on trust, not profit.-- Our Promise: We will never lock knowledge. We will never charge for access. We will never trade trust for money. We run on transparency, donations, and the strength of our community.-- Our Call: If you’ve ever felt you didn’t belong, struggled to find free resources, or wanted to build something meaningful — you belong here.+**Community**+- A [changelog](https://openstock-ods.vercel.app/changelog) that credits everyone who contributed, a [Wall of love](https://openstock-ods.vercel.app/love), and an update banner in the app.-Because the future belongs to those who build it openly.+## ⏱️ How fresh is the data <a name="data-freshness"></a>-## ⚙️ Tech Stack <a name="tech-stack"></a>+Charts always stream live from TradingView. Quotes, watchlist prices and alerts come from Finnhub:-Core-- Next.js 15 (App Router), React 19-- TypeScript-- Tailwind CSS v4 (via @tailwindcss/postcss)-- shadcn/ui + Radix UI primitives-- Lucide icons+| | Quotes | Price alerts | Cost |+|---|---|---|---|+| **Community**: [openstock-ods.vercel.app](https://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 |-Auth & Data-- Better Auth (email/password) with MongoDB adapter-- MongoDB + Mongoose-- Finnhub API for symbols, profiles, and market news-- TradingView embeddable widgets+## ⚙️ Tech stack <a name="tech-stack"></a>-Automation & Comms-- Inngest (events, cron, AI inference via Gemini)-- Nodemailer (Gmail transport)-- next-themes, cmdk (command palette), react-hook-form+| | |+|---|---|+| 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 |-Language composition-- TypeScript (~93.4%), CSS (~6%), JavaScript (~0.6%)+## 🤸 Quick start <a name="quick-start"></a>-## 🔋 Features <a name="features"></a>+You need Node.js 22 LTS, a MongoDB database (a free Atlas cluster, or the [Docker setup](#docker-setup)) and a free [Finnhub](https://finnhub.io) key.-- Authentication- - Email/password auth with Better Auth + MongoDB adapter- - Protected routes enforced via Next.js middleware-- Global search and Command + K palette- - Fast stock search backed by Finnhub- - Popular stocks when idle; debounced querying-- Watchlist- - Per-user watchlist stored in MongoDB (unique symbol per user)-- Stock details- - TradingView symbol info, candlestick/advanced charts, baseline, technicals- - Company profile and financials widgets- - Optional cross-source sentiment insights for Reddit, X.com, news, and Polymarket-- Market overview- - Heatmap, quotes, and top stories (TradingView widgets)-- Personalized onboarding- - Collects country, investment goals, risk tolerance, preferred industry-- Email & automation- - AI-personalized welcome email (Gemini via Inngest)- - Weekly news summary email (cron) sent as a Kit broadcast-- Polished UI- - shadcn/ui components, Radix primitives, Tailwind v4 design tokens- - Dark theme by default-- Keyboard shortcut- - Cmd/Ctrl + K for quick actions/search--## 🤸 Quick Start <a name="quick-start"></a>--Prerequisites-- Node.js 20+ and pnpm or npm-- MongoDB connection string (MongoDB Atlas or local via Docker Compose)-- Finnhub API key (free tier supported; real-time may require paid)-- Optional: Gmail account for email (or update Nodemailer transport) if you want welcome and news summary emails-- Optional: Google Gemini API key (for AI-generated welcome intros)--Clone and install```bashgit clone https://github.com/Open-Dev-Society/OpenStock.gitcd OpenStock--# choose one:-pnpm install-# or-npm install+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```-Configure environment-- Create a `.env` file (see [Environment Variables](#environment-variables)).-- Verify DB connectivity:-```bash-pnpm test:db-# or-npm run test:db-```+Welcome emails, price alerts and the weekly digest run as [Inngest](https://www.inngest.com) jobs. Locally, start Inngest's dev server alongside the app: `npx inngest-cli@latest dev`.-Run development-```bash-# Next.js dev (Turbopack)-pnpm dev-# or-npm run dev-```+For production: `npm run build && npm start`.-Run Inngest locally (workflows, cron, AI)-```bash-npx inngest-cli@latest dev-```+## 🔐 Environment variables <a name="environment-variables"></a>-Build & start (production)-```bash-pnpm build && pnpm start-# or-npm run build && npm start-```+Every variable is listed with comments in [`.env.example`](.env.example). The ones that matter:-Open http://localhost:3000 to view the app.+| 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` |-## 🐳 Docker Setup <a name="docker-setup"></a>+`NEXT_PUBLIC_FINNHUB_API_KEY` still works as a name for the Finnhub key. No key is ever sent to the browser.-You can run OpenStock and MongoDB easily with Docker Compose.+## 🐳 Self-hosting <a name="self-hosting"></a>-1) Ensure Docker and Docker Compose are installed.+### Docker Compose <a name="docker-setup"></a>-2) docker-compose.yml includes two services:-- openstock (this app)-- mongodb (MongoDB database with a persistent volume)+Runs OpenStock and MongoDB together. MongoDB is only reachable inside the Docker network; it isn't published on your machine.-3) Create your `.env` (see examples below). For the Docker setup, pick a MongoDB password and use it in both places (letters and digits are simplest; `@ : / ? #` must be percent-encoded inside `MONGODB_URI`):-```env-MONGO_ROOT_PASSWORD=change-me-MONGODB_URI=mongodb://root:change-me@mongodb:27017/openstock?authSource=admin-```+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.+ ```env+ 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-4) Start the stack:-```bash-# from the repository root-docker compose up -d --build-```+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-5) Access the app:-- App: http://localhost:3000-- MongoDB is only reachable inside the Docker network, at host mongodb:27017. It isn't published on your machine.+Every push to `main` publishes `ghcr.io/open-dev-society/openstock` for amd64 and arm64, tagged `latest`, `sha-<commit>`, and a version for each release (for example `2026.10.18`). To use it, replace `build:` under `openstock` in `docker-compose.yml` with:-Prefer not to build? Every push to `main` publishes a prebuilt image (amd64 and arm64) to GitHub Container Registry. In `docker-compose.yml`, replace `build: context: .` under `openstock` with:```yamlimage: ghcr.io/open-dev-society/openstock:latest```-then run `docker compose pull && docker compose up -d`. Tags: `latest` (main), `sha-<commit>`, and `x.y.z` for releases. The image contains no secrets; all configuration comes from your `.env` at runtime.--Notes-- The app service depends_on the mongodb service.-- The MongoDB root password comes from `MONGO_ROOT_PASSWORD` (default `example`, only applied when the volume is first created); authSource=admin is required on the connection string for root.-- The image build needs no `.env`: every variable is read when the container starts.-- Data persists across restarts via the docker volume.-- `NODEMAILER_EMAIL` and `NODEMAILER_PASSWORD` are optional for local Docker runs. If they are omitted, the app still starts but email features stay disabled.-Optional: Example MongoDB service definition used in this project:-```yaml-services:- mongodb:- image: mongo:7- container_name: mongodb- restart: unless-stopped- environment:- MONGO_INITDB_ROOT_USERNAME: root- MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-example}- volumes:- - mongo-data:/data/db- healthcheck:- test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]- interval: 10s- timeout: 5s- retries: 5--volumes:- mongo-data:-```+then run `docker compose pull && docker compose up -d`. The prebuilt image runs in cached mode; build it yourself for realtime.-## ☁️ One-Click Deploy+### One-click deploys[](https://repocloud.io/details/OpenStock/)-[](https://zop.dev/zopday/app/deploy?repo=https://github.com/Open-Dev-Society/OpenStock&port=3000&name=openstock&utm_source=github&utm_medium=one_click&utm_content=openstock)--## 🚂 Deploy on Railway <a name="deploy-on-railway"></a>-[](https://railway.com/deploy/openstock-1?utm_medium=integration&utm_source=template&utm_campaign=generic)-The one-click template provisions OpenStock and a MongoDB database and prompts for your API keys. To set it up manually instead:+### Railway <a name="deploy-on-railway"></a>-OpenStock ships with a [`railway.json`](railway.json) so it can be deployed on [Railway](https://railway.com) using the existing `Dockerfile`, with a healthcheck on `/sign-in` and automatic restarts on failure.+OpenStock ships a [`railway.json`](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 new project on Railway and add a **MongoDB** database (`+ New → Database → MongoDB`).-2) Add a service from this GitHub repository (`+ New → GitHub Repo`). Railway detects `railway.json` and builds with the `Dockerfile`.-3) In the service **Variables**, set:+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:+ ```env+ 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_PASSWORD=your_gmail_app_password+ ```+4. Under **Settings → Networking**, generate a public domain and redeploy.-```env-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-NODEMAILER_PASSWORD=your_gmail_app_password-```+For background jobs, add your Railway domain as an app in the [Inngest dashboard](https://app.inngest.com), pointing to `https://<your-domain>/api/inngest`. To turn on realtime mode, also set `NEXT_PUBLIC_OPENSTOCK_DATA_MODE=realtime`; Railway passes it to the build.-4) Under **Settings → Networking**, generate a public domain, then redeploy.--Notes-- All variables are read when the container starts; nothing is passed to the Docker build, so no key ends up in the image. `NEXT_PUBLIC_FINNHUB_API_KEY` still works as a fallback name.-- The build needs no database or secrets, so the private `MONGO_URL` works and the MongoDB TCP proxy can stay off.-- For scheduled jobs (news summaries, alerts), add your Railway domain as an app in the [Inngest dashboard](https://app.inngest.com) pointing to `https://<your-domain>/api/inngest`.-- See [Environment Variables](#environment-variables) for the optional variables (Adanos, MiniMax, Kit, etc.).--## 🔐 Environment Variables <a name="environment-variables"></a>--Create `.env` at the project root. Choose either a hosted MongoDB (Atlas) URI or the local Docker URI.--Hosted (MongoDB Atlas):-```env-# Core-NODE_ENV=development--# Database (Atlas)-MONGODB_URI=mongodb+srv://<user>:<pass>@<cluster>/<db>?retryWrites=true&w=majority--# Better Auth-BETTER_AUTH_SECRET=your_better_auth_secret-BETTER_AUTH_URL=http://localhost:3000--# Finnhub-# Note: NEXT_PUBLIC_FINNHUB_API_KEY is required for Vercel deployment-NEXT_PUBLIC_FINNHUB_API_KEY=your_finnhub_key-FINNHUB_BASE_URL=https://finnhub.io/api/v1--# Sentiment insights (optional)-ADANOS_API_KEY=your_adanos_api_key-# ADANOS_API_BASE_URL=https://api.adanos.org--# AI Provider (optional, default: "gemini")-# Supported: "gemini", "minimax", "siray"-# AI_PROVIDER=gemini--# Gemini-GEMINI_API_KEY=your_gemini_api_key--# MiniMax (optional, used when AI_PROVIDER=minimax or as fallback)-# Get your key at https://platform.minimaxi.com-# MINIMAX_API_KEY=your_minimax_api_key--# Inngest Signing Key (required for Vercel deployment)-# Get this from your Inngest dashboard: https://app.inngest.com/env/settings/keys-INNGEST_SIGNING_KEY=your_inngest_signing_key-# Required in production so sign-up can send the welcome-email event-INNGEST_EVENT_KEY=your_inngest_event_key--# Market data (optional)-# Several free Finnhub keys, rotated per request: each adds 60 requests/min.-# FINNHUB_API_KEYS=key_one,key_two-# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s-# and turns on email price alerts (an OpenStock Cloud feature).-# NEXT_PUBLIC_OPENSTOCK_DATA_MODE=cached--# Social sign-in (optional; each provider is hidden server-side until set)-# Callback URLs: <BETTER_AUTH_URL>/api/auth/callback/google and /api/auth/callback/github-# Leave these commented out until you have real credentials: any value turns the provider on-# GOOGLE_CLIENT_ID=your_google_client_id-# GOOGLE_CLIENT_SECRET=your_google_client_secret-# GITHUB_CLIENT_ID=your_github_client_id-# GITHUB_CLIENT_SECRET=your_github_client_secret--# Email (optional; Nodemailer via Gmail, consider App Passwords if 2FA)-# NODEMAILER_PASSWORD=your_gmail_app_password-```+### Vercel-Local (Docker Compose) MongoDB:-```env-# Core-NODE_ENV=development--# Database (Docker)-MONGODB_URI=mongodb://root:example@mongodb:27017/openstock?authSource=admin--# Better Auth-BETTER_AUTH_SECRET=your_better_auth_secret-BETTER_AUTH_URL=http://localhost:3000--# Finnhub-# Note: NEXT_PUBLIC_FINNHUB_API_KEY is required for Vercel deployment-NEXT_PUBLIC_FINNHUB_API_KEY=your_finnhub_key-FINNHUB_BASE_URL=https://finnhub.io/api/v1--# Sentiment insights (optional)-ADANOS_API_KEY=your_adanos_api_key-# ADANOS_API_BASE_URL=https://api.adanos.org--# AI Provider (optional, default: "gemini")-# Supported: "gemini", "minimax", "siray"-# AI_PROVIDER=gemini--# Gemini-GEMINI_API_KEY=your_gemini_api_key--# MiniMax (optional, used when AI_PROVIDER=minimax or as fallback)-# Get your key at https://platform.minimaxi.com-# MINIMAX_API_KEY=your_minimax_api_key--# Inngest Signing Key (required for Vercel deployment)-# Get this from your Inngest dashboard: https://app.inngest.com/env/settings/keys-INNGEST_SIGNING_KEY=your_inngest_signing_key-# Required in production so sign-up can send the welcome-email event-INNGEST_EVENT_KEY=your_inngest_event_key--# Market data (optional)-# Several free Finnhub keys, rotated per request: each adds 60 requests/min.-# FINNHUB_API_KEYS=key_one,key_two-# "cached" (default) refreshes quotes hourly for everyone; "realtime" refreshes every 15s-# and turns on email price alerts (an OpenStock Cloud feature).-# NEXT_PUBLIC_OPENSTOCK_DATA_MODE=cached--# Social sign-in (optional; each provider is hidden server-side until set)-# Callback URLs: <BETTER_AUTH_URL>/api/auth/callback/google and /api/auth/callback/github-# Leave these commented out until you have real credentials: any value turns the provider on-# GOOGLE_CLIENT_ID=your_google_client_id-# GOOGLE_CLIENT_SECRET=your_google_client_secret-# GITHUB_CLIENT_ID=your_github_client_id-# GITHUB_CLIENT_SECRET=your_github_client_secret--# Email (optional; Nodemailer via Gmail, consider App Passwords if 2FA)-# NODEMAILER_PASSWORD=your_gmail_app_password-```--Notes-- Keep private keys server-side whenever possible.-- If using `NEXT_PUBLIC_` variables, remember they are exposed to the browser.-- In production, prefer a dedicated SMTP provider over a personal Gmail.-- If the Nodemailer credentials are omitted, the app still runs but welcome and news summary emails are disabled.-- Do not hardcode secrets in the Dockerfile; use `.env` and Compose.+Import the repository, set the variables above for Production, and connect Inngest (its Vercel integration sets both keys). [`vercel.json`](vercel.json) pins functions to Mumbai (`bom1`), next to the hosted database; change it to the region nearest yours.-## 🧱 Project Structure <a name="project-structure"></a>+## 🧱 Project structure <a name="project-structure"></a>```app/- (auth)/- layout.tsx- sign-in/page.tsx- sign-up/page.tsx- (root)/- layout.tsx- page.tsx- help/page.tsx- stocks/[symbol]/page.tsx- api/inngest/route.ts- globals.css- layout.tsx-components/- ui/… # shadcn/radix primitives (button, dialog, command, input, etc.)- forms/… # InputField, SelectField, CountrySelectField, FooterLink- Header.tsx, Footer.tsx, SearchCommand.tsx, WatchlistButton.tsx, …-database/- models/watchlist.model.ts- mongoose.ts+ (marketing)/ public pages: landing, about, help, api-docs, sponsor, love, changelog, terms+ (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, finnhub, user, watchlist)- better-auth/…- inngest/… # client, functions, prompts- nodemailer/… # transporter, email templates- constants.ts, utils.ts-scripts/- test-db.mjs-types/- global.d.ts-next.config.ts # i.ibb.co image domain allowlist-postcss.config.mjs # Tailwind v4 postcss setup-components.json # shadcn config-public/assets/images/ # logos and screenshots+ 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 sends signed-out visitors from app pages to sign-in+scripts/ check-env.mjs, test-db.mjs, and one-off maintenance scripts+__tests__/ Vitest tests```-## 📡 Data & Integrations <a name="data--integrations"></a>--- Finnhub- - Stock search, company profiles, and market news.- - Set `NEXT_PUBLIC_FINNHUB_API_KEY` and `FINNHUB_BASE_URL` (default: https://finnhub.io/api/v1).- - Free tiers may return delayed quotes; respect rate limits and terms.--- Adanos sentiment insights (optional)- - Structured stock sentiment snapshots across Reddit, X.com, news, and Polymarket.- - Set `ADANOS_API_KEY`; optionally override the API host with `ADANOS_API_BASE_URL`.- - Used only for the stock detail sentiment card and does not replace Finnhub or TradingView.--- TradingView- - Embeddable widgets used for charts, heatmap, quotes, and timelines.- - External images from `i.ibb.co` are allowlisted in `next.config.ts`.--- Better Auth + MongoDB- - Email/password with MongoDB adapter.- - Session validation via middleware; most routes are protected, with public exceptions for `sign-in`, `sign-up`, assets and Next internals.--- Inngest- - Workflows:- - `app/user.created` → AI-personalized Welcome Email- - Cron `0 9 * * 1` → Weekly News Summary (every Monday at 9 AM, Kit broadcast)- - Local dev: `npx inngest-cli@latest dev`.--- Email (Nodemailer)- - Gmail transport. Update credentials or switch to your SMTP provider.- - Templates for welcome and news summary emails.---## 🌍 Market Support <a name="market-support"></a>+## 📡 How it works <a name="data--integrations"></a>-OpenStock supports **30+ international stock exchanges** including NSE, LSE, TSX, and more. However, please be aware of important limitations based on our data providers.+- **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:-**Quick Facts**:-- ✅ Finnhub supports most global exchanges-- ⚠️ TradingView free tier has restrictions on emerging markets (India NSE, Vietnam, etc.)-- 📊 Real-time data for non-US stocks is delayed by 15+ minutes on free tier+ | Job | When |+ |---|---|+ | AI-personalised welcome email | On sign-up |+ | Price alert check | Every 5 minutes, in realtime mode |+ | Weekly news digest (a Kit broadcast) | Mondays at 09:00 UTC |-**See [MARKET_SUPPORT.md](./MARKET_SUPPORT.md) for**:-- Complete list of supported exchanges-- Known limitations and workarounds-- Why "This symbol is only available on TradingView" appears-- How to upgrade for broader market coverage-- Future improvements planned+- **Email**: Nodemailer (Gmail) sends welcome, alert and password-reset emails; Kit sends the weekly digest.-For the latest supported symbols and exchanges, see [Finnhub's exchange list](https://finnhub.io/docs/api/symbol-lookup).+## 🌍 Market support <a name="market-support"></a>--## 🧪 Scripts & Tooling <a name="scripts--tooling"></a>--Package scripts-- `dev`: Next.js dev server with Turbopack-- `build`: Production build (Turbopack)-- `start`: Run production server-- `lint`: ESLint-- `test:db`: Validate DB connectivity--Developer experience-- TypeScript strict mode-- Tailwind CSS v4 (no separate tailwind.config needed)-- shadcn/ui components with Radix primitives-- cmdk command palette, next-themes, lucide-react icons+| 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 |+| 🇮🇳 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](MARKET_SUPPORT.md).++## 🧪 Scripts and tests <a name="scripts--tooling"></a>++| 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 <a name="contributing"></a>-You belong here. Whether you’re a student, a self-taught dev, or a seasoned engineer — contributions are welcome.--- Open an issue to discuss ideas and bugs-- Look for “good first issue” or “help wanted”-- Keep PRs focused; add screenshots for UI changes-- Be kind, guide beginners, no gatekeeping — that’s the ODS way+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](https://github.com/Open-Dev-Society/OpenStock/issues?q=is%3Aopen+label%3A%22good+first+issue%22), 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](https://openstock-ods.vercel.app/changelog) and below. Be kind, guide beginners, no gatekeeping: that's the Open Dev Society way.++## 🏆 Contributors <a name="contributors"></a>++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](https://openstock-ods.vercel.app/changelog#contributors).++[@ravixalgorithm](https://github.com/ravixalgorithm) founded and maintains OpenStock, and built it from the ground up: authentication, UI design, API and AI integration, and deployment.++<!-- Generated from the credits in lib/changelog.ts: update both together. -->+<table>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/ravixalgorithm"><img src="https://github.com/ravixalgorithm.png?size=96" width="56" height="56" alt="ravixalgorithm"/><br/><sub><b>ravixalgorithm</b></sub></a><br/><sub>Maintainer · 36 PRs</sub></td>+ <td align="center" width="16%"><a href="https://github.com/keshav-005"><img src="https://github.com/keshav-005.png?size=96" width="56" height="56" alt="keshav-005"/><br/><sub><b>keshav-005</b></sub></a><br/><sub>7 PRs</sub></td>+ <td align="center" width="16%"><a href="https://github.com/akoweicollinxx"><img src="https://github.com/akoweicollinxx.png?size=96" width="56" height="56" alt="akoweicollinxx"/><br/><sub><b>akoweicollinxx</b></sub></a><br/><sub>2 PRs</sub></td>+ <td align="center" width="16%"><a href="https://github.com/octo-patch"><img src="https://github.com/octo-patch.png?size=96" width="56" height="56" alt="octo-patch"/><br/><sub><b>octo-patch</b></sub></a><br/><sub>2 PRs</sub></td>+ <td align="center" width="16%"><a href="https://github.com/alexander-schneider"><img src="https://github.com/alexander-schneider.png?size=96" width="56" height="56" alt="alexander-schneider"/><br/><sub><b>alexander-schneider</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/BambaSatoru"><img src="https://github.com/BambaSatoru.png?size=96" width="56" height="56" alt="BambaSatoru"/><br/><sub><b>BambaSatoru</b></sub></a><br/><sub>1 PR</sub></td>+ </tr>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/Bortlesboat"><img src="https://github.com/Bortlesboat.png?size=96" width="56" height="56" alt="Bortlesboat"/><br/><sub><b>Bortlesboat</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/chinnsenn"><img src="https://github.com/chinnsenn.png?size=96" width="56" height="56" alt="chinnsenn"/><br/><sub><b>chinnsenn</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/Chukwuebuka-2003"><img src="https://github.com/Chukwuebuka-2003.png?size=96" width="56" height="56" alt="Chukwuebuka-2003"/><br/><sub><b>Chukwuebuka-2003</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/cosark"><img src="https://github.com/cosark.png?size=96" width="56" height="56" alt="cosark"/><br/><sub><b>cosark</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/cosmind-rusu"><img src="https://github.com/cosmind-rusu.png?size=96" width="56" height="56" alt="cosmind-rusu"/><br/><sub><b>cosmind-rusu</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/CrixusWen"><img src="https://github.com/CrixusWen.png?size=96" width="56" height="56" alt="CrixusWen"/><br/><sub><b>CrixusWen</b></sub></a><br/><sub>1 PR</sub></td>+ </tr>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/ettoreciolli"><img src="https://github.com/ettoreciolli.png?size=96" width="56" height="56" alt="ettoreciolli"/><br/><sub><b>ettoreciolli</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/fuxicodex"><img src="https://github.com/fuxicodex.png?size=96" width="56" height="56" alt="fuxicodex"/><br/><sub><b>fuxicodex</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/kuishou68"><img src="https://github.com/kuishou68.png?size=96" width="56" height="56" alt="kuishou68"/><br/><sub><b>kuishou68</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/Mubashirrrr"><img src="https://github.com/Mubashirrrr.png?size=96" width="56" height="56" alt="Mubashirrrr"/><br/><sub><b>Mubashirrrr</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/muskanbandta23"><img src="https://github.com/muskanbandta23.png?size=96" width="56" height="56" alt="muskanbandta23"/><br/><sub><b>muskanbandta23</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/nb-src"><img src="https://github.com/nb-src.png?size=96" width="56" height="56" alt="nb-src"/><br/><sub><b>nb-src</b></sub></a><br/><sub>1 PR</sub></td>+ </tr>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/NicolasBohn"><img src="https://github.com/NicolasBohn.png?size=96" width="56" height="56" alt="NicolasBohn"/><br/><sub><b>NicolasBohn</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/TPTBusiness"><img src="https://github.com/TPTBusiness.png?size=96" width="56" height="56" alt="TPTBusiness"/><br/><sub><b>TPTBusiness</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/Yi-111-a"><img src="https://github.com/Yi-111-a.png?size=96" width="56" height="56" alt="Yi-111-a"/><br/><sub><b>Yi-111-a</b></sub></a><br/><sub>1 PR</sub></td>+ <td align="center" width="16%"><a href="https://github.com/nexitpl"><img src="https://github.com/nexitpl.png?size=96" width="56" height="56" alt="nexitpl"/><br/><sub><b>nexitpl</b></sub></a><br/><sub>6 issues</sub></td>+ <td align="center" width="16%"><a href="https://github.com/a-lacruz"><img src="https://github.com/a-lacruz.png?size=96" width="56" height="56" alt="a-lacruz"/><br/><sub><b>a-lacruz</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/aaronwork1205"><img src="https://github.com/aaronwork1205.png?size=96" width="56" height="56" alt="aaronwork1205"/><br/><sub><b>aaronwork1205</b></sub></a><br/><sub>1 issue</sub></td>+ </tr>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/brainistry10"><img src="https://github.com/brainistry10.png?size=96" width="56" height="56" alt="brainistry10"/><br/><sub><b>brainistry10</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/cn-zeus-jp"><img src="https://github.com/cn-zeus-jp.png?size=96" width="56" height="56" alt="cn-zeus-jp"/><br/><sub><b>cn-zeus-jp</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/danieldanielecki"><img src="https://github.com/danieldanielecki.png?size=96" width="56" height="56" alt="danieldanielecki"/><br/><sub><b>danieldanielecki</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/Greatz08"><img src="https://github.com/Greatz08.png?size=96" width="56" height="56" alt="Greatz08"/><br/><sub><b>Greatz08</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/juipeter-pixel"><img src="https://github.com/juipeter-pixel.png?size=96" width="56" height="56" alt="juipeter-pixel"/><br/><sub><b>juipeter-pixel</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/k2alzhang"><img src="https://github.com/k2alzhang.png?size=96" width="56" height="56" alt="k2alzhang"/><br/><sub><b>k2alzhang</b></sub></a><br/><sub>1 issue</sub></td>+ </tr>+ <tr>+ <td align="center" width="16%"><a href="https://github.com/khajaG321"><img src="https://github.com/khajaG321.png?size=96" width="56" height="56" alt="khajaG321"/><br/><sub><b>khajaG321</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/maplelaef0320"><img src="https://github.com/maplelaef0320.png?size=96" width="56" height="56" alt="maplelaef0320"/><br/><sub><b>maplelaef0320</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/maxsyst"><img src="https://github.com/maxsyst.png?size=96" width="56" height="56" alt="maxsyst"/><br/><sub><b>maxsyst</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/saschabrockel"><img src="https://github.com/saschabrockel.png?size=96" width="56" height="56" alt="saschabrockel"/><br/><sub><b>saschabrockel</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/soonfatt"><img src="https://github.com/soonfatt.png?size=96" width="56" height="56" alt="soonfatt"/><br/><sub><b>soonfatt</b></sub></a><br/><sub>1 issue</sub></td>+ <td align="center" width="16%"><a href="https://github.com/Terry0930"><img src="https://github.com/Terry0930.png?size=96" width="56" height="56" alt="Terry0930"/><br/><sub><b>Terry0930</b></sub></a><br/><sub>1 issue</sub></td>+ </tr>+</table>++Also thanks to **Priyanshuu00007**, who designed the OpenStock logo and visual identity, and **koevoet1221**, who fixed the MongoDB Docker build. Their GitHub accounts are no longer available, so they aren't linked above.++Want to be here? Pick a [good first issue](https://github.com/Open-Dev-Society/OpenStock/issues?q=is%3Aopen+label%3A%22good+first+issue%22) or report a bug you hit.## 🛡️ Security <a name="security"></a>-If you discover a vulnerability:-- Do not open a public issue-- Email: <a href="mailto:[email protected]">[email protected]</a>-- We'll coordinate responsible disclosure and patch swiftly+Found a vulnerability? Please don't open a public issue. [Report it privately on GitHub](https://github.com/Open-Dev-Society/OpenStock/security/advisories/new); we'll work on a fix with you and credit you.## 📜 License <a name="license"></a>-OpenStock is and will remain free and open for everyone. This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.+OpenStock is and will remain free and open for everyone. It's licensed under [AGPL-3.0](LICENSE): if you modify, redistribute or deploy it (including as a web service), you must release your source code under the same license and credit the original authors.-## 🙏 Acknowledgements <a name="acknowledgements"></a>+## 🌱 Open Dev Society manifesto <a name="manifesto"></a>-- Finnhub for accessible market data-- TradingView for embeddable market widgets-- shadcn/ui, Radix UI, Tailwind CSS, Next.js community-- Inngest for dependable background jobs and workflows-- Better Auth for simple and secure authentication-- All contributors who make open tools possible+We live in a world where knowledge is hidden behind paywalls. Where tools are locked in subscriptions. Where information is twisted by bias. Where newcomers are told they’re not “good enough” to build.-— Built openly, for everyone, forever free. Open Dev Society.+We believe there’s a better way.++- **Our belief:** technology should belong to everyone. Knowledge should be open, free and accessible. Communities should welcome newcomers with trust, not gatekeeping.+- **Our mission:** build free, open-source projects that make a real difference: tools professionals and students can use without barriers, knowledge platforms where learning is free forever, communities where every beginner is guided, not judged, and resources that run on trust, not profit.+- **Our promise:** we will never lock knowledge. We will never charge for access. We will never trade trust for money. We run on transparency, donations and the strength of our community.+- **Our call:** if you’ve ever felt you didn’t belong, struggled to find free resources, or wanted to build something meaningful, you belong here.-> © Open Dev Society. This project is licensed under AGPL-3.0; if you modify, redistribute, or deploy it (including as a web service), you must release your source code under the same license and credit the original authors.+Because the future belongs to those who build it openly.-## Our Honourable Contributors-- [ravixalgorithm](https://github.com/ravixalgorithm) - Developed the entire application from the ground up, including authentication, UI design, API and AI integration, and deployment.-- [Priyanshuu00007](https://github.com/Priyanshuu00007) - Created the official OpenStock logo and contributed to the project’s visual identity.-- [chinnsenn](https://github.com/chinnsenn) - Set up Docker configuration for the repository, ensuring a smooth development and deployment process.-- [koevoet1221](https://github.com/koevoet1221) - Resolved MongoDB Docker build issues, improving the project’s overall stability and reliability.-- [ettoreciolli1](https://github.com/ettoreciolli1) - updated Readme+## 🙏 Acknowledgements <a name="acknowledgements"></a>+- [Finnhub](https://finnhub.io) for accessible market data, and [TradingView](https://www.tradingview.com) for embeddable charts and widgets+- [Adanos](https://adanos.org) for sentiment data+- shadcn/ui, Radix UI, Tailwind CSS and the Next.js community+- [Inngest](https://www.inngest.com) for dependable background jobs, and [Better Auth](https://www.better-auth.com) for simple, secure authentication+- [Adrian Hajdin (JavaScript Mastery)](https://github.com/adrianhajdin), whose [Stock Market App tutorial](https://www.youtube.com/watch?v=gu4pafNCXng) was where OpenStock started+Built openly, for everyone, forever free. © Open Dev Society.## ❤️ Sponsor OpenStock <a name="sponsors"></a>@@ -595,10 +412,3 @@ Can't sponsor right now? Pick a [good first issue](https://github.com/Open-Dev-S**Current sponsors** are shown at the [top of this README](#readme): [RapidProxy](https://www.rapidproxy.io/?ref=openstock) · [Orbit](https://github.com/diip3sh/orbit)**Previously backed by:** [Atlas Cloud](https://www.atlascloud.ai) · [Siray.ai](https://www.siray.ai/) (2026)--## Special thanks-Huge thanks to [Adrian Hajdin (JavaScript Mastery)](https://github.com/adrianhajdin) — his excellent Stock Market App tutorial was instrumental in building OpenStock for the open-source community under the Open Dev Society.--GitHub: [adrianhajdin](https://github.com/adrianhajdin)-YouTube tutorial: [Stock Market App Tutorial](https://www.youtube.com/watch?v=gu4pafNCXng)-YouTube channel: [JavaScript Mastery](https://www.youtube.com/@javascriptmastery)diff --git a/lib/changelog.ts b/lib/changelog.tsindex 42a5b3b..8b5763d 100644--- a/lib/changelog.ts+++ b/lib/changelog.ts@@ -202,6 +202,7 @@ export const RELEASES: Release[] = [{ login: 'Bortlesboat', prs: [65] },{ login: 'octo-patch', prs: [61] },{ login: 'TPTBusiness', prs: [63] },+ { login: 'NicolasBohn', prs: [63] },{ login: 'maplelaef0320', issues: [24] },],},@@ -235,11 +236,13 @@ export const RELEASES: Release[] = ['A news feed for the stocks on your watchlist. #40','Fullscreen charts. #45','About, Help and API docs pages, and Siray.ai as a fallback AI provider. #40',+ 'Fixed broken links in the README. #42',],},],credits: [{ login: 'ravixalgorithm', prs: [40, 45, 46, 48] },+ { login: 'ettoreciolli', prs: [42] },{ login: 'nexitpl', issues: [33, 44] },{ login: 'cn-zeus-jp', issues: [27] },],diff --git a/public/assets/images/dashboard.png b/public/assets/images/dashboard.pngindex 44ea19c..15cb76f 100644Binary files a/public/assets/images/dashboard.png and b/public/assets/images/dashboard.png differdiff --git a/scripts/check-env.mjs b/scripts/check-env.mjsindex e77f90d..4d44e84 100644--- a/scripts/check-env.mjs+++ b/scripts/check-env.mjs@@ -9,6 +9,8 @@* along with guidance on how to fix common issues.*/+import 'dotenv/config';+// =============================================// VARIABLE CATEGORIES// =============================================@@ -18,9 +20,6 @@* These will cause the script to exit with code 1 if missing.*/const requiredVars = {- // Core- 'NODE_ENV': 'development, production, or test',-// Database (MongoDB Atlas or local Docker)'MONGODB_URI': 'MongoDB connection string (Atlas: mongodb+srv://... | Docker: mongodb://root:example@mongodb:27017/openstock?authSource=admin)',@@ -28,27 +27,27 @@ const requiredVars = {'BETTER_AUTH_SECRET': 'Secret key for Better Auth (generate with: openssl rand -hex 32)','BETTER_AUTH_URL': 'Auth URL (e.g., http://localhost:3000 or https://your-domain.com)',- // Finnhub (Market data - required for stock features)- 'NEXT_PUBLIC_FINNHUB_API_KEY': 'Finnhub API key (free tier available at finnhub.io)',- 'FINNHUB_BASE_URL': 'Finnhub API base URL (default: https://finnhub.io/api/v1)',-- // Inngest (Background jobs, cron, AI)- 'INNGEST_SIGNING_KEY': 'Inngest signing key (required for Vercel deployment; get from Inngest dashboard)',- 'INNGEST_EVENT_KEY': 'Inngest event key (required in production: sign-up sends the welcome-email event with it)',-};+// The Finnhub key can be set under any of these names (checked separately below)+const finnhubKeyNames = ['FINNHUB_API_KEYS', 'FINNHUB_API_KEY', 'NEXT_PUBLIC_FINNHUB_API_KEY'];+/*** OPTIONAL: Can be set but not required for basic functionality.* These are checked and reported but won't cause failure.*/const optionalVars = {+ // Inngest (background jobs). Optional locally with `npx inngest-cli dev`; required in production.+ 'INNGEST_SIGNING_KEY': 'Inngest signing key (production; from the Inngest dashboard)',+ 'INNGEST_EVENT_KEY': 'Inngest event key (production: sign-up sends the welcome-email event with it)',+// Email (Nodemailer via Gmail). Without it the app runs; welcome and news emails are disabled.'NODEMAILER_EMAIL': 'Gmail address for sending emails','NODEMAILER_PASSWORD': 'Gmail app password (use App Passwords if 2FA enabled; not your regular password)',// AI Providers (for Inngest workflows)'GEMINI_API_KEY': 'Google Gemini API key (for AI-powered welcome emails and news summaries)',+ 'GEMINI_MODEL': 'Gemini model override (default: gemini-2.5-flash-lite)',// Adanos sentiment insights (optional alternative data source)'ADANOS_API_KEY': 'Adanos API key for stock sentiment insights (Reddit, X.com, news, Polymarket)',@@ -56,14 +55,20 @@ const optionalVars = {// MiniMax (optional AI provider fallback)'MINIMAX_API_KEY': 'MiniMax API key (used when AI_PROVIDER=minimax or as fallback)',+ 'MINIMAX_MODEL': 'MiniMax model override (default: MiniMax-M3)',+ 'MINIMAX_BASE_URL': 'MiniMax API base URL override (default: https://api.minimax.io/v1)',+ 'SIRAY_API_KEY': 'Siray.ai API key (used when AI_PROVIDER=siray or as fallback)',// Kit (ConvertKit) for email broadcasts'KIT_API_KEY': 'ConvertKit API key (for news summary broadcasts)','KIT_API_SECRET': 'ConvertKit API secret (for news summary broadcasts)',+ 'KIT_WELCOME_FORM_ID': 'Kit form new users are subscribed to',++ // Market data freshness (fixed at build time: rebuild after changing it)+ 'NEXT_PUBLIC_OPENSTOCK_DATA_MODE': '"cached" (default: quotes refresh hourly, shared by everyone) or "realtime" (every 15s, with price alerts)',- // Market data freshness + key pool- 'FINNHUB_API_KEYS': 'Comma-separated Finnhub keys, rotated per request (each adds 60 req/min). Falls back to NEXT_PUBLIC_FINNHUB_API_KEY',- 'NEXT_PUBLIC_OPENSTOCK_DATA_MODE': '"cached" (default: quotes refresh hourly, shared by everyone) or "realtime" (every 15s; OpenStock Cloud / self-hosted)',+ // Docker Compose only+ 'MONGO_ROOT_PASSWORD': 'Root password for the Compose MongoDB (use the same one in MONGODB_URI)',// Social sign-in (Better Auth)'GOOGLE_CLIENT_ID': 'Google OAuth client ID (callback: <BETTER_AUTH_URL>/api/auth/callback/google)',@@ -80,8 +85,7 @@ const optionalVars = {* Warns if these are set so you can migrate away.*/const deprecatedVars = {- // Legacy Finnhub key (deprecated in favor of NEXT_PUBLIC_FINNHUB_API_KEY)- 'FINNHUB_API_KEY': 'Legacy Finnhub key - use NEXT_PUBLIC_FINNHUB_API_KEY instead',+ 'FINNHUB_BASE_URL': 'Not used: OpenStock always calls https://finnhub.io/api/v1. Safe to delete.',};// =============================================@@ -148,6 +152,14 @@ for (const [key, description] of Object.entries(requiredVars)) {}}+// 1b. A Finnhub key under any of its names+const finnhubKey = finnhubKeyNames.find((key) => process.env[key]?.trim());+if (finnhubKey) {+ state.present.push({ key: finnhubKey, description: 'Finnhub API key', value: maskValue(process.env[finnhubKey].trim()), category: 'required' });+} else {+ state.missing.push({ key: finnhubKeyNames.join(' or '), description: 'Finnhub API key (free at finnhub.io)', severity: 'critical', hint: 'Get a free key at finnhub.io → Dashboard → API, then set FINNHUB_API_KEY (or several, comma-separated, in FINNHUB_API_KEYS)' });+}+// 2. Check deprecated variablesfor (const [key, description] of Object.entries(deprecatedVars)) {const value = process.env[key];@@ -179,13 +191,9 @@ for (const [key, description] of Object.entries(optionalVars)) {// Helper function to get hint for missing varsfunction getHint(key, type) {const hints = {- 'NODE_ENV': 'Set to "development", "production", or "test"','MONGODB_URI': 'Use Atlas URI (mongodb+srv://...) or Docker connection string','BETTER_AUTH_SECRET': 'Generate with: openssl rand -hex 32','BETTER_AUTH_URL': 'e.g., http://localhost:3000 or https://your-domain.com',- 'NEXT_PUBLIC_FINNHUB_API_KEY': 'Get free key at finnhub.io → Dashboard → API',- 'FINNHUB_BASE_URL': 'Usually default is fine: https://finnhub.io/api/v1',- 'INNGEST_SIGNING_KEY': 'Get from Inngest dashboard → Env settings → Keys','NODEMAILER_EMAIL': 'Your Gmail address','NODEMAILER_PASSWORD': 'Generate Gmail App Password: myaccount.google.com → Security → App passwords',};