ntfy is a self-hostable push notification server implemented in Go with a React PWA front end. It exposes an HTTP API where clients publish messages with PUT/POST to a topic; subscribers receive them over WebSocket, SSE, or long polling. The server goes beyond basic pub-sub: it caches messages in SQLite, PostgreSQL, or memory, supports file/S3 attachments, and fans out to Firebase Cloud Messaging, Web Push, email via SMTP, Twilio calls, and Matrix. A full account system with tiers, ACLs, tokens, reservations, and Stripe billing sits alongside abuse controls like visitor rate limiting and IP bans. The repository also contains a Go client library and CLI for publishing and subscribing. Architecturally, this is a single Go binary with a build-tag feature matrix (e.g. noserver, nofirebase, nowebpush, nopayments) plus a React/Vite SPA served by the same process. Storage is backend-agnostic through interfaces: message.Cache, attachment.Store, user.Manager, and webpush.Store each have SQLite and PostgreSQL implementations, with schema migrations managed by a shared db/schema framework. The code stands out for extensive table-driven tests across both database backends, race-condition coverage, and careful security work such as template execution limits, Web Push endpoint allowlists, and a custom SigV4 S3 signing implementation. Main weaknesses are large central files, duplicated SQL for SQLite/PostgreSQL, and vendored forks of text/template and sprig that require manual synchronization with upstream.
TrendRadar is a configurable news aggregation and trend analysis system that crawls hot lists from 11+ Chinese platforms (Zhihu, Weibo, Douyin, Bilibili, etc.) and RSS/Atom feeds, filters content via keyword DSL or AI-based interest matching, performs AI-powered analysis (sentiment, controversy, topic trends), generates rich HTML reports, and pushes notifications to 9+ channels (Feishu, DingTalk, Telegram, Email, ntfy, Bark, Slack, WeCom, generic webhook). It is primarily an application (with CLI entry points, scheduling via timeline.yaml, Docker/GitHub Actions deployment) but incorporates data-pipeline patterns such as multi-stage ETL (crawl → store → filter → analyze → report), SQLite storage with optional S3 remote sync, and AI batch processing. The architecture is a modular monolith: the core `trendradar` package handles all orchestration, while a separate `mcp_server` package exposes 20+ tools via Model Context Protocol (MCP) for LLM integration. The system is heavily config-driven (YAML and text files) and includes a standalone web-based config editor. External dependencies include the third-party newsnow API (for hot lists), LiteLLM (for AI model abstraction), and various notification service APIs. The codebase demonstrates good craftsmanship with clean abstractions (storage backends, notification dispatcher, AI client), though some duplication exists between the core and MCP notification logic, and the extensive configuration surface requires careful maintenance.