← Feed

Architecture

Static description of the AX-NEWS technical stack — no live metrics.

Request Flow

Browser / Client Cloudflare (CDN + DDoS) HAProxy (TLS termination, ax-lab05:443) Nginx (vhost, static assets, rate limiting) FastAPI / uvicorn (port 8000, 2 workers) PostgreSQL 16 (local socket)

Static assets (CSS, JS, images) are served directly by Nginx from /opt/ax-news/frontend/ without hitting FastAPI. HTML pages go through FastAPI for per-request CSP nonce injection via Jinja2 templates.

Stack

LayerTechnologyRole
Edge / CDNCloudflareDDoS protection, global CDN, Proxy DNS
Load balancerHAProxyTLS termination, HTTP→HTTPS redirect
Web serverNginxStatic files, reverse proxy, rate limiting (login: 5/min, API: 60/min, audio: 10/min)
ApplicationFastAPI + uvicornREST API, Jinja2 HTML rendering, background tasks
DatabasePostgreSQL 16Articles, users, sessions, NLP metadata
RSS ingestionFreshRSS (PHP 8.3)200+ RSS feeds aggregated at /news
TranslationArgos TranslateCJK/Korean titles translated to English — runs as a standalone systemd service to avoid OOM in uvicorn
Audio summariesOllama (qwen2.5:3b) + Piper TTSFrench oral summaries generated on-demand — Ollama runs on bare-metal host (.37), Piper synthesises WAV via subprocess (not inline in uvicorn)
EnrichmentKeyword analysis (Python)Entity extraction, sentiment classification, country tagging — runs at sync time
Hostingax-lab05 VM (~3.8 GB RAM)Single Linux VM, all services via systemd

Audio Summary Pipeline

User clicks "Listen" GET /api/articles/{id}/audio FastAPI checks audio_status in DB
    If 'none'/'failed': locks row → launches asyncio background task
    Task: Ollama (.37) → French summary (~120 words) Piper subprocess → WAV file
    Frontend polls every 2s until status = 'done' Audio plays in browser

Data Flow — Article Lifecycle

Security Notes

This page is intentionally static and descriptive. It does not expose live system metrics (CPU, RAM, disk, hostname). A previous /api/metrics endpoint was removed because it disclosed server internals without authentication.

Source Code

The full source is available on GitHub: github.com/plkarin/ax-news (MIT license).