This project is a fully automated news digest web app. It fetches headlines from Google News, uses Google's Gemini AI to intelligently select and rank them based on user preferences, and serves the content from a live database.
The entire process is hosted on Railway, with a scheduled worker that updates the news hourly.
View the demo: news.blakerayvid.com
- Configurable via Google Sheets: Easily manage topics, keywords, banned terms, and application parameters by copying and editing a Google Sheet.
- Intelligent Curation with Gemini: A carefully engineered prompt instructs the Gemini AI to perform aggressive cross-topic deduplication, filter out low-quality content, and prioritize headlines based on user-defined weights.
- Dynamic Web Application:
- The backend is a lightweight Flask web server that queries a PostgreSQL database.
- Server-side rendering ensures fast load times, while historical data is lazy-loaded on demand.
- Automated Content Updates:
digest.py: Runs hourly to fetch and curate fresh news.
- Interactive Frontend:
- Pure HTML, CSS, and vanilla JavaScript (dependency-free).
- Includes swipeable carousels for browsing past digests and market forecasts.
- Backend: Python 3, Flask
- AI & ML:
- Google Gemini API (
gemini-2.5-flash-lite) pandas,numpy
- Google Gemini API (
- Database: PostgreSQL
- Frontend: HTML5, CSS3, Vanilla JavaScript, Jinja2,
Chart.js - Hosting & Automation: Railway (Web Service + Cron Jobs)
based-news/
├── digest.py # Worker script for fetching/curating news
├── Procfile # Defines processes for hosting
├── README.md # This file
├── requirements.txt # Python dependencies for the worker
└── web/
├── app.py # Flask web server
├── railway.json # Railway deployment configuration
├── requirements.txt # Python dependencies for the web server
├── static/
│ └── favicon.ico
└── templates/
├── index.html # Template for the news digest
└── forecast.html # Template for the market forecast
- Clone your forked repository.
- Create and activate a Python virtual environment.
- Install dependencies:
pip install -r requirements.txtandpip install -r web/requirements.txt. - Create a
.envfile with yourGEMINI_API_KEYand theDATABASE_URLfrom your Railway project. - Run the news digest worker:
python digest.py. - Run the forecast engine:
python forecast/engine.py. - Run the web server to view the site:
python web/app.pyand navigate tohttp://localhost:5000.
© Copyright 2026 Blake Rayvid. All rights reserved.
