Collect hourly stock prices from Yahoo Finance and store them in PostgreSQL for analysis with Power BI.
Runs hourly data collection automatically using GitHub's free compute and Supabase free database.
Full Kafka-based streaming setup for local testing and development.
-
Create Supabase database (free)
- Go to supabase.com
- Create project, copy connection string
-
Configure GitHub
# Add secret: Settings → Secrets → Actions # Name: DATABASE_URL # Value: your-supabase-connection-string
-
Files structure
your-repo/ ├── .github/workflows/stock-data-collection.yml ├── stock_collector.py ├── config/stocks.json └── requirements.txt -
Deploy
- Push to GitHub
- Go to Actions tab → Run workflow manually to test
- Data collected hourly automatically
- Get Data → PostgreSQL database
- Server:
db.yourproject.supabase.co - Database:
postgres - Credentials: From your Supabase project settings
- Select:
stock_pricestable
Edit config/stocks.json to change which stocks to track:
{
"stocks": ["NVDA", "MSFT", "AAPL", "GOOGL", "AMZN", "META", "TSLA"],
"refresh_interval": 3600 # hourly
}# Create .env file
cp .env.example .env
# Start services
docker-compose up -d
# Run producer and consumer
python producers/producer.py # Terminal 1
python consumers/consumer.py # Terminal 2If you want to test locally:
# Start services
docker-compose up -d
# Run producer and consumer
python producers/producer.py # Terminal 1
python consumers/consumer.py # Terminal 2Access:
- PostgreSQL:
localhost:5432 - pgAdmin:
http://localhost:5051
stock_prices (
id, symbol, open_price, high, low, close_price,
volume, market_cap, timestamp, date_only
)- GitHub Actions: Free (120 hours/month)
- Supabase: Free (500MB database)
- Power BI: Requires license for cloud features
Total monthly cost: $0
