X (Twitter) Filtered Stream monitor for Iran-related news — Go, SQLite, Redis, ONNX, Ollama
10K+
Monitors X (Twitter) Filtered Stream for Iran-related news. Stores tweets in SQLite, queues through Redis, categorizes via local ONNX models, and runs LLM summarization via Ollama. Pure Go — no Python.
X Filtered Stream (SSE)
│
▼
stream.Client ← connects, normalizes, saves raw tweet to SQLite
│ LPUSH Task per matching action
▼
Redis (iran-watcher:tasks:{action_id})
│ BRPOP
▼
worker.Manager ← N goroutines, each independently BRPOP from ready action queues
│
├─► ActionCache ← hot-reloadable in-memory map of action_id → (Action + Pipeline)
│
├─► ONNX / Ollama / Internal pipelines
│
├─► SQLite (action_executions, action_execution_metadata)
│
├─► Pipeline DAG edge evaluation → downstream tasks pushed to Redis
│
├─► Redis (iran-watcher:failed) ← dead-letter for failures
│
└─► hub.Hub → WebSocket broadcast to connected UI clients
api.Server ← REST API (chi), JWT-authenticated
iran-watcher-mcp ← MCP server (stdio + HTTP/SSE), pure Go
cli ← thin Cobra CLI over the REST API
docker compose build
docker compose up -d
docker compose logs -f iran-watcher
Key environment variables:
| Env var | Description |
|---|---|
IRAN_WATCHER_X_BEARER_TOKEN | X API bearer token (required) |
IRAN_WATCHER_AUTH_JWT_SECRET | JWT signing secret (required) |
ADMIN_USERNAME | Initial admin username |
ADMIN_PASSWORD | Initial admin password |
IRAN_WATCHER_REDIS_ADDR | Redis address (default: localhost:6379) |
IRAN_WATCHER_SQLITE_PATH | SQLite DB path |
IRAN_WATCHER_API_BIND | API bind address (default: 127.0.0.1:8080) |
IRAN_WATCHER_OLLAMA_BASE_URL | Ollama base URL |
IRAN_WATCHER_NOMINATIM_URL | Nominatim reverse geocoder URL |
IRAN_WATCHER_STREAM_AUTO_CONNECT | Auto-connect to X on startup |
IRAN_WATCHER_LOG_LEVEL | Log level: debug/info/warn/error |
LPUSH/BRPOP)gorilla/websocket(trigger_type, action_id, context) Task in Redis; actions chain into Pipeline DAGsiran-watcher-mcp binary exposes all REST endpoints as MCP tools for Claude Code integrationContent type
Image
Digest
sha256:598afdc72…
Size
2.1 GB
Last updated
3 months ago
docker pull amirtheh/iran-watcher