Your Daily Market & Macro Intelligence Platform
India-focused economic analysis with real-time data and AI-powered insights
MacroPulse Copilot is a production-ready Flask web application designed for students and economists to receive daily market and macroeconomic context with plain-English explanations. The platform provides:
- Real-time Foreign Exchange rates (focus on INR)
- Commodity prices (Gold, Crude Oil, Silver, Natural Gas)
- Economic indicators (US Treasury Yields, Interest Rates)
- Market news aggregation
- AI-powered analysis explaining India-specific impacts
- Interactive charts for trend visualization
- All global events are analyzed through the lens of Indian market impact
- INR-based foreign exchange tracking
- India-relevant commodity pricing
- Plain-English explanations of complex macro concepts
- Daily market summaries powered by OpenAI GPT
- Context-aware analysis of global events on Indian economy
- Real-time data visualization using Chart.js
- US Treasury yield curves
- Historical trend analysis
- Responsive, mobile-friendly design
- Subtle, clean interface built with Bootstrap 5
- Inter font family for modern typography
- Smooth animations and transitions
- Fully responsive design
- Python 3.8 or higher
- pip (Python package manager)
- OpenAI API key
- FRED API key
- Clone or download the project
cd macropulse_copilot- Create a virtual environment (recommended)
python -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activate- Install dependencies
pip install -r requirements.txt- Set up environment variables
# Copy the example environment file
cp .env.example .env
# Edit .env and add your API keys
# OPENAI_API_KEY=your_key_here
# FRED_API_KEY=your_key_here- Run the application
python app.py- Access the dashboard
Open your browser and navigate to: http://localhost:5000
- Go to OpenAI Platform
- Create an account or sign in
- Navigate to API Keys section
- Click "Create new secret key"
- Copy the key and add it to your
.envfile
- Go to FRED API
- Create a free account
- Request an API key
- Copy the key and add it to your
.envfile
macropulse_copilot/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ .env.example # Example environment variables
βββ README.md # This file
β
βββ static/ # Static assets
β βββ css/
β β βββ style.css # Custom styling
β βββ js/
β βββ dashboard.js # Dashboard functionality
β
βββ templates/ # HTML templates
βββ index.html # Main dashboard
βββ 404.html # Not found page
βββ 500.html # Server error page
| Variable | Description | Required | Default |
|---|---|---|---|
OPENAI_API_KEY |
OpenAI API key for AI analysis | Yes | - |
FRED_API_KEY |
FRED API key for economic data | Yes | - |
SECRET_KEY |
Flask secret key | No | dev-secret-key |
DEBUG |
Debug mode | No | False |
PORT |
Application port | No | 5000 |
The application uses Flask-Caching with the following timeouts:
- FRED data: 1 hour
- Forex rates: 30 minutes
- Commodity prices: 30 minutes
- News: 2 hours
- Foreign Exchange: Exchange Rate API
- Economic Data: FRED (Federal Reserve Economic Data)
- AI Analysis: OpenAI GPT-4
- Charts: Chart.js
- Flask 3.0: Python web framework
- Flask-Caching: Response caching
- OpenAI API: AI-powered analysis
- Requests: HTTP client
- Bootstrap 5: UI framework
- Chart.js: Data visualization
- Font Awesome: Icons
- Inter Font: Typography
-
Market Overview
- Real-time forex rates (USD, EUR, GBP, CNY vs INR)
- Visual indicators for currency strength
-
Commodity Prices
- Gold, Crude Oil, Silver, Natural Gas
- Price changes with percentage indicators
- INR-denominated pricing
-
AI Market Analysis
- Context-aware insights
- Plain-English explanations
- India-specific impact assessment
-
Treasury Yields Chart
- 60-day historical data
- 10-year and 2-year comparison
- Impact on Indian bond markets
-
Market News
- Curated news feeds
- Time-stamped updates
- Relevant Indian market news
gunicorn -w 4 -b 0.0.0.0:5000 app:appexport FLASK_ENV=production
export DEBUG=False
export SECRET_KEY="your-strong-secret-key"
export OPENAI_API_KEY="your-openai-key"
export FRED_API_KEY="your-fred-key"- Reverse Proxy: Use Nginx or Apache
- HTTPS: Configure SSL certificates
- Process Manager: Use systemd or supervisor
- Monitoring: Implement logging and error tracking
Problem: "API key not configured" warning
- Solution: Ensure your
.envfile has the correct API keys set
Problem: Charts not displaying
- Solution: Check browser console for errors, ensure Chart.js is loaded
Problem: No data showing
- Solution: Verify API keys are valid and have sufficient quota
Problem: Slow loading times
- Solution: Adjust cache timeouts in
app.py
This is a production-ready application. To customize:
- Modify
app.pyto add new data sources - Update
templates/index.htmlfor UI changes - Enhance
static/js/dashboard.jsfor new features - Adjust styling in
static/css/style.css
This project is provided as-is for educational and commercial use.
- FRED for economic data
- OpenAI for AI capabilities
- Exchange Rate API for forex data
- Bootstrap and Chart.js communities
For issues and questions:
- Check the troubleshooting section
- Review API documentation
- Verify environment variables
- Check server logs
Built with β€οΈ for students and economists
MacroPulse Copilot - Making macro economics accessible and understandable