Understand commodity markets, explore their connections, and turn observations into research.
CommodityChain brings energy and metals futures, historical analytics, India economic context, and educational tools into one workspace. Built for students, curious market watchers, and developers exploring financial data.
Open dashboard · API documentation · About & methodology · Documentation · Report a bug
Desktop dashboard preview supplied December 2, 2026. Click the image to view it at full resolution. Displayed values are a historical snapshot, not current quotes.
Commodity research often means switching between price screens, charts, economic releases, and spreadsheets. CommodityChain connects these views so you can:
- Compare eight configured energy and metals instruments with visible sources and observation times.
- Explore daily history, technical indicators, market performance, and relationships between returns.
- Model hypothetical exposures and price shocks without connecting a brokerage account.
- Connect global commodity movements with published India fuel and macro observations.
- Export observations or save a research snapshot for further study.
Status: public beta for educational research. Prices can be delayed, stale, or unavailable. There is no simulated market-price fallback. Scenarios are illustrative, and hypothetical exposures are not actual holdings. This project is not a trading service or investment advice. See launch readiness for outstanding work.
| Area | Tools and behavior |
|---|---|
| Market dashboard | Timestamped price cards, source and freshness labels, market heatmap, historical comparisons, local favourites, and compact display settings |
| Historical research | Explorer with available 1-week/1-month daily observations, moving averages, RSI and MACD; matched daily-return correlations with sample counts |
| Portfolio experiments | Browser-local hypothetical unit exposures, coverage-aware valuation, and price shock stress tests |
| Research exports | CSV/JSON observations and frozen HTML/JSON reports, optional portfolio inclusion, and browser Print to PDF |
| News and calendar | Provider-supplied headlines with availability labels; selected source-linked release dates with IST and review status |
| AI analyst | Optional Groq-hosted analysis with bounded requests and provider context where available |
| India context | Source-linked published fuel and macro observations, review dates, and a separate illustrative scenario model |
| Learning tools | Introductory articles, illustrative country profiles, and unit/FX conversion with source labels |
| Price alerts | One-shot checks on fresh quotes while the alerts page is open; browser notifications require permission |
Configured instruments: WTI crude, Brent crude, natural gas, gold, silver, copper, aluminium, and platinum. Review the instrument registry for identifiers and units. Optional EIA spot references are separate from the futures stream; availability remains subject to the documented limitations.
flowchart LR
Sources[Market data and optional providers] --> API[FastAPI backend on Render]
API -->|HTTP and WebSocket| UI[Next.js frontend on Vercel]
UI --> Browser[Browser-local preferences and exposures]
UI --> Files[CSV, JSON and HTML research exports]
The backend retrieves provider observations, caches results, and exposes prices and analytics through HTTP and WebSockets. The frontend presents availability and timestamps alongside research tools. A connected socket does not establish that a quote is fresh. See architecture and the price data contract.
| Layer | Current repository implementation |
|---|---|
| Interface | Next.js 14 App Router, React 18, TypeScript |
| Styling and maps | Custom CSS, D3 Geo, TopoJSON |
| API and streaming | Python 3.11, FastAPI, Uvicorn, WebSockets |
| Futures observations | Yahoo Finance through yfinance |
| Other integrations | ExchangeRate-API, NewsAPI, optional Groq and EIA |
| Hosting | Vercel frontend; Render Free backend with manual deployment |
| Checks | Node test runner, TypeScript, Python unittest, GitHub Actions |
The repository currently pins Next.js 14.2.5. The existing launch review records framework and dependency remediation as outstanding; this documentation update does not resolve it.
Use Git, Python 3.11, Node.js 20, and npm. Node 20 matches current CI configuration.
git clone https://github.com/ayushcmd/commoditychain.git
cd commoditychainCreate backend/.env with local configuration:
ALLOWED_ORIGINS=http://localhost:3000
GROQ_API_KEY=
GROQ_MODEL=openai/gpt-oss-120b
NEWS_API_KEY=
EIA_API_KEY=Provider keys are optional for starting the app. Features that need an unconfigured provider can be unavailable. Keep real keys private.
Terminal 1 — backend (PowerShell):
cd backend
py -3.11 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python -m uvicorn main:app --reload --port 8000For macOS/Linux, use python3.11 -m venv .venv and source .venv/bin/activate instead of the environment creation and activation commands above. If PowerShell activation is restricted, use .\.venv\Scripts\python.exe directly for installation and startup.
Terminal 2 — frontend:
cd frontend
npm ci
npm run devOpen the local dashboard and local API docs. Development uses http://localhost:8000 and ws://localhost:8000 automatically. No frontend backend-URL environment variables are required. Production builds and deploy previews use the fixed Render origin; see getting started for details and troubleshooting.
commoditychain/
├── .github/ Community policies, issue/PR templates, and workflows
├── backend/ FastAPI routers, provider services, snapshots, and tests
├── docs/ Guides, data contracts, operations notes, and screenshots
├── frontend/ Next.js routes, components, research tools, and tests
├── LICENSE
├── README.md
└── render.yaml Supported hosted backend configuration
Run backend checks from backend/:
python -m unittest discover -s tests -vRun frontend checks from frontend/:
npm run test:realtime
npm run type-check
npm run buildStart with the documentation index, contribution guide, and deployment guide. GitHub Actions cover price provenance, manual production smoke checks, India data review, and a manual dependency audit. Passing functional checks does not establish production uptime or security.
- Provider terms, quotas, and redistribution permissions need operator review before broader public use. The software license does not grant rights to third-party data.
- Portfolio entries, alerts, and display preferences stay in browser storage and do not synchronize across accounts. Browser storage is not encrypted account storage.
- Reports include private position information only when opted in. Review exports before sharing them.
- AI queries go through the backend to the configured model provider. Avoid entering confidential information.
- India snapshots, calendar entries, and illustrative Learn/Map content have different update and review cycles. Check their sources and review dates.
- Render Free can sleep; provider limits and outages can interrupt data. No uptime guarantee or artificial keepalive is provided.
Read the provider guide, financial data notes, and launch readiness checklist before relying on or operating a deployment.
Bug reports, documentation improvements, tests, and focused code contributions are welcome. Please read Contributing and the Code of Conduct first.
- Bugs and ideas: GitHub Issues
- Usage help: Support guide
- Private security reports: Security policy
- Maintainer: Ayush Raj — @ayushcmd
- Email: ayush_24a12res897@iitp.ac.in
CommodityChain source code is available under the MIT License. Third-party libraries, services, and datasets retain their own terms and notices.