How sayan365/smartgallery works
SmartGallery turns a photographer’s Drive event folder into an indexed, shareable gallery, then lets guests search it with a consented selfie and retrieve matched photos through short-lived access. The graph separates the web experience, API workflows, indexing/search services, and persistence/security. Frontend-to-API links and some documented capabilities are based on the README; unsampled implementation details are not inferred beyond those documented relationships.
Main entry points: indexing.py Photo indexing · worker.py Background worker · drive.py Drive integration · main.py FastAPI application
Components 27
Web experience
- Product home
frontend/src/app/page.tsx - Event dashboard
frontend/src/components/admin-dashboard.tsx - Public event page
frontend/src/app/event/[slug]/page.tsx - Selfie search
frontend/src/components/public-event-search.tsx - API client
frontend/src/lib/api.ts
API workflows
- FastAPI application
backend/app/main.py - Profile routes
backend/app/routers/auth.py - Event management routes
backend/app/routers/events.py - Public gallery routes
backend/app/routers/public.py
Gallery services
- Drive integration
backend/app/services/drive.py - Event management
backend/app/services/events.py - Photographer profiles
backend/app/services/photographer.py - Photo indexing
backend/app/services/indexing.py - Face detection and embeddings
backend/app/services/faces.py - Similarity search
backend/app/services/public_search.py
Jobs and persistence
- Background worker
backend/app/worker.py - Gallery records
backend/app/models.py - Database sessions
backend/app/database.py
Identity and privacy
- Token authentication
backend/app/auth.py - Photo access tokens
backend/app/photo_access.py - Retention cleanup
backend/app/services/privacy.py
Other components
- Photographer
- Guest
- PostgreSQL + pgvector
- Google Drive
- Supabase Auth
- Redis
Connections 32
- Photographer → Product home: opens gallery
README.md - Photographer → Event dashboard: manages events
README.md - Guest → Public event page: opens event link
README.md - Guest → Selfie search: submits selfie
README.md - Event dashboard → API client: requests event operations
- Selfie search → API client: submits search
- API client → FastAPI application: calls API
- FastAPI application → Profile routes: routes requests
backend/app/main.py - FastAPI application → Event management routes: routes requests
backend/app/main.py - FastAPI application → Public gallery routes: routes requests
backend/app/main.py - Profile routes → Token authentication: validates identity
backend/app/routers/auth.py - Profile routes → Photographer profiles: upserts profile
backend/app/routers/auth.py - Event management routes → Drive integration: browses and syncs
backend/app/routers/events.py - Event management routes → Event management: manages events
backend/app/routers/events.py - Event management routes → Photo indexing: queues indexing
backend/app/routers/events.py - Public gallery routes → Similarity search: looks up and searches
backend/app/routers/public.py - Public gallery routes → Drive integration: downloads photo bytes
backend/app/routers/public.py - Similarity search → Face detection and embeddings: embeds selfie
backend/app/services/public_search.py - Similarity search → Photo access tokens: creates access token
backend/app/services/public_search.py - Photo indexing → Drive integration: downloads originals
backend/app/services/indexing.py - Photo indexing → Face detection and embeddings: extracts faces
backend/app/services/indexing.py - Photo indexing → Background worker: enqueues photos
backend/app/services/indexing.py - Background worker → Drive integration: synchronizes folders
backend/app/worker.py - Background worker → Photo indexing: runs indexing jobs
backend/app/worker.py - Background worker → Retention cleanup: cleans expired sessions
backend/app/worker.py - Gallery records → Database sessions: uses declarative base
backend/app/models.py - Database sessions → PostgreSQL + pgvector: connects sessions
backend/app/database.py - Token authentication → Supabase Auth: verifies user
backend/app/auth.py - Background worker → Redis: uses broker
README.md - Drive integration → Google Drive: reads event photos
README.md - Similarity search → PostgreSQL + pgvector: queries embeddings
backend/app/services/public_search.py - Photo indexing → PostgreSQL + pgvector: stores embeddings