Commit Graph

9 Commits

Author SHA1 Message Date
MBO-Tech-IT 60af2e1621 fix: add IP rate limiting and guard non-string email in flyer route
Adds an in-memory, IP-based fixed-window rate limit (max 3 req/hour)
to app/api/familyguard-flyer/route.ts to mitigate an email-spam/abuse
vector where any client could trigger outbound emails and DB inserts
with no limit. Also guards against a non-string `email` field in the
request body, which previously threw an uncaught TypeError (HTTP 500)
instead of the intended 400 validation response.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhY1QhDXGWfyhrxaJvfpNt
2026-07-21 14:12:50 +02:00
MBO-Tech-IT 7c04450b57 feat: add API route for FamilyGuard flyer email-gate download
Creates POST /api/familyguard-flyer endpoint that validates email format
and DSGVO consent, records download intent in Supabase flyer_downloads table,
and sends notification and download link emails (fire-and-forget) before
returning the flyer download URL.

Implements Task 4 of 7-task email-gated flyer download feature.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhY1QhDXGWfyhrxaJvfpNt
2026-07-21 11:36:37 +02:00
MBO-Tech-IT b9aa6a0a54 feat: set MBO-Tech-IT defaults in hero and add CMS links to admin nav
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 20:33:37 +02:00
MBO-Tech-IT 20f8a0a0f0 fix: use admin_users table in passwort route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 20:32:53 +02:00
MBO-Tech-IT 5b82ad93b3 feat: add website-cms module files
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-02 20:32:24 +02:00
MBO-Tech-IT 2a91084737 feat: send confirmation email to contact form submitter
Schickt nach eingehender Anfrage automatisch eine Bestätigungsmail an
den Anfragenden mit Betreff, Dankestext und direkter Telefonnummer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-28 09:12:48 +02:00
MBO-Tech-IT 9e56f1b5a3 feat: integrate modules 01–03, 06–07 — email, admin auth, analytics, kunden-portal, statistik
- Modul 01 (Email): mailer.ts mit Nodemailer + Supabase-Queue, SMTP-Test-Route
- Modul 02 (Admin-Auth): JWT-Sessions, Rate-Limiting, Token-Blacklist, Audit-Logs, Login-Route
- Modul 03 (Analytics): PageTracker, page_views/phone_clicks Tracking, Admin-Analytics-Seite
- Modul 06 (Kunden-Portal): Supabase Auth Login/Registrierung, Kundendashboard, Middleware
- Modul 07 (KPI-Dashboard): Admin-Statistik mit Anfragen-Übersicht und Monats-Diagramm
- contact/route.ts: speichert Anfragen jetzt in Supabase
- Supabase-Types für alle neuen Tabellen ergänzt
- app/admin/page.tsx: Redirect zu /admin/analytics
- AnalyticsTabs: Design-Inkonsistenz behoben (Light-Mode-Karten auf Dark umgestellt)
- layout.tsx: Umlauts-Fehler in Metadata-Description behoben
- lib/audit-log.ts: TypeScript null→undefined Mapping für reason-Feld
- modules/: Wiederverwendbare Modul-Templates mit Migrations und Integrations-Prompts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-27 19:41:05 +02:00
MBO-Tech-IT 9c7f78464b feat: add contact form submission with send confirmation
API route /api/contact calls sendeKontaktEmail and returns ok/error.
On total failure (no SMTP, no queue) logs full contact data to server log.
Contact.tsx is now a client component: shows spinner while sending,
success state ("Anfrage gesendet") on ok, error banner with message on failure.
queueEmail now returns boolean; sendWithFallback returns { sent, queued }.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 15:23:30 +02:00
MBO-Tech-IT 1369e831ad feat: integrate email-system module (nodemailer + queue)
Adds lib/mailer.ts (sendeKontaktEmail, MBO-Tech-IT branding),
lib/email-queue.ts (Supabase-fallback, graceful no-op when not configured),
lib/supabase.ts (stub for later integration), admin API routes for
SMTP-test and queue management, and instrumentation.ts for the queue worker.
Excludes modules/ from TypeScript compilation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:56:36 +02:00