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
+3
-3
@@ -108,8 +108,8 @@ and the dev overlay mounts that folder into PocketBase (`./pb/pb_migrations:/pb_
|
||||
|
||||
| File | Role |
|
||||
|---|---|
|
||||
| `collections_schema.json` | The five content collections (`pages`, `posts`, `events`, `faq_topics`, `faqs`) as PocketBase exports them. **The single source of truth for the schema** — the test fixture imports this same file. |
|
||||
| `<timestamp>_dev_seed.js` | The PocketBase migration. Reads the schema file, creates any missing collection, then inserts the example records. |
|
||||
| `collections_schema.json` | The content collections (`pages`, `posts`, `events`, `faq_topics`, `faqs`, `documents`) as PocketBase exports them. **The single source of truth for the schema** — the test fixture imports this same file. |
|
||||
| `<timestamp>_dev_seed.js` | The PocketBase migration. Reads the schema file, creates any missing collection, then inserts the example records. The example `documents` get a one-page PDF generated at seed time, so the repo holds no binary files. |
|
||||
|
||||
Both steps are **idempotent**: a collection is created only if it is missing, and
|
||||
filled only while it is empty. So a populated volume — or the production DB, should
|
||||
@@ -131,7 +131,7 @@ The seed is generated from a running dev instance, not hand-edited. When you
|
||||
change a collection's schema in the admin UI, or want to capture the current
|
||||
example content as the new seed, re-export from the running dev PocketBase
|
||||
(authenticated as the dev superuser) and regenerate the two files. The schema file
|
||||
is the plain export of the four collections; the migration embeds the records the
|
||||
is the plain export of the collections; the migration embeds the records the
|
||||
same way. After regenerating, prove it end to end:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in new issue
Block a user