Architecture
Rust backend (Yggdrasil) ↔ Svelte 5 frontend (crown) over the Elyra Framework's
typed MessagePack bridge. The Rust binary embeds the built frontend and serves
it from elyra://localhost.
elyra-sja/
├── src/
│ ├── main.rs # App wiring only (~130 lines)
│ ├── app_paths.rs # data dir, DB URL, migration staging, retention/vacuum
│ ├── http.rs # one shared, pooled HTTP client + capped body reads
│ ├── seo.rs # single-page analysis engine (GUI-free)
│ ├── pagespeed.rs # Core Web Vitals via PageSpeed Insights
│ ├── crawl.rs # site crawler (sitemap + BFS, robots, aggregation)
│ ├── fs_tools.rs # sandboxed AI file tools + write confirmation
│ ├── license.rs # offline license validation (ed25519 signature)
│ ├── secrets.rs # macOS Keychain wrapper
│ └── <commands> # settings, licensing, projects, reports, trends,
│ # crawls, monitors, ai, export
├── migrations/ # SQLite migrations (0001–0008)
├── app/ # Vite + Svelte 5 frontend
│ └── src/
│ ├── App.svelte # shell, nav, views, scheduler timer
│ ├── bindings.ts # generated by `rata codegen` — do not edit
│ └── lib/ # Report, SiteReport, Trends, Monitors,
│ # Settings, Lock, ProjectDialog, Icon, …
├── scripts/ # icns, dmg, updater keygen/sign
├── vendor/elyra-framework # the framework, as a git submodule
└── .github/workflows/release.yml
Commands (typed bridge)
Frontend calls Rust through the generated api.* facade. Groups:
- Analysis —
analyze_page,analyze_and_save,get_report,list_reports,recent_reports,delete_report. - Crawl —
crawl_site,list_crawls,get_crawl,get_crawl_page,delete_crawl. - Trends —
url_trends,compare_reports. - Projects —
list_projects,create_project,update_project,delete_project. - Monitors —
tick_monitors,run_monitor_now,list_monitors,create_monitor,toggle_monitor,delete_monitor,list_alerts,unread_alerts,mark_alerts_read. - AI —
run_fix,respond_write. - Settings & license —
get_settings,save_settings,license_status,activate_license. - Export —
open_report.
After changing any
#[command]signature or aspectatype, re-runrata codegenbefore touching the frontend.
Events (Rust → frontend)
Pushed over channels the frontend subscribes to:
crawl— crawl progress (status / per-page / done).ai:fix— AI agent activity (status / tool / write).ai:confirm— pending write-confirmation requests.
Database (SQLite)
| Table | Purpose |
|---|---|
projects |
name, site_url, local_path, created_at |
reports |
per-run page report (JSON payload) + score |
crawls |
per-crawl site report (slim: aggregates + page summaries) |
crawl_pages |
full per-page report for a crawl, fetched on drill-in |
settings |
key/value: app (settings JSON) and license (first-run) |
monitors |
scheduled scans (url, recipe, interval, last run/score) |
alerts |
regression / error / improvement events |
Secrets are not in the database — see Security.