app: uploaded images for announcements, campaigns and events (APP-1.0-PLAN §10)

Photos (JPEG, PNG, WebP, checked by their bytes) uploaded in the admin are
turned upright, stripped of their metadata and kept at most 2000 px wide in
backend/uploads (UPLOAD_DIR), served at /api/uploads (never a listing, a
sandboxing CSP). Content keeps the image's full address, so an upload and an
image from elsewhere work alike. 5 GB included or the licence's storage
limit; an image still in use can't be deleted. The announcement, campaign
and event forms get Upload a photo next to the address. Migration media.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-01 14:47:33 +02:00
co-authored by Claude Opus 5.5
parent 13eaaffb95
commit c934f47b28
15 changed files with 337 additions and 4 deletions
@@ -0,0 +1,22 @@
-- Church App 1.0.0: uploads (docs/APP-1.0-PLAN.md §10): images uploaded in the admin.
-- CreateTable
CREATE TABLE "MediaAsset" (
"id" TEXT NOT NULL,
"filename" TEXT NOT NULL,
"mime" TEXT NOT NULL,
"bytes" INTEGER NOT NULL,
"width" INTEGER,
"height" INTEGER,
"alt" TEXT NOT NULL DEFAULT '',
"uploadedBy" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "MediaAsset_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "MediaAsset_filename_key" ON "MediaAsset"("filename");
-- CreateIndex
CREATE INDEX "MediaAsset_createdAt_idx" ON "MediaAsset"("createdAt");