DEV Community

Cover image for I Built an AI-Powered News Digest That Runs Itself for $5/Month — Here's How
n74459944-web
n74459944-web

Posted on

I Built an AI-Powered News Digest That Runs Itself for $5/Month — Here's How

I wanted one place to see the day's most important stories, organized by category, without the noise of a 24/7 news cycle. Nothing I found did exactly that — so I built it in a day.
It's called Le Bref (French for "The Brief"). It scrapes 25+ RSS feeds twice a day, uses Claude AI to pick the top stories, summarizes them into 3 tiers of depth, and stores everything in a permanent searchable archive.
Total monthly cost to run: about $5-10. Here's the full breakdown.
The Problem
Every news app I tried had the same issues:

Paywalled (The Economist's Espresso, premium newsletters)
Ephemeral (today's digest replaces yesterday's — no archive)
Uncategorized (everything dumped into one feed)
Too long (I want the gist, not a 2,000-word article)

I wanted a site where I could glance at today's highlights in 30 seconds, read more if something caught my eye, and go back to any past date to see what happened.
The Architecture
[25 RSS Feeds] → [Python Cron Job] → [Claude API] → [Supabase] → [Next.js Frontend]
Five moving parts, all on free or near-free tiers.
Backend: Python on Railway
A cron job runs twice daily (6 AM and 6 PM UTC). It does three things:

  1. Scrape — feedparser pulls the latest articles from 25 RSS feeds across 7 categories (Politics, Economics, Tech, World, Health, Crime, Breaking).
  2. Summarize — All articles get sent to the Claude API in a single call. The prompt asks Claude to act as an editor: pick the top 10-14 stories, categorize them, and generate three tiers of content for each:

TL;DR: One punchy sentence with a key number or fact
Summary: 3-4 factual sentences
Why It Matters: 2 sentences on broader significance

  1. Store — Results go into Supabase (PostgreSQL) with deduplication via headline hashing. The key cost insight: I pre-generate everything at cron time. No API calls happen when users visit the site. This dropped costs from potentially $50+/day (if every user triggered an API call) to about $0.15/day flat. Frontend: Next.js on Vercel The frontend reads directly from Supabase's REST API — no backend server needed for reads since Row Level Security allows public SELECT access with the anon key. Features that took the most thought:

3-tier expandable cards — TL;DR always visible, click to expand full summary
"Go deeper with Claude" button — This links to claude.ai/new?q=... with a pre-filled prompt asking Claude to explain the story in depth. The user uses their own Claude account. Cost to me: $0. Value to the user: massive.
Dark mode — CSS variables swap between light and dark themes, persisted in localStorage, defaults to system preference
Breaking news — Claude can tag one story per day as "breaking." When it does, a pulsing red tab appears in the category bar
Trending topics — If 2+ articles share a subcategory (like "iran" or "fed"), it surfaces as a trending topic

Database: Supabase
Simple schema — one articles table with columns for all 3 content tiers, category, subcategory, sources, and a headline hash for deduplication. Row Level Security is configured so the anon key can only read, and only the service role can write.
I also added a subscribers table for newsletter signups — anyone can INSERT their email, but only the service role can SELECT (so emails stay private).
SEO
This part was important since news content is inherently search-friendly:

Dynamic sitemap at /sitemap.xml listing every article page
Individual article URLs like /article/2026-03-21/fed-holds-rates
Open Graph images generated dynamically at /api/og
RSS feed at /api/rss for Feedly subscribers

The "Go Deeper" Trick
This is my favorite architectural decision. The typical approach for an AI-powered feature would be:

User clicks "explain more"
Your server calls an LLM API
You pay for the tokens
You serve the response

The problem: if 1,000 users each click it 5 times a day, you're looking at $15-50/day in API costs.
My approach: the "Go deeper with Claude" button is just a link:
javascriptfunction buildClaudeLink(article) {
var prompt = "Explain this news story in depth...\n\n"
+ "Headline: " + article.headline
+ "\nSummary: " + article.summary;
return "https://claude.ai/new?q=" + encodeURIComponent(prompt);
}
It opens Claude's web interface with a pre-filled prompt. The user gets a full expert-level explainer. I pay nothing. It works because Claude.ai has a free tier, and the pre-filled prompt means the user doesn't have to think about what to ask.
Cost Breakdown
ServiceCostClaude API (20 articles/day across 2 editions)~$3-5/monthSupabase (database, free tier)$0Vercel (frontend hosting, free tier)$0Railway (backend cron, starter plan)$0-5Domain (lebref.news)~$12/yearTotal~$5-10/month
What I'd Do Differently
Start with fewer RSS feeds. I launched with 25 feeds, which means ~125 articles per scrape. Claude handles it fine, but debugging prompt issues is harder with more input.
Test the prompt extensively. The summarization prompt is the most important code in the entire project. Small wording changes dramatically affect output quality. I went through several iterations to get Claude to consistently produce the right length and tone.
Set up dedup from day one. My first run produced duplicate stories because the morning and evening editions covered the same events. I now hash the first 5 significant words of each headline per date to catch near-duplicates.
Try It
lebref.news — free, no account needed, dark mode, RSS feed available.
The archive grows every day. The longer it runs, the more valuable the searchable history becomes. It's like compound interest for content.
If you have questions about the architecture or want to build something similar, drop a comment — happy to share more details.

Top comments (0)