Bucht der Träumer* – Festival PWA
Offline-capable festival guide PWA. Choose start page, internal or remote pages, and sync for offline use.
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kniessner/festival-pwa/archive/refs/heads/main.zip🎪 Bucht der Träumer* – Festival PWA Plugin
Offline-capable Progressive Web App for festival websites. Fetches live content from the main WordPress site, lets admins pick which pages to cache, and serves them as an installable mobile app.
Features
- Dynamic page selector – Admin chooses which WP pages are included
- Auto-sync – Fetches and caches content every 6 hours via WP Cron
- Manual sync – One-click refresh in admin settings
- Background sync – Runs one page per cron step to avoid timeouts on large sites
- Offline-first – Service Worker precaches shell + selected pages
- Snapshot mode – Builds a self-contained offline mirror of a page (HTML + CSS + images)
- Real design – Downloads background images and design tokens from source site
- Heuristic parsing – Auto-detects FAQ vs Grid vs Generic layouts
- PWA installable – Add to home screen on iOS/Android
Architecture
Plugin
├── Admin Settings ← Page selector, source URL, app name
├── Content Sync ← Fetches HTML, extracts content, saves JSON
├── REST API ← Serves manifest + page JSON + design tokens
├── PWA Frontend ← Vanilla JS app shell, no build step
└── Service Worker ← Dynamic cache based on selected pages
Install
- Copy
festival-pwa/folder towp-content/plugins/ - Activate in WP Admin → Plugins
- Go to Settings → Festival PWA
- Enter source URL (e.g.
https://bucht-der-traeumer.de) - Tick the pages you want in the PWA
- Click 🔄 Sync Content Now
- Visit
https://yoursite.com/pwa/on mobile → Add to Home Screen
Admin Settings
| Setting | Purpose |
|---|---|
| Source Website URL | The WP site to scrape content from |
| App Name | Shown in PWA title bar and install prompt |
| Select Pages | Add pages, choose source, and extraction mode |
| Extraction Mode | Snapshot / Raw HTML / Structured text |
| Urgent Announcement | Banner shown on PWA load |
| Sync Now | Manual trigger to fetch all selected pages |
REST API Endpoints
| Endpoint | Returns |
|---|---|
GET /wp-json/festival/v1/manifest |
App name + list of included pages |
GET /wp-json/festival/v1/pages/{slug} |
Cached JSON content for that page |
GET /wp-json/festival/v1/design |
Design tokens + asset URLs |
POST /wp-json/festival/v1/sync |
Trigger manual sync (admin only) |
Supported Page Types / Extraction Modes
Each PWA page can use one of three extraction modes:
| Mode | What it does | Best for |
|---|---|---|
| Snapshot | Downloads the page HTML, CSS, and images into a self-contained offline file (pwa/snapshots/{slug}.html) |
Complex layouts like /programm-2026 with timetable filters |
| Raw HTML | Keeps original <main> markup + styles, rendered inside a Shadow DOM |
Pages that need original styling but not all assets offline |
| Structured | Auto-detects FAQ / Grid / Generic and extracts clean text | Simple info pages, FAQ, lists |
The sync engine auto-detects layout only in Structured mode:
| Type | Detection | Example |
|---|---|---|
| FAQ | Multiple h2/h3 + long paragraphs | /cashless |
| Grid | Multiple h3 with short descriptions | /performances, /workshops |
| Generic | Fallback – full text content | /info, /kontakt |
File Structure
festival-pwa/
├── festival-pwa.php ← Plugin bootstrap
├── admin/
│ ├── admin.css ← Admin styles (page selector grid)
│ └── admin.js ← Checkbox visual toggle
├── includes/
│ ├── class-content-sync.php ← Fetch, extract, save, design sync
│ ├── class-rest-api.php ← WP REST endpoints
│ ├── class-pwa-frontend.php ← Route /pwa/ to app shell
│ └── class-admin.php ← (optional extended admin)
├── pwa/
│ ├── index.html ← App shell (cosmic design)
│ ├── js/app.js ← Dynamic frontend (fetches manifest)
│ ├── sw.js ← Service Worker (dynamic cache)
│ ├── manifest.json ← PWA install manifest
│ ├── images/ ← Downloaded design assets
│ │ ├── bg.jpg ← Background from source WP
│ │ └── datum.png ← Logo/date image
│ ├── snapshots/ ← Self-contained offline page mirrors
│ │ └── programm-2026.html
│ ├── cache/ ← Downloaded CSS/images for snapshots
│ └── data/ ← Cached JSON per page
│ ├── _manifest.json ← Page list + app config
│ ├── cashless.json
│ ├── performances.json
│ └── workshops.json
└── icons/
├── icon-192.png
└── icon-512.png
How It Works
- Admin selects pages in settings → saved as
festival_pwa_selected_pages - Sync runs (manual or cron) →
class-content-sync.phpfetches each page - HTML is parsed → heuristic detects FAQ/Grid/Generic → structured JSON saved
- Design assets downloaded → background image, logo cached locally
- Manifest written →
_manifest.jsonlists included pages for the PWA - PWA loads →
app.jsfetches manifest, builds nav, loads pages via REST API - Service Worker → precaches shell + manifest + selected page JSON
- Offline mode → all content served from cache, no internet needed
Customization
Adding more page options
Edit the $default_pages array in festival-pwa.php:
private $default_pages = [
['slug' => 'cashless', 'label' => 'Cashless', 'icon' => '💳'],
['slug' => 'performances', 'label' => 'Acts', 'icon' => '🎭'],
// Add your own...
];
Changing the design
The PWA fetches design tokens automatically:
- Background:
pwa/images/bg.jpg - Logo:
pwa/images/datum.png - Colors: Navy
#080943, Pink#b0327a, Orange#ff6f21 - Fonts: Lato + Space Grotesk
Replace images in pwa/images/ after sync, or edit CSS variables in pwa/index.html.
Troubleshooting
| Problem | Fix |
|---|---|
| "No pages selected" | Go to Settings → Festival PWA → tick checkboxes → Save |
| "Page not cached" | Click Sync Content Now or wait for cron |
| Background not showing | Check pwa/images/bg.jpg exists after sync |
| Offline not working | Check Service Worker registered in browser DevTools → Application |
License
MIT – Festival Tech 2026