3228fe4ab352b9700e11f8e643e74c7e3645c920
Neue Mail-Templates (lib/mail.js): - sendDemoExpiryReminderMail: 7 Tage vor Ablauf - sendDemoLastDayMail: 1 Tag vor Ablauf (Letzter-Tag-Reminder) - sendDemoExpiredMail: am Ablauftag (setzt Tenant-Status abgelaufen) Cron-Job (lib/expiryJob.js): - node-cron taeglich 08:00 UTC (anpassbar via CRON_EXPIRY_AT) - 3 Windows pruefen, idempotent ueber notified_*_at Timestamp-Spalten - BETWEEN-Fenster [n-1, n] Tage fuer Robustheit DB-Migration (bootstrap.js): - Beim Backend-Start automatisches ALTER TABLE fuer notified_7d_at, notified_1d_at, notified_expired_at (idempotent) Manueller Test: docker exec pfandsystem-demo-backend node -e " import(\"./lib/expiryJob.js\").then(m => m.runExpiryCheck())"
Pfandsystem Demo (Whitelabel)
Whitelabel-Demo des Pfandsystems mit Multi-Tenant-Verwaltung für 30-Tage Demo-Accounts. Basis: borbaecker-pfand.dockly.de — neu aufgesetzt mit Tailwind-UI, ohne Branding.
- Domain: pfandsystem.dockly.de
- Server: 51.15.249.253 (Scaleway, borbaecker-pfand.dockly.de Instanz)
- Pfad auf Server:
/root/pfandsystem-demo - Gitea:
ssh://git@49.13.154.75:2244/christian/pfandsystem-demo.git
Architektur
- Frontend: React 18 + Vite + Tailwind, PWA-fähig
- Backend: Node.js (Express) + MySQL 8 + JWT
- Reverse-Proxy: Traefik v3 (geteilt mit borbaecker + pfandsystem-dev)
- Container:
pfandsystem-demo-{mysql,phpmyadmin,backend,frontend} - Ports (alle 127.0.0.1): MySQL 3308, phpMyAdmin 8083, Backend 3003
Multi-Tenant-Modell
Eine MySQL-DB, jede Datentabelle hat eine tenant_id. Mitarbeiter sind
einem Tenant zugeordnet — Ausnahme: rolle='superadmin' mit tenant_id=NULL,
darf neue Demo-Tenants anlegen.
Demo-Tenants haben typ='demo' + demo_expires_at (default +30 Tage).
Nach Ablauf wird status='abgelaufen' gesetzt (Cron).
Erweiterungen (Iteration 1)
- Kundenbilder & Anlieferungshinweise —
kunden_bilder-Tabelle +kunden.anlieferungshinweis - Seriennummern-Verwaltung —
geraete-Tabelle (Typ, SN, Status, Kunde-Zuordnung) - Tourenplanung Stufe 1 — Navi-Button (Maps-Link),
kunden.lieferzeit_bis
BBN-Schnittstelle vorerst nicht enthalten (klärungsbedürftig).
Deployment
ssh -i ~/.ssh/id_rsa root@51.15.249.253
cd /root/pfandsystem-demo
cp .env.example .env # Werte setzen!
docker-compose up -d --build
# Traefik in das Netzwerk joinen (einmalig):
docker network connect pfandsystem-demo_pfandsystem-demo-net pfandsystem-traefik
Description
Languages
JavaScript
95.7%
Shell
2.2%
CSS
1.2%
Dockerfile
0.5%
HTML
0.4%