How jaswanthreddyam-maker/tech_news works
Purpose and entry points
Tech News Today is an AI-assisted technology-news platform: it ingests RSS/web content, enriches and organizes it into stories and editorial views, then serves discovery, reading, search, recommendations, chat, and distribution experiences. Runtime entry points are the FastAPI service at backend/main.py, Celery worker configuration at backend/celery_app.py, and the Next.js application rooted at frontend/src/app/layout.tsx and frontend/src/app/(public)/page.tsx.
API and client boundary
The Python backend exposes versioned HTTP APIs, with v1 as the broad product surface and v2 for artifact, event, intent, and admin functions. Routes are the public boundary to application services, authorization, and persistence. The Next.js App Router provides public, auth, dashboard, editorial, article, search, chat, and workspace screens; its API clients normalize backend responses before presentation.
Paths: backend/app/api/v1/router.py, backend/app/api/v2/routes/intents.py, frontend/src/lib/api/client.ts, frontend/src/app/(public)/articles/[slug]/page.tsx.
Content ingestion and story formation
Source acquisition uses RSS/HTML agents and an ingestion pipeline to fetch, extract, filter, deduplicate, persist, assign articles to stories, derive related coverage, and generate/manage thumbnails. This is the main write-side flow: external publishers → raw/processed article and story records → emitted events/projections. Source-specific policies and thumbnail retries make ingestion an asynchronous operational subsystem.
Paths: backend/agents/ingestion/rss_agent.py, backend/app/services/ingestion/pipeline.py, backend/app/services/ingestion/story_assignment.py.
AI and knowledge intelligence
AI enrichment generates summaries, topics, entities, sentiment, embeddings, clustering, timelines, and provenance-aware artifacts. Provider adapters isolate OpenAI, Anthropic, and Gemini behind common contracts with caching, retry, circuit breaking, validation, cost, and telemetry controls. Knowledge-graph services resolve aliases/canonical entities, detect conflicts and duplicates, and evolve graph knowledge; semantic search and chat retrieve this enriched corpus.
Paths: backend/app/ai/ai_pipeline.py, backend/app/ai/providers/factory.py, backend/app/services/knowledge_graph/evolution_pipeline.py.
Events, CQRS, and projections
The system explicitly adopts event envelopes, an outbox, dispatching, and projection engines. Write-side domain models/events feed read models for article views, homepage sections, story dashboards, recommendations, analytics, and search; projection/replay/recovery support eventual-consistency operations. This boundary is central: UI-facing reads should favor projections rather than reconstructing raw ingestion state.
Paths: backend/app/core/events/dispatcher.py, backend/app/core/projection/engine.py, backend/app/models/projection.py.
Editorial, personalization, and distribution
Editorial services rank and curate content under category, diversity, freshness, lifecycle, and source-profile policies, then build homepage and desk projections. Behavioral telemetry, user interests, cohorts, and recommendation pipelines personalize feeds. Briefing/newsletter and distribution capabilities turn selected content into recipient deliveries over email or RSS.
Paths: backend/app/editorial/homepage_builder.py, backend/app/recommendations/pipeline.py, backend/app/newsletter/service.py.
Runtime infrastructure and operations
The deployed stack is Python/FastAPI, Celery scheduling/workers, Next.js/React, PostgreSQL with Alembic migrations, Redis, Docker Compose, and Nginx. Persistent/generated assets, database/cache volumes, logs, monitoring data, and backups are deliberately isolated under runtime/; thumbnail storage uses original/optimized/fallback paths. Backup, recovery, telemetry, leasing, and chaos scenarios indicate production resilience requirements.
Paths: docker-compose.yml, backend/alembic/env.py, backend/app/backup/service.py.
Architecture governance tool
ace/ is a separate Python CLI for architecture discovery, contract/compliance checks, governance policy evaluation, and architecture-graph knowledge. It is not part of the news serving path, but supports enforcement of repository architectural rules and ADR/constitution validation.
Paths: ace/src/cli.py, ace/src/compliance/engine.py, ace/src/governance/engine.py.
Main entry points: projection.py Read models · pipeline.py Ingestion pipeline · ai_pipeline.py AI enrichment · main.py FastAPI service
Components 26
Product Experience
- Next.js application · Public, account, editorial, search, chat, and workspace screens.
frontend/src/app/layout.tsx - Article reader
frontend/src/app/(public)/articles/[slug]/page.tsx - API client · Normalizes backend responses for presentation.
frontend/src/lib/api/client.ts
Content Intelligence
- Publishers
- RSS acquisition
backend/agents/ingestion/rss_agent.py - Ingestion pipeline · Extracts, filters, deduplicates, persists, and manages thumbnails.
backend/app/services/ingestion/pipeline.py - Story formation · Assigns articles, related coverage, and story records.
backend/app/services/ingestion/story_assignment.py - AI enrichment · Builds summaries, topics, entities, embeddings, clusters, and provenance artifacts.
backend/app/ai/ai_pipeline.py - AI provider adapters · Common controlled access to OpenAI, Anthropic, and Gemini.
backend/app/ai/providers/factory.py - Knowledge evolution · Resolves canonical entities, conflicts, duplicates, and graph evolution.
backend/app/services/knowledge_graph/evolution_pipeline.py - Editorial homepage
backend/app/editorial/homepage_builder.py - Recommendations
backend/app/recommendations/pipeline.py - Newsletter delivery · Delivers selected content through email or RSS.
backend/app/newsletter/service.py
Platform Runtime
- FastAPI service · Product service runtime and API boundary.
backend/main.py - v1 product API
backend/app/api/v1/router.py - v2 intents API · Artifact, event, intent, and admin functions.
backend/app/api/v2/routes/intents.py - Event dispatcher · Dispatches domain event envelopes from the write side.
backend/app/core/events/dispatcher.py - Projection engine · Builds and replays UI-facing read models.
backend/app/core/projection/engine.py - Read models · Article, homepage, story, recommendation, analytics, and search views.
backend/app/models/projection.py - PostgreSQL · Persistent write-side records and projection storage.
backend/alembic/env.py - Celery workers · Runs scheduled ingestion and asynchronous operational work.
backend/celery_app.py - Deployment stack · Docker Compose runs application infrastructure including Redis and Nginx.
docker-compose.yml - Backup and recovery
backend/app/backup/service.py
Architecture Governance
- ACE CLI · Separate architecture discovery and compliance command-line tool.
ace/src/cli.py - Compliance checks
ace/src/compliance/engine.py - Governance engine · Evaluates architectural rules, ADRs, and constitution policy.
ace/src/governance/engine.py
Connections 30
- Next.js application → Article reader: renders
- Article reader → API client: uses
- API client → FastAPI service: HTTP
- FastAPI service → v1 product API: serves
- FastAPI service → v2 intents API: serves
- v1 product API → Read models: reads
- v2 intents API → Event dispatcher: commands/events
- Publishers → RSS acquisition: feeds
- RSS acquisition → Ingestion pipeline: fetches content
- Ingestion pipeline → Story formation: articles
- Ingestion pipeline → AI enrichment: enriches
- AI enrichment → AI provider adapters: invokes
- AI enrichment → Knowledge evolution: entities and artifacts
- Story formation → Event dispatcher: publishes
- AI enrichment → Event dispatcher: publishes
- Event dispatcher → Projection engine: dispatches
- Projection engine → Read models: materializes
- Read models → Editorial homepage: content views
- Read models → Recommendations: behavior and corpus
- Editorial homepage → Read models: homepage projections
- Recommendations → Read models: personalized feeds
- Editorial homepage → Newsletter delivery: selected content
- Ingestion pipeline → PostgreSQL: persists
- Read models → PostgreSQL: stores
- Celery workers → Ingestion pipeline: runs asynchronously
- Deployment stack → FastAPI service: deploys
- Deployment stack → Celery workers: deploys
- Backup and recovery → PostgreSQL: backs up
- ACE CLI → Compliance checks: runs
- ACE CLI → Governance engine: runs