README.md
SourceMonitor is a production-ready Rails 8 mountable engine for ingesting, normalising, scraping, and monitoring RSS/Atom/JSON feeds. It ships with a Tailwind-powered admin UI, Solid Queue job orchestration, Solid Cable realtime broadcasting, and an extensible configuration layer so host applications can offer full-stack feed operations without rebuilding infrastructure.
Note: Application developers consume SourceMonitor via RubyGems—add the gem to your host application's Gemfile and follow the guided installer. Clone this repository only when contributing to the engine itself.
In your host Rails app:
bundle add source_monitor --version "~> 0.13.0"
# or add `gem "source_monitor", "~> 0.13.0"` manually, then run:
bundle install
This exposes bin/source_monitor (via Bundler binstubs) so you can run the guided workflow described below.
SourceMonitor::Metrics counters/gaugesStatusBadgeComponent and IconComponent for consistent badge and icon rendering in custom viewsSourceDetailsPresenter and SourcesFilterPresenter for view-specific formatting without coupling controllers to display logicCommand prefixes: Examples below show bare
bundle,bin/rails, andbin/source_monitor. If you use rbenv/asdf or containerized tooling, prefix/adjust commands accordingly so they run inside your Ruby environment.
Before running any SourceMonitor commands inside your host app, add the gem and install dependencies:
bundle add source_monitor --version "~> 0.13.0"
# or edit your Gemfile, then run
bundle install
bin/rails source_monitor:setup:checkbin/source_monitor install --yes
/source_monitor), adds the gem entry when missing, runs bundle install, npm install (when package.json exists), copies/deduplicates migrations, patches the initializer, and runs verification.bin/rails solid_queue:start and, if you use recurring jobs, bin/jobs --recurring_schedule_file=config/recurring.yml.bin/source_monitor verify (also exposed as bin/rails source_monitor:setup:verify). The command prints a human summary plus JSON so CI can gate on Solid Queue and Action Cable health.See docs/setup.md for the full workflow (prereq table, gem installation, rollback steps, telemetry flag, Devise system test template).
Prefer explicit Rails generator steps or need to customize each phase? The same document covers a full Manual Installation section so you can copy/paste each command into bespoke pipelines.
Troubleshooting advice lives in docs/troubleshooting.md.
Gemfile and run bundle install (or bundle update source_monitor when targeting a specific release).bin/rails railties:install:migrations FROM=source_monitor and then bin/rails db:migrate to pick up schema changes.config/initializers/source_monitor.rb against the newly generated template for configuration diffs (new queue knobs, HTTP options, etc.).mission_control-jobs stays mounted and linked via config.mission_control_dashboard_path.bin/source_monitor verify so CI/deploys confirm workers/cable health before rollout.examples/basic_host/template.rb – Minimal host that seeds a Rails blog source and redirects / to the dashboard.examples/advanced_host/template.rb – Production-style integration with Mission Control, Redis realtime, Solid Queue tuning, and metrics endpoint.examples/custom_adapter/template.rb – Registers the sample Markdown scraper adapter and seeds a Markdown-based source.examples/docker – Dockerfile, Compose stack, and entrypoint script that run any generated example alongside Postgres and Redis.See examples/README.md for usage instructions.
SourceMonitor::Fetching::FetchRunner coordinates advisory locking, fetch execution, retention pruning, and scrape enqueues. Source models store health metrics, failure states, and adaptive scheduling parameters.SourceMonitor::Items::RetentionPruner, SourceMonitor::Scraping::Enqueuer, and SourceMonitor::Scraping::ItemScraper keep content fresh, ensure deduplicated storage, and capture scrape metadata/logs.SourceMonitor::Scrapers::Base, merging default + source + invocation settings and returning structured results. The bundled Readability adapter composes SourceMonitor::Scrapers::Fetchers::HttpFetcher and SourceMonitor::Scrapers::Parsers::ReadabilityParser.SourceMonitor::Dashboard::Queries batches SQL, caches per-request responses, emits instrumentation (source_monitor.dashboard.*), and coordinates Turbo broadcasts via Solid Cable.SourceMonitor::Metrics tracks counters/gauges for fetches, scheduler runs, and dashboard activity. ActiveSupport notifications (source_monitor.fetch.*, source_monitor.scheduler.run, etc.) let you instrument external systems without monkey patches.SourceMonitor.configure exposes namespaces for queue tuning, HTTP defaults, scraper registry, retention, event callbacks, model extensions, authentication hooks, realtime transports, health thresholds, and job metrics.:async adapter. Three queues are used: source_monitor_fetch (FetchFeedJob, ScheduleFetchesJob), source_monitor_scrape (ScrapeItemJob), and source_monitor_maintenance (health checks, cleanup, favicon, images, OPML import). All honour ActiveJob.queue_name_prefix.config/recurring.yml schedules minute-level fetches and scrapes. Run bin/jobs --recurring_schedule_file=config/recurring.yml (or set SOLID_QUEUE_RECURRING_SCHEDULE_FILE) to load recurring tasks. Disable with SOLID_QUEUE_SKIP_RECURRING=true.SourceMonitor.configure.fetching. Scheduler batch size (default 25) and stale fetch timeout (default 5 minutes) are configurable for small-server deployments. Fetch completion events and item processors allow you to chain downstream workflows (indexing, notifications, etc.).The generated initializer documents every setting. Key areas:
SourceMonitor.queue_name(:fetch), :scrape, :maintenance)config.scrapers.register(:my_adapter, "MyApp::Scrapers::Custom"))config.retention.items_retention_days, config.retention.strategy)config.events.after_item_created, config.events.register_item_processor)config.realtime.adapter = :solid_cable | :redis | :async)config.authentication.authenticate_with, authorize_with, etc.)config.mission_control_enabled, config.mission_control_dashboard_path)See docs/configuration.md for exhaustive coverage and examples.
SourceMonitor ships 15 engine-specific Claude Code skills (sm-* prefix) that give AI agents deep context about the engine's domain model, configuration DSL, pipeline stages, and testing conventions. Skills are bundled with the gem and installed into your host app's .claude/skills/ directory.
bin/rails source_monitor:skills:install # Consumer skills (host app integration)
bin/rails source_monitor:skills:contributor # Contributor skills (engine development)
bin/rails source_monitor:skills:all # All skills
bin/rails source_monitor:skills:remove # Remove all sm-* skills
The guided installer (bin/source_monitor install) also offers to install consumer skills as part of the setup workflow.
bin/rails db:migrate./cable through your load balancer.SourceMonitor::Metrics and subscribe to notifications for alerting.More production guidance, including process topology and scaling tips, is available in docs/deployment.md.
Common installation and runtime issues (missing migrations, realtime not streaming, scraping failures, queue visibility gaps) are documented in docs/troubleshooting.md. When you report bugs, include your SourceMonitor::VERSION, Rails version, configuration snippet, and relevant fetch/scrape logs so we can reproduce quickly.
bundle install and npm install (prefix with rbenv exec if using rbenv).test/dummy/bin/dev to boot the dummy app with npm CSS/JS watchers, Solid Queue worker, and Rails server.bin/test-coverage (SimpleCov-enforced), bundle exec rake app:test:smoke for the fast subset, or bin/rails test for targeted suites.bin/rubocop, bin/brakeman --no-pager, bin/lint-assets.test/vcr_cassettes/ and keep coverage ≥ 90% for new code.Contributions follow the clean architecture and TDD guidelines in CLAUDE.md and AGENTS.md.
SourceMonitor is released under the MIT License.