Photography System
A full-stack photography gallery with Gemini-powered search, daily spotlight curation, Veo cinemagraphs, and an immersive React Three Fiber 3D mode.
Overview
The gallery is built around fast discovery and careful curation. Public users can browse masonry and 3D gallery views, open shareable photo pages, love photos, and search by text, tag, location, or visual similarity. Admin workflows add EXIF-aware uploads, Gemini-generated titles and tags, daily spotlight orchestration with fair rotation, engagement analytics, and live revalidation so published changes appear immediately.
Technical Stack
Next.js 16 (App Router)
React 19
TypeScript
PostgreSQL (Neon) & Drizzle ORM
Key Features
- Automatic title and description generation using Google Gemini 3.5 Flash model.
- Intelligent tag suggestions based on visual content analysis.
- Color palette extraction and thematic categorization for tags.
- EXIF data extraction with timezone support, camera model normalization, and smart metadata enhancement.
- Location and tag creation directly during upload with duplicate prevention.
Architectural Highlights
- Load-all strategy fetches the entire photo catalog (~170) then applies client-side filtering for instant results.
- Dynamic facet calculation recalculates tag/location counts based on current filtered view.
- Two-phase cron orchestrator for daily photos with exclusion lists to prevent repetition across global timezones.
- Gemini 3.1 Flash-Lite re-ranking pipeline with exponential backoff retry logic for AI rate limits.
- Hybrid search architecture combining Vertex AI semantic embeddings with PostgreSQL full-text search.
- Session-based authentication with Redis+DB hybrid caching (1-5ms fast path, database fallback).
- Anonymous engagement system using browser fingerprinting for loves and view tracking.
- On-demand revalidation via revalidatePath() replacing ISR for immediate photo page updates.
- Selection count tracking (selection_count, last_selected_at) ensuring fair photo rotation.
- EXIF timezone extraction and camera model normalization for accurate metadata.
- Responsive tag handling in PhotoCard using ResizeObserver for dynamic space management.
- Distributed locking (Redis SETNX) preventing race conditions in daily photo computation.
- Tag-based cache invalidation with 10-year TTL for immutable search results.
- Comprehensive metadata editing during upload with location/tag creation and duplicate prevention.
- Cloudinary-only video architecture with incoming transformations (crop/mute) to maximize free tier usage.
- Immersive 3D gallery with texture preloading, cache versioning, cylindrical layout, touch/mouse controls, and video playback.
Project Status
- Complete photo gallery with masonry grid layout and modal viewing.
- AI-powered photo analysis with automatic title, description, and tag generation.
- Advanced search with Vertex AI embeddings and Gemini 3.1 Flash-Lite re-ranking.
- Love system with anonymous fingerprint-based engagement tracking.
- Daily Photo Spotlight with 3-tier priority and cron orchestration.
- Session-based admin authentication with Redis+DB hybrid caching.
- Location-based filtering and tag-based organization.
- Enhanced upload with EXIF extraction, location/tag creation, and metadata editing.
- On-demand revalidation for immediate photo page updates.
- Living Portfolio: AI-generated cinemagraphs for static photos.
- Immersive 3D Gallery mode with cylindrical layout and focus interactions.