Skip to content

Fotos & Erinnerungen: Bild-Pipeline, Media-Tabelle, Karten-Fotos, Code-Splitting, Backups#1

Open
chicohaager wants to merge 6 commits into
mainfrom
feat/photo-media
Open

Fotos & Erinnerungen: Bild-Pipeline, Media-Tabelle, Karten-Fotos, Code-Splitting, Backups#1
chicohaager wants to merge 6 commits into
mainfrom
feat/photo-media

Conversation

@chicohaager

@chicohaager chicohaager commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Macht TravelMind zu einer belastbaren App für Urlaubserinnerungen: Fotos werden vollwertige Entitäten mit Metadaten, sind auf der Karte sichtbar, durchsuchbar, laden schneller — und es gibt ein verifiziertes Backup/Restore für die unersetzlichen Daten.

Was drin ist

1. Bild-Pipeline — gemeinsame Utility für alle Uploads: Validierung, Auto-Rotation (EXIF), Resize, WebP, Thumbnails, EXIF (Aufnahmedatum + GPS); HEIC/HEIF via pillow-heif; Frontend-Galerien mit Thumbnails + Lazy-Loading.

2. Media-Tabelle (Source-of-Truth) — Fotos mit Caption, taken_at, GPS, Maßen, Reihenfolge; idempotenter Backfill (run_migrations + Alembic 0002); /api/media-Endpunkte; sauberer Cutover mit abgeleitetem photos[]; PDF- und DSGVO-Export nutzen Media; Caption-Inline-Edit in der Diary-Lightbox.

3. Geo-Fotos auf der Karte — geotaggte Tagebuch-Fotos als Thumbnail-Marker (Toggle). Fix: TripMap nutzte ein nicht existierendes placesService.getByTrip -> getPlaces.

4. VolltextsucheGET /api/search über Reisen/Tagebuch/Orte/Captions, gruppiert + gerankt; Postgres FTS mit SQLite-ILIKE-Fallback, GIN-Indizes (Alembic 0003); debounced Navbar-Dropdown.

5. Performance — Route-Level-Code-Splitting (React.lazy, Stale-Chunk-Reload). Haupt-Bundle ~694 KB -> ~315 KB.

6. Backup/Restorebackup_database.py sichert DB + Uploads; neues restore_database.py (mit Bestätigung); docs/BACKUP.md inkl. cron, 3-2-1 und ZimaOS-Anhang.

Außerdem: Default-Backend-Port 8000 -> 8137; obsolete Docs/CI/Docker/Helper-Skripte entfernt; Roadmap aktualisiert.

Tests

  • Backend 30/30 grün (Media-Lifecycle + Such-/Scoping-Tests).
  • Frontend-Build grün; Backup/Restore-Roundtrip verifiziert.
  • Postgres-FTS-Pfad reviewed, aber nicht gegen echte Postgres ausgeführt (Sandbox ohne PG) — bitte live gegenprüfen.

🤖 Generated with Claude Code

chicohaager and others added 6 commits June 23, 2026 19:48
Removes legacy documentation, GitHub Actions workflows, docker-compose
variants, helper shell scripts and other files no longer used.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ting

Image pipeline:
- Shared image utility: validate, auto-orient, resize, WebP compression,
  thumbnails, EXIF capture time + GPS extraction; used by all upload sites.
- HEIC/HEIF (iPhone) support via pillow-heif.
- Frontend galleries use thumbnails + lazy loading.

Media table (source of truth for photos):
- New media model (caption, taken_at, GPS, dimensions, order) with idempotent
  backfill from legacy photos arrays (run_migrations + Alembic 0002).
- /api/media endpoints (caption, delete, trip gallery); clean cutover with a
  derived photos[] for backward compatibility; PDF and GDPR export use media.
- Caption display + inline editing in the diary lightbox.

Map:
- Geotagged diary photos shown as thumbnail markers on the trip map (toggle).
- Fix: TripMap called a non-existent placesService.getByTrip -> getPlaces.

Performance:
- Route-level code-splitting via React.lazy with stale-chunk reload recovery
  (main bundle ~694KB -> ~315KB).

Tests: 27 backend tests pass, incl. new media lifecycle tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Avoids the very common port 8000. Updated across backend default
(BACKEND_PORT), Dockerfiles (EXPOSE/healthcheck/bind), nginx proxy_pass,
frontend API fallback, .env.example and the architecture doc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- backup_database.py: also archive the uploads directory (photos) as a
  timestamped tar.gz paired with the DB dump; --uploads-dir / --skip-uploads;
  --keep retains N of each type.
- restore_database.py (new): restore database and/or uploads with a safe tar
  extraction and a confirmation prompt (--yes to skip).
- docs/BACKUP.md (new): backup/restore guide, cron example, 3-2-1 rule and a
  ZimaOS appendix (docker exec, /DATA, zima-cron).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- GET /api/search: searches the user's trips, diary entries, places and photo
  captions; grouped, ranked results with snippets. Dialect-aware — PostgreSQL
  to_tsvector/websearch_to_tsquery/ts_rank, SQLite ILIKE fallback. User-scoped.
- GIN full-text indexes (run_migrations + Alembic 0003), sharing the document
  expressions with the search queries.
- Frontend: debounced GlobalSearch dropdown in the navbar (React Query) linking
  to the matching trip/entry/place; searchService + i18n (de/en).

Tests: 30 backend tests pass (incl. cross-entity + user-scoping search tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant