You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard rules for this codebase. If a change violates these, it is out of scope unless the constraints are explicitly revised.
Platform
Constraint
Detail
No app-owned database
No Postgres, SQLite server, etc. All durable portfolio state is client-side.
Client-side persistence
Portfolio, cached quote snapshots, and related keys use the browser (IndexedDB via idb). Prefer IndexedDB over localStorage for structured data and size.
Market API routes
Next.js Route Handlers under src/app/api/market/ proxy TwelveData and IOL fetches. API keys and IOL config are server-only env vars. Portfolio CRUD does not go through the server.
Allowed market inputs
CoinGecko, Binance (public REST, browser), and TwelveData (via /api/market/twelvedata/*) for normalized market data. Configured listing venues (default: BCBA, NYSE, NASDAQ, AMEX, ARCA, BATS; see IOL_LISTING_EXCHANGES) may use InvertirOnline listing HTML and UDF JSON via /api/market/iol/* (server fetch with Corsfix fallback). Fixed income positions use only user-entered fields (rate, dates, currency)—no external quote. Do not add other paid or private data vendors without an explicit decision.
Third-party proxy (Corsfix)
IOL listing HTML and UDF history are fetched on the server (src/lib/server/remote-fetch.ts): direct fetch first, then Corsfix when needed.
CORSFIX_API_KEY, IOL_LISTING_EXCHANGES, and IOL_UDF_CHARTS are read only in server code (src/lib/server/).
Security and secrets
Do not use NEXT_PUBLIC_* for API keys or market-provider config; Elliott has no required NEXT_PUBLIC_* variables.
Optional keys live in .env.local / Vercel as TWELVEDATA_API_KEY and CORSFIX_API_KEY.