Skip to content

Development and Architecture

Alex Phillips edited this page Aug 17, 2026 · 3 revisions

Development and Architecture

FolderView Plus is an Unraid webGUI plugin with PHP endpoints, browser runtimes, persistent JSON configuration on the flash device, shared contracts, and generated Slackware packages.

Repository map

Path Purpose
src/folderview.plus/ Source copied into the installed plugin package.
src/.../usr/local/emhttp/plugins/folderview.plus/ Deployed plugin root layout.
scripts/ CI, guards, packaging, smoke tests, and maintenance tools.
tests/ Contract, regression, lifecycle, integration, privacy, workflow, and browser tests.
docs/ User, architecture, security, compatibility, and release documentation.
archive/ Generated versioned .txz packages and checksum files.
asset-packs/ Independently versioned icon assets.
folderview.plus.plg Unraid plugin manifest and install/update/remove hooks.
pkg_build.sh Authoritative package builder.

Major layers

Layer Responsibility
Page integration Loads assets into Settings, Docker, VMs, Dashboard, and folder editor.
Host adapters Find native structures, observe host changes, and expose lifecycle hooks.
Runtime state Normalize inventory, resolve membership/order, render groups, and reconcile changes.
Settings/editor Edit folders/preferences and orchestrate previewed workflows.
Request client Tokens, nonces, trace IDs, encoding, timeouts, parsing, uploads, and errors.
Endpoint contract Declares methods, guards, content types, limits, parameters, response types, and audit category.
Durable storage Validates and atomically commits configuration/recovery data with last-good support.
Shared UI Buttons, fields, dialogs, confirmations, status, progress, empty/loading states.
Localization Versioned namespaces, English fallback, generated coverage, aliases.
Diagnostics Build, health, storage, localization, theme, telemetry, integrity, and sanitized support data.
Packaging Core archive, manifest/checksums, release notes, and separate icon pack.

Request flow

  1. A page calls the shared browser request client.
  2. The client attaches request protection and trace metadata.
  3. The PHP endpoint resolves its declaration from server/api-endpoints.json.
  4. Shared runtime enforces method, content type, size, parameters, mutation guard, and response contract.
  5. Domain validation runs.
  6. Durable mutations commit through shared storage.
  7. Responses/activity preserve bounded trace, transaction, and audit context.

Runtime lifecycle

Docker and VM adapters preserve native content during bootstrap, load a coherent snapshot, then render folders. Structural changes can rebuild grouping; lifecycle changes reconcile incrementally. Timers, observers, event listeners, requests, and host hooks must be torn down on navigation/pagehide to prevent duplicate behavior.

Dashboard consumes the same normalized folder/inventory contracts but renders cards. Settings and editor use shared request/UI primitives rather than separate ad-hoc protocols.

Durable configuration

Docker and VM maps/preferences are separate. Writes use validated sibling temporary files, flush where supported, and atomic rename. Metadata tracks revisions; last-good mirrors support recovery from malformed current JSON. Batch operations validate the plan before a single guarded commit.

Architectural decisions

The repository records long-lived decisions for branch/package integrity, browser compatibility, native Docker safe mode, diagnostics privacy, and artifact storage under docs/adr.

Authoritative references

Clone this wiki locally