FaceDeliver — Event photos delivered by face match
Guests scan a QR code, take one selfie and get a personal gallery of only the photos they appear in.
The Next.js web app for FaceDeliver. Organisers create events, share a QR code, upload galleries and track delivery; guests register with a selfie and explicit consent and receive only their own photos. All API traffic goes through a server-side proxy so the auth token stays in an HttpOnly cookie.
- 3
- roles: guest, organiser, superadmin
- 27
- pages
- 2
- isolated session proxies
- PWA
- installable
What it does
QR to gallery
One event code drives the QR link, guest registration and the personal gallery.
Consent before the camera
Guests see what is collected, where it is stored and when it is deleted before the selfie.
Organiser console
Events, guest lists, batch uploads, delivery analytics, billing and profile.
Token never in JavaScript
A route-handler proxy reads an HttpOnly cookie and adds the bearer token on the server.
Plans and quota
Razorpay checkout, with the plan changing only after the server verifies the payment.
Production monitoring
Sentry on client and server, hidden source maps and quiet production logs.
Architecture at a glance
- 1Browser → /api/proxy/* route handler → Express API, with the token injected from an HttpOnly cookie.
- 2The superadmin console has its own cookie and its own proxy, so sessions never mix.
- 3The backend (Express, MongoDB, Cloudinary, face-matching worker) is a separate service.
- 4sitemap.js, robots.js and a central seo.config.js cover marketing, blog and service pages.
Architecture notes
Written from the repository's source code: how it is structured, how it talks to the backend and how to run it.
FaceDeliver — Web app
The web surface of FaceDeliver, an event-photo delivery platform. A guest scans the event QR code, takes one selfie, and gets a personal gallery of only the photos they appear in. Organisers and photographers run their events, uploads, analytics and billing from the same app.
Live at facedeliver.shop. The Flutter client for the same API lives in Gautam5514/facedeliver_app.
How the product works
flowchart LR
O["Organiser"] -- "creates event" --> E["Event code + QR"]
G["Guest"] -- "scans QR" --> R["Register: name, email, selfie + consent"]
O -- "uploads gallery" --> P["Photos"]
R --> M["Face matching worker"]
P --> M
M -- "matches" --> GA["Personal gallery"]
GA -- "single photo or ZIP" --> G
- The organiser creates an event and gets a unique event code and QR code.
- The QR is shown at the venue. Guests scan it and register with a selfie.
- The organiser uploads the event photos in batches.
- The backend detects faces in every photo and matches them to registered guests.
- Each guest gets an email and a private gallery with only their photos.
Tech stack
| Piece | Tool | Used for |
|---|---|---|
| Framework | Next.js 16 (App Router) | Pages, route handlers, metadata |
| UI | React 19 | Components |
| Styling | Tailwind CSS 4, clsx, tailwind-merge | Design system and utilities |
| Motion | Framer Motion | Landing page and dashboard animation |
| Icons | lucide-react | Icon set |
| QR | qrcode | Event QR generation for organisers |
| Payments | Razorpay Checkout | Plans and upload quota |
| Monitoring | Sentry (@sentry/nextjs) | Client and server error tracking |
| Offline shell | Service worker + web manifest | Installable PWA |
The backend this app talks to is a separate Express API with MongoDB (Mongoose), Cloudinary for image storage and a face-matching worker. It is not part of this repository.
Architecture
flowchart LR
B["Browser"] -- "/api/proxy/*" --> PX["Next.js route handler"]
PX -- "Bearer token from HttpOnly cookie" --> API["Express API"]
API --> DB[("MongoDB")]
API --> CL["Cloudinary"]
API --> RZ["Razorpay"]
B -. "errors" .-> SE["Sentry"]
The proxy keeps the token out of JavaScript
The browser never calls the backend directly and never holds the auth token.
- On sign-in,
app/api/auth/sessionstores the token in an HttpOnly cookie (gopo_session). - Every API call goes to
app/api/proxy/[...path]. The route handler reads the cookie on the server, adds theAuthorization: Bearer …header and forwards the request to the backend. - Hop-by-hop headers are stripped, the query string and multipart boundaries
are preserved, and the proxy is marked
force-dynamicso nothing is cached. - The superadmin console has its own cookie and its own proxy
(
app/api/superadmin-proxy), so the two sessions never mix.
Folder structure
app/
page.js landing page
register/ guest registration: details, consent, selfie capture
gallery/ the guest's personal gallery
login/ organiser sign-in
admin/ organiser console
dashboard/ events/ events/[id]/ events/[id]/guests/
analytics/ billing/ profile/ help/
superadmin/ platform console (separate login and session)
(secure)/dashboard/ (secure)/subscriptions/
blog/ services/ how-it-works/ for-photographers/ about/ contact/ privacy/
api/
auth/session/ sets and clears the HttpOnly session cookie
proxy/[...path]/ authenticated proxy to the backend
superadmin-proxy/ the same, for the superadmin session
contact/ contact form handler
utils/
api.js apiCall / authFetch helpers that go through the proxy
razorpay.js checkout loader and payment flow
sitemap.js robots.js seo.config.js
components/
landing/ hero, how-it-works, features, FAQ, testimonials, footer
admin/ CreateEventModal
layout/ ui/ shared layout and primitives
ServiceWorkerRegistration.jsx
public/
sw.js manifest.json PWA shell
What each role can do
| Guest | Organiser | Superadmin |
|---|---|---|
| Scan the event QR code | Create events and share the QR | See platform-wide revenue |
| Register with a selfie and explicit consent | Upload photo galleries in batches | Oversee every subscription |
| View only the photos they appear in | See the guest list for each event | |
| Download one photo or the whole album | Track delivery analytics | |
| Manage plan, quota and billing |
Decisions worth knowing
- Consent comes before the camera. The registration page explains what is collected, where the selfie is stored and when it is deleted, and the guest has to tick the consent box before a selfie can be submitted.
- The event code is the public key. QR links, guest registration and galleries all use the event code, not the database id.
- Payments are verified on the server. The checkout modal reporting success is not enough. The plan and upload quota change only after the backend verifies the Razorpay signature.
- SEO is built in.
sitemap.js,robots.jsand a centralseo.config.jscover the marketing pages, blog and service pages. - Production logs are quiet.
console.*calls are removed from production builds (errors are kept), and Sentry source maps are hidden from the browser.
Run it locally
You need Node.js 20+ and the FaceDeliver backend running.
git clone https://github.com/Gautam5514/delivery_frontend.git
cd delivery_frontend
npm install
Create .env.local:
NEXT_PUBLIC_API_URL=http://localhost:5001/api
# optional
NEXT_PUBLIC_SENTRY_DSN=
Then start the dev server:
npm run dev # http://localhost:3000
| Command | What it does |
|---|---|
npm run dev | Start the app for local development |
npm run build | Build the production version |
npm start | Run the production build |
npm run lint | Lint with ESLint |