$ show gestaogovbr/Ro-dou
Ro-DOU is an Apache Airflow-based system for automated clipping and monitoring of Brazilian official gazettes, primarily the DiΓ‘rio Oficial da UniΓ£o (DOU) and municipal gazettes via Querido DiΓ‘rio. It dynamically generates Airflow DAGs from declarative YAML configuration files, allowing users to define search terms, notification channels (email, Slack, Discord, Apprise), and optional AI-powered summaries using OpenAI, Gemini, Claude, or Azure. The architecture is modular: a central DAG generator creates workflows that execute search tasks via multiple backends (DOU API, INLABS OpenSearch/SQL, Querido DiΓ‘rio API, DOESP API), group results, and deliver formatted reports. The system includes a CLI and web-based YAML generator for configuration, extensive documentation, and Helm charts for Kubernetes deployment. While robust in functionality, it relies on several external APIs with fragile parsing logic and maintains legacy code paths (e.g., INLABS SQL mode), introducing moderate technical drift. Reusable components include a clean notification interface pattern, an OpenSearch query builder, and a provider-agnostic AI runner.
The LLM identified 4 files worth highlighting for reuse:
Defines the ISender abstract base class with a single `send()` method, providing a clean contract for all notification senders (email, Slack, Discord, Apprise). This pattern enables easy addition of new channels without modifying existing senders, and can be extracted to any project needing polymorphic notification dispatch.
Builds complex OpenSearch boolean queries with named clauses for term matching. The builder pattern encapsulates clause construction and allows chaining of conditions, making it reusable for any OpenSearch-based search application. It is independent of the rest of the Ro-DOU codebase and can be extracted with minimal adaptation.
Provides a unified interface for executing LLM prompts across OpenAI, Gemini, Claude, and Azure. It normalizes finish reasons and abstracts provider-specific API calls, making it directly reusable in any project needing multi-provider AI support. The runner is decoupled from the rest of the system and requires only a configuration dictionary.
Manages Jinja2 template rendering for email notifications, including custom filters (e.g., markdown with nh3 sanitization). It separates content generation from delivery, and its template infrastructure is easily reusable for any notification or report generation task. The class is self-contained and depends only on standard libraries and Jinja2.