Skip to content

Add Immich photo storage backend with demo page and connection settings#39

Open
peter-intellitect with Copilot wants to merge 1 commit into
mainfrom
copilot/create-image-storage-solution
Open

Add Immich photo storage backend with demo page and connection settings#39
peter-intellitect with Copilot wants to merge 1 commit into
mainfrom
copilot/create-image-storage-solution

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Adds Immich as a photo storage backend with a configurable connection, an upload-through-middleware flow, and a gallery whose image bytes are fetched directly from Immich by the browser (never proxied through PRM).

Backend (server/routes.ts)

  • New keys in app_settings: immich_enabled, immich_url, immich_api_key (reusing the existing key/value table — no schema changes).
  • GET/POST /api/immich/settings — read/write config; API key never returned, only hasApiKey.
  • POST /api/immich/test — auth + connectivity check via Immich /api/users/me.
  • POST /api/immich/upload (multipart) — forwards to Immich /api/assets with x-api-key, then inserts into the photos table with prmLocation = "immich_demo:<assetId>" and location = <url>/api/assets/<assetId>/original.
  • GET /api/immich/assets — proxies /api/search/metadata to list recent IMAGE assets.
  • GET /api/immich/client-config — returns { enabled, url, apiKey } to authenticated clients so the browser can call Immich directly for image bytes.

Frontend

  • pages/immich-settings.tsx at /settings/immich (under App Options): enable toggle, URL, API key, single Save and test button.

  • pages/immich-demo.tsx at /immich-demo: drop-zone upload via /api/immich/upload; thumbnail grid where each tile fetches directly from Immich:

    const resp = await fetch(`${url}/api/assets/${assetId}/thumbnail?size=preview`, {
      headers: { "x-api-key": apiKey },
    });
    setSrc(URL.createObjectURL(await resp.blob()));
  • Main sidebar entry for "Immich Demo" is conditional on immich_enabled. Settings sidebar, router, and page-title wired up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants