<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Architecture on Replay Control</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/</link><description>Recent content in Architecture on Replay Control</description><generator>Hugo</generator><language>en</language><copyright>Copyright (c) 2025 Replay Control</copyright><lastBuildDate>Wed, 01 Jan 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://lapastillaroja.github.io/replay-control/docs/architecture/index.xml" rel="self" type="application/rss+xml"/><item><title>Technical Foundation</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/technical-foundation/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/technical-foundation/</guid><description>&lt;p&gt;The core technical stack and infrastructure that powers Replay Control. For performance-specific design decisions, see 

&lt;a class="link link--text" href="https://lapastillaroja.github.io/replay-control/docs/architecture/design-decisions/"&gt;Design Decisions&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="crates"&gt;Crates&lt;/h2&gt;
&lt;p&gt;The codebase is split into four crates inside a Cargo workspace.&lt;/p&gt;</description></item><item><title>Design Decisions</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/design-decisions/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/design-decisions/</guid><description>&lt;p&gt;Replay Control is a single-user retro game management web UI that runs on Raspberry Pi. Every design decision is shaped by this target environment.&lt;/p&gt;</description></item><item><title>Startup Pipeline</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/startup-pipeline/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/startup-pipeline/</guid><description>&lt;p&gt;&lt;code&gt;BackgroundManager::start()&lt;/code&gt; in &lt;code&gt;replay-control-app/src/api/background.rs&lt;/code&gt; orchestrates an ordered background pipeline and independent filesystem watchers.&lt;/p&gt;
&lt;h2 id="entry-point"&gt;Entry Point&lt;/h2&gt;



&lt;div class="expressive-code"&gt;
 &lt;figure class="frame not-content"&gt;
 &lt;figcaption class="header"&gt;
 &lt;span class="title"&gt;&lt;/span&gt;
 &lt;/figcaption&gt;
 &lt;pre tabindex="0"&gt;&lt;code&gt;BackgroundManager::start(state)
 -&amp;gt; tokio::spawn(run_pipeline) // sequential phases
 -&amp;gt; spawn_storage_watcher() // independent
 -&amp;gt; spawn_rom_watcher() // independent&lt;/code&gt;&lt;/pre&gt;
 &lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;If storage is unavailable at boot, only the storage watcher is spawned. When storage appears (None -&amp;gt; Some transition via &lt;code&gt;refresh_storage()&lt;/code&gt;), the full pipeline starts.&lt;/p&gt;</description></item><item><title>Database Schema</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/database-schema/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/database-schema/</guid><description>&lt;p&gt;Two SQLite databases live at &lt;code&gt;&amp;lt;storage&amp;gt;/.replay-control/&lt;/code&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;metadata.db&lt;/strong&gt; &amp;ndash; rebuildable cache (game library, external metadata, thumbnail index)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;user_data.db&lt;/strong&gt; &amp;ndash; persistent user customizations (never auto-deleted)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Schema defined in &lt;code&gt;replay-control-core-server/src/metadata/metadata_db/mod.rs&lt;/code&gt; and &lt;code&gt;user_data_db.rs&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Server Functions and SSR</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/server-functions-and-ssr/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/server-functions-and-ssr/</guid><description>&lt;p&gt;Defined across &lt;code&gt;replay-control-app/src/main.rs&lt;/code&gt;, &lt;code&gt;src/pages/&lt;/code&gt;, and &lt;code&gt;src/server_fns/&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="leptos-07-ssr-with-wasm-hydration"&gt;Leptos 0.7 SSR with WASM Hydration&lt;/h2&gt;
&lt;p&gt;The app uses server-side rendering with client-side WASM hydration. Four build profiles handle this:&lt;/p&gt;</description></item><item><title>Connection Pooling</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/connection-pooling/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/connection-pooling/</guid><description>&lt;p&gt;Defined in &lt;code&gt;replay-control-app/src/api/mod.rs&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="pool-architecture"&gt;Pool Architecture&lt;/h2&gt;
&lt;p&gt;Each SQLite database gets a &lt;code&gt;DbPool&lt;/code&gt; instance backed by &lt;code&gt;deadpool&lt;/code&gt; with a custom &lt;code&gt;SqliteManager&lt;/code&gt;. The app has two pools:&lt;/p&gt;</description></item><item><title>Enrichment Pipeline</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/enrichment-pipeline/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/enrichment-pipeline/</guid><description>&lt;p&gt;Pure data logic in &lt;code&gt;replay-control-core-server/src/metadata/enrichment.rs&lt;/code&gt;.
App orchestration in &lt;code&gt;replay-control-app/src/api/cache/enrichment.rs&lt;/code&gt; and &lt;code&gt;images.rs&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="architecture-core--app-split"&gt;Architecture: Core / App Split&lt;/h2&gt;
&lt;h3 id="core-replay_control_coreenrichment"&gt;Core (&lt;code&gt;replay_control_core::enrichment&lt;/code&gt;)&lt;/h3&gt;
&lt;p&gt;Pure data pipeline — no web server state, connection pools, or caches:&lt;/p&gt;</description></item><item><title>ROM Classification</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/rom-classification/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/rom-classification/</guid><description>&lt;p&gt;Defined in &lt;code&gt;replay-control-core/src/game/rom_tags.rs&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="romtier-enum"&gt;RomTier Enum&lt;/h2&gt;
&lt;p&gt;ROMs are classified into tiers that determine sort order (lower = shown first) and filtering behavior:&lt;/p&gt;</description></item><item><title>Activity System</title><link>https://lapastillaroja.github.io/replay-control/docs/architecture/activity-system/</link><pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate><guid>https://lapastillaroja.github.io/replay-control/docs/architecture/activity-system/</guid><description>&lt;p&gt;Defined in &lt;code&gt;replay-control-app/src/api/activity.rs&lt;/code&gt;. Provides mutual exclusion for long-running operations and real-time progress broadcasting to the UI.&lt;/p&gt;
&lt;h2 id="design"&gt;Design&lt;/h2&gt;
&lt;p&gt;At most one activity runs at a time. The state is stored in &lt;code&gt;AppState::activity&lt;/code&gt; (&lt;code&gt;Arc&amp;lt;RwLock&amp;lt;Activity&amp;gt;&amp;gt;&lt;/code&gt;) and broadcast to SSE clients via &lt;code&gt;AppState::activity_tx&lt;/code&gt; (a &lt;code&gt;tokio::sync::broadcast&lt;/code&gt; channel).&lt;/p&gt;</description></item></channel></rss>