Skip to content

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.

2.9 KB
Raw Blame
# 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-M3.1-Flash is the default; set MiniMax-M3 to use M3. Existing overrides are preserved.
# MINIMAX_MODEL=MiniMax-M3.1-Flash
# 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=