How shanki21/pixdrive works
Pixdrive is a cloud-backed photo gallery and lightweight drive. Owners authenticate by OTP, manage galleries and media in the dashboard, then share public or PIN-protected galleries for visitors to view, download, review, and generate visits; QR access and custom domains extend sharing. The graph preserves billing, analytics, and settings as supporting capabilities. API and library links are limited to relationships shown in excerpts, the source index, or README; several feature routes are represented by their exact directories because their implementations were not sampled.
Main entry points: galleries Gallery management API · prisma.ts PostgreSQL data · disk Public gallery API · controller.ts OTP authentication API
Components 34
User experience
- Owner dashboard
src/app/dashboard - Drive management UI
src/components/drive - Shared gallery view
src/app/disk/[slug] - Studio photo requests
src/app/studio/[ownerId]/[slug]/get-photos - Login and signup
src/app/login
Gallery workflows
- Gallery management API
src/app/api/galleries - Public gallery API
src/app/api/disk - Photo management API
src/app/api/photos - Reviews and comments
src/app/api/galleries/[id]/reviews - Visit analytics API
src/app/api/galleries/[id]/visit - QR generation API
src/app/api/qr - Custom domain API
src/app/api/custom-domains
Identity and access
- OTP authentication API
src/modules/user/controller.ts - OTP account service
src/modules/user/service.ts - User repository
src/modules/user/repository.ts - Session handling
src/lib/session.ts - OTP persistence
src/lib/otp-store.ts
Platform services
- Gallery settings
src/lib/gallery-config.ts - PIN access control
src/lib/gallery-pin-access.ts - API error handling
src/lib/withApiHandler.ts - Rate limiting
src/lib/rate-limit.ts - IP throttling
src/lib/ip-throttle.ts - Retrying HTTP client
src/lib/fetchWithRetry.ts - PostgreSQL data
src/lib/prisma.ts - Image storage
src/lib/storage.ts - Cloudinary assets
src/lib/cloudinary.ts - R2 storage
src/lib/r2.ts
Billing and insights
- Billing API
src/app/api/billing - Plans and entitlements
src/lib/billing.ts - Analytics API
src/app/api/analytics/route.ts - Product analytics
src/lib/product-analytics.ts - Stripe payments
src/lib/stripe.ts
Other components
- Gallery owners
- Gallery visitors
Connections 37
- Gallery owners → Login and signup: sign in
README.md - Gallery owners → Owner dashboard: manage galleries
README.md - Owner dashboard → Drive management UI: renders
- Drive management UI → Gallery management API: manages
- Gallery visitors → Shared gallery view: open shared link
README.md - Shared gallery view → Public gallery API: loads gallery
- Gallery visitors → Studio photo requests: request photos
- Login and signup → OTP authentication API: requests OTP
- OTP authentication API → OTP account service: verifies OTP
src/modules/user/controller.ts - OTP account service → User repository: loads user
src/modules/user/service.ts - OTP account service → OTP persistence: checks code
src/modules/user/service.ts - OTP authentication API → Session handling: sets cookie
src/modules/user/controller.ts - Gallery management API → Session handling: reads identity
src/app/api/galleries/route.ts - Gallery management API → Plans and entitlements: checks allowance
src/app/api/galleries/route.ts - Gallery management API → Gallery settings: normalizes settings
src/app/api/galleries/route.ts - Gallery management API → PostgreSQL data: reads and writes
src/app/api/galleries/route.ts - Public gallery API → PIN access control: verifies PIN
src/app/api/disk/route.ts - Public gallery API → IP throttling: limits unlocks
src/app/api/disk/route.ts - Public gallery API → Retrying HTTP client: fetches download assets
src/app/api/disk/route.ts - Public gallery API → PostgreSQL data: loads gallery data
src/app/api/disk/route.ts - Photo management API → Image storage: stores media
- Image storage → Cloudinary assets: uses provider
src/lib/storage.ts - Image storage → R2 storage: uses provider
src/lib/storage.ts - Reviews and comments → PostgreSQL data: persists reviews
- Visit analytics API → PostgreSQL data: records visits
- QR generation API → Retrying HTTP client: fetches with retry
src/app/api/qr/route.ts - Custom domain API → PostgreSQL data: manages domains
src/app/api/custom-domains/route.ts - Billing API → Plans and entitlements: checks plans
src/app/api/billing/checkout/route.ts - Billing API → Stripe payments: starts checkout
src/app/api/billing/checkout/route.ts - Plans and entitlements → PostgreSQL data: reads subscriptions
src/lib/billing.ts - Analytics API → Session handling: reads identity
src/app/api/analytics/route.ts - Analytics API → PostgreSQL data: queries metrics
src/app/api/analytics/route.ts - Rate limiting → IP throttling: checks requests
src/lib/rate-limit.ts - IP throttling → Retrying HTTP client: calls remote throttle
src/lib/ip-throttle.ts - Gallery management API → API error handling: wraps handlers
src/app/api/galleries/route.ts - OTP authentication API → API error handling: wraps handlers
src/modules/user/controller.ts - Billing API → Product analytics: tracks events
src/app/api/billing/webhook/route.ts