Architecture & Design Patterns

Interactive flowcharts, pipeline designs, and structural decisions behind each micro-app.

The Daily Read

Stateless

Serverless Agentic news engine

A stateless news compilation engine. A scheduled cron trigger executes a Next.js serverless handler, which aggregates context using a lightweight fallback web scraper, invokes Gemini with search grounding, formats the output, and emails it using Resend.

Next.js 15Gemini SDKResend APIGitHub ActionsStateless

Design Patterns In Action

Serverless Pipeline Pattern

Executes end-to-end inside stateless serverless functions. State is zero-cost, loaded on-the-fly, processed, and immediately sent to recipients without a database.

Model Fallback Strategy

Tries 'gemini-2.5-flash' first. If rate-limited or quota is exceeded, automatically cascades to 'gemini-2.5-flash-lite' to guarantee daily delivery on free tiers.

Adapter / Proxy Pattern

Wraps third-party APIs (DuckDuckGo Search Scraper and Resend Emailing) inside Next.js routes, shielding client configuration and API keys securely.

Throughput1 Run / Day (06:00 UTC)
Latency SLA~1.2s Total Build
System HealthPrimary/Lite Cascade
Resilience SLA99.9% Uptime
System Pipeline Simulation
💡 Click any node to inspect details
GitHub CronTrigger (Daily)Next.js APIroute.tsScraper ProxyDuckDuckGoGemini AIFallback StackResend APIEmail ClientUser InboxSMTP Target
Click 'Simulate' to watch the pipeline execution flow, or click any node to inspect details.
Pattern Implementation: The Daily Read
// Multi-tier Fallback Model Execution
async function generateContentWithFallback(
ai: GoogleGenAI,
systemInstruction: string,
contents: string
): Promise<string> {
const models = [
'gemini-2.5-flash',
'gemini-2.5-flash-lite'
];
let lastError = "";
for (const model of models) {
try {
console.log(`Attempting generation with: ${model}`);
const response = await ai.models.generateContent({
model,
contents,
config: { systemInstruction }
});
if (response.text) return response.text;
} catch (e: any) {
lastError = e.message;
console.warn(`Model ${model} failed: ${e.message}. Falling back...`);
}
}
throw new Error(`All models exhausted. Final error: ${lastError}`);
}

Technical Deep Dive: The Daily Read

The Daily Read is an automated, stateless morning news compilation engine. Designed around serverless-first and cost-efficiency guidelines, it operates without a persistent database. It relies on GitHub Actions cron schedules to wake up a Next.js serverless route, crawls technology feeds using a stateless proxy web crawler, processes raw news with Gemini AI, and formats the final digest to deliver it to Anand's email via the Resend API.

System Flow & Execution Sequence

1
1. Scheduled Cron Event

At 06:00 UTC daily, a GitHub Actions workflow dispatches a secure HTTPS POST request to the Next.js `/api/cron` endpoint.

2
2. Token Security Gate

The serverless function intercepts the request and validates the authorization header against the server's `CRON_SECRET` to block unauthorized runs.

3
3. Stateless Search Crawl

Executes a client-side search query string to crawl tech news topics via a lightweight DuckDuckGo scraper, extracting raw article titles and links.

4
4. Gemini AI Selection Loop

Feeds raw text to the Gemini API under strict formatting guidelines. Automatically cascading down the fallback stack if rate limits or quota boundaries are met.

5
5. Resend Dispatch

The resulting markdown output is parsed to styled HTML and transactionally dispatched to the recipient's inbox using the Resend SDK.

State & Storage Configuration

ComponentTypePurpose
API Keys & SecretsVercel Env VariablesSecurely stores GEMINI_API_KEY, RESEND_API_KEY, and CRON_SECRET at the edge host level.
Feed Context CacheEphemeral Runtime MemoryZero database footprint. News listings are loaded and processed on-the-fly and cleaned up instantly upon request resolution.

Resilience & Fallback Mechanisms

Guarantees morning news arrival by employing a cascading failover model for LLM generation: if gemini-2.5-flash exhausts its developer quota or throws a rate limit error, the loop dynamically catches the exception and falls back to gemini-2.5-flash-lite. The API endpoint is protected by a cryptographically strong bearer token validation step.

Tech Stack & Cost Breakdown

How this entire ecosystem is structured across serverless free tiers, browser-side utilities, and professional paid upgrades.

Next.js & Vercel$0

Application framework & Serverless edge hosting. Handles static prerendering and runs secure API proxy routes with zero cold starts.

Gemini AI$20/mo

Advanced reasoning, estimation scoring, and profile Q&A using the Google AI Studio developer tier (gemini-2.5-flash) backed by AI Pro context quotas.

OpenRouter API$0

Acts as our API failover route. Pools and iterates across open-weight free model endpoints (e.g. Llama 3.3 70B) in case of primary API outages.

GitHub & Actions$0

Code versioning, submodule mapping, and automated GitHub Actions workflow runners acting as a serverless cron triggers.

Supabase Realtime$0

Bypasses heavy database writes by utilizing active WebSocket broadcast/presence channels for instant scrum poker peer estimation sync.

Resend API$0

Serverless transactional email gateway. Dispatches daily morning AI news briefings compiled dynamically without background mail servers.

DuckDuckGo Grounding$0

Zero-cost fallback search context grounding, crawling DuckDuckGo to feed fresh AI headlines to The Daily Read compiler daily.

Spaceship DNS$12/yr

Domain Registrar & custom DNS subdomain mapping. Binds newsletter, cogpoker, codeforge, and pdf targets to anandmuraleedharan.com.

Next.js & Vercel$0

Application framework & Serverless edge hosting. Handles static prerendering and runs secure API proxy routes with zero cold starts.

Gemini AI$20/mo

Advanced reasoning, estimation scoring, and profile Q&A using the Google AI Studio developer tier (gemini-2.5-flash) backed by AI Pro context quotas.

OpenRouter API$0

Acts as our API failover route. Pools and iterates across open-weight free model endpoints (e.g. Llama 3.3 70B) in case of primary API outages.

GitHub & Actions$0

Code versioning, submodule mapping, and automated GitHub Actions workflow runners acting as a serverless cron triggers.

Supabase Realtime$0

Bypasses heavy database writes by utilizing active WebSocket broadcast/presence channels for instant scrum poker peer estimation sync.

Resend API$0

Serverless transactional email gateway. Dispatches daily morning AI news briefings compiled dynamically without background mail servers.

DuckDuckGo Grounding$0

Zero-cost fallback search context grounding, crawling DuckDuckGo to feed fresh AI headlines to The Daily Read compiler daily.

Spaceship DNS$12/yr

Domain Registrar & custom DNS subdomain mapping. Binds newsletter, cogpoker, codeforge, and pdf targets to anandmuraleedharan.com.

Browser Web APIs$0

Leverages Performance Timing API for Web Vitals speed analytics, CompressionStream for stateless URLs, PDF.js for document parsing, and SessionStorage for state.

Antigravity 2.0$0

Autonomous AI coding partner designed by Google DeepMind, orchestrating, coding, and deploying this visualizer and app suite.

Playwright$0

E2E integration testing framework. Simulates real-time multi-user WebSocket voting and presence sessions to verify scrum room reliability.

Docker$0

Local infrastructure orchestrator. Runs Supabase CLI container engines locally, supporting database-free real-time WebSocket connection targets.

FastAPI & Python$0

High-performance API gateway and SDK running Aileron's evaluation sandbox and DSPy prompts optimization on Python 3.14.

DSPy Optimizer$0

Programmatic few-shot prompt compiler, validating and scoring system instructions against benchmark test suites.

Opik Tracing & Metrics$0

Execution observability framework, capturing SQL generation latency, costs, and traces.

SQLite Sandbox$0

Secure, read-only SQL compilation and sandbox database environment for local code execution and verification.

MkDocs & Material$0

Dedicated project technical documentation portal. Custom styled slate theme, Outfit/Inter typography, and local search indexing.

Supabase Database$0

Cloud PostgreSQL database hosting. Holds visitor telemetry, page views, and performance logs in complete isolation.

TOTP / Google Authenticator$0

Mathematical 2FA passcode gate. Uses local Node crypto HMAC computations to verify codes and protect visitor logs privacy.

Browser Web APIs$0

Leverages Performance Timing API for Web Vitals speed analytics, CompressionStream for stateless URLs, PDF.js for document parsing, and SessionStorage for state.

Antigravity 2.0$0

Autonomous AI coding partner designed by Google DeepMind, orchestrating, coding, and deploying this visualizer and app suite.

Playwright$0

E2E integration testing framework. Simulates real-time multi-user WebSocket voting and presence sessions to verify scrum room reliability.

Docker$0

Local infrastructure orchestrator. Runs Supabase CLI container engines locally, supporting database-free real-time WebSocket connection targets.

FastAPI & Python$0

High-performance API gateway and SDK running Aileron's evaluation sandbox and DSPy prompts optimization on Python 3.14.

DSPy Optimizer$0

Programmatic few-shot prompt compiler, validating and scoring system instructions against benchmark test suites.

Opik Tracing & Metrics$0

Execution observability framework, capturing SQL generation latency, costs, and traces.

SQLite Sandbox$0

Secure, read-only SQL compilation and sandbox database environment for local code execution and verification.

MkDocs & Material$0

Dedicated project technical documentation portal. Custom styled slate theme, Outfit/Inter typography, and local search indexing.

Supabase Database$0

Cloud PostgreSQL database hosting. Holds visitor telemetry, page views, and performance logs in complete isolation.

TOTP / Google Authenticator$0

Mathematical 2FA passcode gate. Uses local Node crypto HMAC computations to verify codes and protect visitor logs privacy.