Elliott is a Next.js app with no server database: portfolio data stays in each visitor’s browser (IndexedDB). Vercel runs next build and serves the app plus Route Handlers under /api/market/* for TwelveData and IOL (API keys stay on the server).
- A Vercel account
- This repo connected to Vercel (GitHub/GitLab/Bitbucket import, or CLI)
- Optional API keys for TwelveData and Corsfix (see env.example)
These paths are already ignored (see .gitignore):
.env,.env.local,.env.production, etc..vercel(local CLI link metadata)
CLI deploys also exclude env files via .vercelignore so your laptop’s .env is not uploaded with the source bundle.
Do not commit real keys. Only env.example belongs in the repo (empty placeholders).
For local development, copy the example file:
cp env.example .env.localEdit .env.local with your keys. Next.js loads .env.local in development and does not commit it.
In the Vercel project: Settings → Environment Variables, add the same names as in env.example. Apply them to Production (and Preview if you use preview deployments).
| Variable | Required | Notes |
|---|---|---|
TWELVEDATA_API_KEY |
No | Omit or leave empty to use TwelveData’s public demo key (rate limits). |
CORSFIX_API_KEY |
No | Improves IOL listing/UDF when server direct fetch fails. |
IOL_LISTING_EXCHANGES |
No | Unset = default venues (BCBA, NYSE, NASDAQ, AMEX, ARCA, BATS). Set to empty string to disable IOL-first routing. |
IOL_UDF_CHARTS |
No | Set to 0 to skip IOL UDF charts (TwelveData-only for those exchanges). |
BCBA_IOL_CHARTS |
No | Legacy alias; 0 has the same effect as IOL_UDF_CHARTS=0. |
After changing variables, redeploy so the build embeds the new values.
TWELVEDATA_API_KEY, CORSFIX_API_KEY, and IOL config vars are read only on the server and are not inlined into the browser bundle. Do not prefix them with NEXT_PUBLIC_.
- Import the repository in Vercel.
- Framework preset: Next.js (auto-detected).
- Build command:
npm run build(default). - Output: managed by Next.js (no custom
output: 'export'required). - Install command:
npm install(default). - Add environment variables (step 2), then deploy.
npm i -g vercel
vercel login
vercel link # once per machine
vercel env pull .env.local # optional: sync Vercel env into local file (do not commit)
vercel --prod- Open the production URL; add a test position and confirm IndexedDB persistence (refresh the page).
- Check equity quotes (TwelveData / IOL paths) and crypto (CoinGecko).
- If BCBA or IOL-listed symbols fail, confirm
CORSFIX_API_KEYis set on Vercel and redeploy; check Network tab for/api/market/iol/*responses. - Run locally before pushing:
npm run lintandnpm run build.
- No
.envor.env.localwith real keys in Git (git statusclean; nevergit add .env*). - Keys set only in Vercel (or local
.env.local), not in README or issues. - Rotate TwelveData / Corsfix keys if they were ever committed or shared publicly.
- Market env vars use server names only (no
NEXT_PUBLIC_*for keys or IOL config).
| Symptom | Likely cause |
|---|---|
| Build fails on Vercel | Run npm run build locally (Turbopack is the default in Next.js 16). Fix TypeScript/ESLint errors first. If you see a vague path / Received undefined error after a dependency upgrade, try Deployments → … → Redeploy with Clear build cache enabled. |
| Env vars ignored | Redeploy after changing variables; names must match exactly (no NEXT_PUBLIC_ prefix for market vars). |
| IOL / BCBA quotes empty | Missing/invalid CORSFIX_API_KEY; IOL HTML/parser changes; check /api/market/iol/listing. |
| Equity charts rate-limited | TwelveData demo key; add TWELVEDATA_API_KEY. |
| Binance errors in console | Expected in browser (CORS); crypto should still work via CoinGecko. |
- README.md — env variable summary
- constraints.md — no backend, allowed data sources
- architecture.md — data flow