Developer Setup

Real API setup guide

This page explains how Chart Rhythms is prepared for live news and AI integration. The MVP currently uses mock fallback data so the website works safely without paid or private API keys.

Important security rule:

Never paste real API keys into public code files. API keys should only go inside .env.local. Do not upload .env.local to GitHub.

Environment variables

These values live in the project root file:.env.local

NEWS_PROVIDER

Current: alpha_vantage

Chooses which news provider the app should use.

ALPHA_VANTAGE_API_KEY

Current: empty placeholder

Used later to fetch live Alpha Vantage News & Sentiment data.

NEWS_API_KEY

Current: empty placeholder

Backup placeholder for another news provider if needed later.

AI_PROVIDER

Current: algorithm

Chooses whether the app uses the built-in MVP algorithm or a future external AI provider.

AI_API_KEY

Current: empty placeholder

Used later to connect a real AI model for article and stock rhythm analysis.

Current MVP mode

News Provider

Alpha Vantage is prepared, but mock fallback is active until a real API key is added.

MVP Safe Mode

If no API key exists, the app keeps working using mock news articles from app/data.ts.

How to add the real key later

Open the environment file:

open -e .env.local

Then set:

NEWS_PROVIDER="alpha_vantage"
ALPHA_VANTAGE_API_KEY="your_real_key_here"

AI_PROVIDER="algorithm"
AI_API_KEY=""

Restart the app:

npm run dev

Next setup steps

Step 1

Get an Alpha Vantage API key.

Step 2

Add the key to .env.local.

Step 3

Restart npm run dev.

Step 4

Test /api/live-news/NVDA.

Step 5

Confirm the API returns mode: live instead of mode: mock.

Step 6

Then connect live-news data into the stock and news pages.

Step 7

After live news works, choose an AI provider.

Step 8

Add AI_PROVIDER and AI_API_KEY when ready.

Step 9

Test /api/ai/analyze/NVDA.