How garnavya/exifgrid works
1. System shape: ExifGrid is a monorepo with a browser-first React/Vite client and a thin Express backend. The core product behavior happens entirely in the client; the server exists mainly to collect and aggregate anonymous telemetry.
2. Client app shell: client/src/main.jsx boots the React app, and App.jsx is the central orchestrator for upload state, selected photos, filters, comparison mode, modals, and export actions. The app is split into feature components rather than a single gallery screen.
3. Photo ingestion pipeline: The entry point is DropZone, which accepts local image files from the user. Uploaded files are processed in-browser through batchProcessor, exifReader, and exifWorker, with images typically handled as local blobs/object URLs so the data stays on the device.
4. Client-side metadata and AI processing: EXIF extraction, camera stats, and any AI-style analysis are done locally. The ONNX model in client/public/models/ is loaded through onnxWorker, keeping inference inside the browser instead of on the server.
5. Primary visual surfaces: Gallery, PhotoCard, Lightbox, and ComparisonFeed are the main viewing layers. The gallery is the central browsing surface; lightbox and comparison are the “inspect a single photo / compare two photos” paths.
6. Insights and filtering layer: FilterMatrix, StatsBar, InsightsDashboard, and hooks like usePhotoFilters and useKeyboardNav manage derived views over the uploaded set. utils/stats.js, adviceEngine.js, and formatters.js support summarization and human-readable interpretations of the photo metadata.
7. Map and geo-focused view: JourneyMap is a separate visualization boundary for location-aware photos. Based on the Leaflet dependency and the EXIF pipeline, this view likely consumes GPS metadata when present and turns it into a geographic browsing experience.
8. Export and privacy tools: The app includes local export utilities for different downstream outputs: csvExport for tabular metadata, polaroid.js for stylized image generation, and exifStripper for creating scrubbed, share-safe images. These features reinforce the repo’s privacy-first, local-processing design.
9. Telemetry subsystem: client/src/api/telemetry.js sends anonymous usage statistics to the backend. server/server.js is the aggregation boundary, and the README indicates those metrics feed global leaderboards such as popular camera models and focal lengths, likely backed by MongoDB Atlas.
10. UI/theming and deployment: Styling is heavily modularized across many CSS files, with theme.css acting as the global visual layer and separate styles for gallery, modal, map, mobile, etc. client/vercel.json suggests the frontend is deployed independently, while the root package.json and server/package.json reflect the split client/server runtime model.
11. Important architectural boundary: The key distinction for a diagram is that photo content and EXIF parsing stay local in the browser, while only anonymous telemetry leaves the device. That boundary is the defining privacy and system-design choice of this repository.
Main entry points: App.jsx App shell · batchProcessor.js Batch processor · Gallery.jsx Gallery · DropZone.jsx DropZone
Components 21
Browser client
React/Vite app where photos are uploaded, processed, viewed, and exported locally.
Local processing
In-browser ingestion, EXIF extraction, and model inference.
- Batch processor · Processes uploaded files in-browser and prepares photo records.
client/src/utils/batchProcessor.js - EXIF reader · Extracts camera and GPS metadata from image files locally.
client/src/utils/exifReader.js - EXIF worker · Offloads metadata parsing work from the main thread.
client/src/utils/exifWorker.js - AI worker · Runs browser-side model inference using the packaged ONNX model.
client/src/utils/onnxWorker.js - ONNX model · Packaged inference asset loaded by the client.
client/public/models/exifgrid_v1_production.onnx
Viewing surfaces
Primary screens for browsing, inspecting, comparing, and mapping photos.
- Gallery · Central browsing surface for uploaded photos.
client/src/components/Gallery.jsx - Photo card · Renders individual photo tiles and metadata cues.
client/src/components/PhotoCard.jsx - Lightbox · Focused single-photo inspection path.
client/src/components/Lightbox.jsx - Compare feed · Side-by-side comparison path for two or more photos.
client/src/components/ComparisonFeed.jsx - Journey map · Visualizes location-aware photos using GPS metadata when available.
client/src/components/JourneyMap.jsx
Insights layer
Derived filtering, statistics, and interpretation over the uploaded set.
- Filter matrix · Controls derived views and subset selection.
client/src/components/FilterMatrix.jsx - Stats bar · Shows quick counts and metadata summaries.
client/src/components/StatsBar.jsx - Insights dashboard · Aggregates photo-level patterns into readable insights.
client/src/components/InsightsDashboard.jsx - Photo filters · Derives filtered photo sets from current app state.
client/src/hooks/usePhotoFilters.js
Exports
Local output tools for tabular, visual, and scrubbed sharing formats.
- Export tools · Shared export utilities for metadata, visuals, and scrubbed images.
client/src/utils/csvExport.js - Exif stripper · Creates share-safe images by removing sensitive metadata.
client/src/utils/exifStripper.js
Telemetry server
Thin backend that receives anonymous metrics and aggregates usage data.
- Telemetry API · Sends anonymous usage statistics from the browser.
client/src/api/telemetry.js - Aggregator · Receives and aggregates anonymous telemetry.
server/server.js
Connections 21
- Entry → App shell: boots · React entry mounts the main app shell.
- App shell → DropZone: upload · App exposes file ingestion through the drop zone.
- DropZone → Batch processor: files · Selected files enter the browser-side batch pipeline.
- Batch processor → EXIF reader: parse · Batched images are parsed for local metadata extraction.
- EXIF reader → EXIF worker: offload · Parsing work is delegated to a worker.
- Batch processor → AI worker: infer · Batch processing can trigger local model analysis.
- AI worker → ONNX model: loads · Inference worker uses the packaged ONNX asset.
- App shell → Gallery: browse · The app routes processed photos into the gallery surface.
- Gallery → Photo card: renders · Gallery is composed of individual photo cards.
- App shell → Lightbox: inspect · Single-photo inspection is opened from the app shell.
- App shell → Compare feed: compare · Comparison mode is coordinated by the app shell.
- App shell → Journey map: geo view · Geo-aware photos can be shown in the map surface.
- App shell → Filter matrix: filter · Filtering controls shape the visible subset.
- Filter matrix → Photo filters: derive · The filter UI is backed by derived-photo filtering logic.
- Photo filters → Gallery: subset · Filtered results feed the browsing surface.
- App shell → Stats bar: summarize · Quick summaries are surfaced in the stats bar.
- App shell → Insights dashboard: analyze · Insights dashboard presents deeper aggregated views.
- App shell → Export tools: export · App exposes local export actions.
- Export tools → Exif stripper: scrub · Privacy-preserving exports remove EXIF data when needed.
- App shell → Telemetry API: usage · Anonymous usage events are sent from the client.
- Telemetry API → Aggregator: collect · Backend receives telemetry for aggregation.