Serve downloadable PDFs from a PocketBase documents collection
- New collection "documents" (title, slug, file, category, order, public); editors upload PDFs in the admin, no developer or redeploy needed - The app serves each file at /dokumente/<slug>.pdf, a URL that survives a new upload (PocketBase's own file name gets a random suffix) - New "documents" embed lists them as file cards, grouped by category; /downloads uses it - List/view rules are "public = true", so a draft PDF is not reachable through the PocketBase API either - Dev seed adds example documents with generated PDFs and fixes the const reassignment that broke seeding a fresh volume - Docs: editor guide, architecture, and the manual production setup steps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
97321e2b49
commit
f1a06956f7
18 files changed
+641
-31
No files matched your search
+6
-4
@@ -28,8 +28,10 @@ architecture. Never global.
|
||||
## AE-2: Content in PocketBase, read per request (revised)
|
||||
|
||||
**Decision:** All visible content lives in **PocketBase** (collections `pages`,
|
||||
`posts`, `events`, `faq_topics`, `faqs`); the app reads it over the REST API per
|
||||
request via a typed `PocketBaseClient`. Documents remain PDFs under `wwwroot`.
|
||||
`posts`, `events`, `faq_topics`, `faqs`, `documents`); the app reads it over the
|
||||
REST API per request via a typed `PocketBaseClient`. Downloadable PDFs are uploads in
|
||||
`documents`; the app passes them through at `/dokumente/<slug>.pdf`, a URL that stays
|
||||
stable when an editor uploads a new version (PocketBase's own file URL does not).
|
||||
|
||||
**Original decision (stage 1):** Content as files in the repo — Markdown with YAML
|
||||
frontmatter, events as `Content/events.yml`. The rationale then was: no DB backup,
|
||||
@@ -51,8 +53,8 @@ the content — the backup is now `pb_data` (see AE-3 and `deployment.md`).
|
||||
## AE-3: Content lives in PocketBase's `pb_data`, not baked into the image (revised)
|
||||
|
||||
**Decision:** The editable content lives in PocketBase's `pb_data`, a persistent
|
||||
volume separate from the app image. Only the static assets under `wwwroot/` (CSS,
|
||||
fonts, PDFs) are baked into the image.
|
||||
volume separate from the app image, uploaded PDFs included. Only the static assets
|
||||
under `wwwroot/` (CSS, fonts, images) are baked into the image.
|
||||
|
||||
**Original decision (stage 1):** `Content/` and `wwwroot/` were both baked into the
|
||||
image, deliberately **not** a mounted volume, so the live state could never drift
|
||||
|
||||
Reference in new issue
Block a user