Notice more. Keep what matters.
An editorial, image-led photography journal β with a private studio to run it.
Live site Β· Features Β· Tech stack Β· Getting started Β· Deployment Β· Security
- About
- Features
- Tech stack
- Architecture
- Routes
- Data model
- Project structure
- Getting started
- Environment variables
- Scripts
- Using the studio
- AI caption generation
- Deployment
- Security model
- Design system
- Notes and troubleshooting
- Contributing
- License
- Author
- Acknowledgements
FRAME is the photography journal of Aryan Pol β a collection of the moments that are easy to overlook: light falling through a street, a landscape disappearing into fog, an expression that lasts only a second.
It is built as a quiet, magazine-style website where the photographs lead and the interface gets out of the way: a dark OLED palette, oversized display type, slow reveals, and a layout that changes rhythm as you scroll. Photographs are grouped into series, each with its own page, and every photograph has its own page with a first-person caption, where and when it was taken, and a way for visitors to respond.
FRAME is also a complete content system. Behind a passkey-protected studio, the photographer uploads straight from a phone or laptop, location and time are read from the image metadata automatically, a caption can be drafted by AI, and everything is published, organised and moderated from one dashboard β no code changes or redeploys needed to add a photograph.
Look. Find. Frame.
- Photographs lead. Full-bleed imagery, generous space, and type that frames the work instead of competing with it.
- A journal, not a catalogue. Each photograph carries a personal caption and the place and time it was taken.
- Quiet by default. A near-black palette, one accent colour, and motion that is slow and purposeful.
- Publish without code. Adding a photograph is an upload and a click β no commits, no redeploys.
- Private where it matters. Visitors never see camera gear or technical settings, and the studio is locked to a single owner.
- Cinematic hero β a full-bleed slideshow that cross-fades through the published photographs every five seconds, under a headline that cycles PLACES Β· NATURE Β· LIGHT Β· EVERYTHING.
- Series β photographs grouped into themed series. A draggable carousel on the home page, an index at
/series, and a dedicated page for each series with its own description. - Selected photographs β a draggable carousel of the latest work with a "View more" card leading into the full archive.
- The Archive (
/work) β an editorial masonry layout that repeats a 2 β 3 β 1 photograph rhythm rather than a uniform grid, with a live photograph count. - Photograph pages (
/work/[slug]) β full-bleed image, serif-italic caption, location/date/time pills, reactions, and previous/next navigation that wraps around the archive. - Reactions β visitors can respond to a photograph with Appreciate, Beautiful, Peaceful or Caught my eye. No account needed: one reaction per visitor per photograph, tap again to remove it, instant optimistic updates.
- Guestbook β "Leave Something Behind" on the About page. Names are limited to 60 characters and thoughts to 3β600. Entries are moderated: they only appear publicly once approved.
- About page β the story behind FRAME, two portraits, a strip of recent work, Instagram and contact links, and the guestbook.
- Privacy-minded metadata β only location, date and time are shown for each photograph. Camera gear and technical settings are deliberately never displayed.
- Installable PWA β web app manifest, service worker, install prompt, standalone display, and a native-style glass bottom tab bar on mobile.
- Offline-tolerant β network-first navigation with a cached fallback to the app shell, and stale-while-revalidate for same-origin static assets. API, Supabase and Cloudinary-upload requests are never intercepted.
- Settings sheet β Motion (full / reduced, defaulting to the OS preference), Image quality (auto / high / eco), install-to-home-screen, share (native share sheet or copy link), Privacy & Image Metadata, Credits, and a discreet link into the studio.
- Custom cursor β a trailing ring on desktop (fine pointers only) that grows over photographs and shrinks to a dot over links. Never shown on touch devices.
- Motion with restraint β text reveals, page fade transitions, spring-driven drag carousels (Framer Motion) and a scrolling ticker. Reduced-motion mode pauses the ticker.
- Adaptive image delivery β every image is served through Cloudinary with automatic format (
f_auto), automatic quality, and device-pixel-ratio-aware sizing. The visitor's quality preference changes the Cloudinary quality tier.
- Passwordless sign-in β passkeys (WebAuthn: fingerprint, Face ID, Windows Hello, device PIN) as the primary method, with a backup password and magic-link email.
- Drag-and-drop upload β direct browser-to-Cloudinary upload with a live progress bar. HEIC/HEIF is supported.
- Automatic metadata β capture date/time and GPS are read from the file in the browser, reverse-geocoded to a readable place name (e.g. Locality, Country), and left fully editable.
- AI caption drafting β one click generates a reflective, first-person caption from the photograph itself; edit, regenerate, or write your own.
- Series management β pick an existing series or create one while uploading; create and delete series from the dashboard.
- Publish control β save as a draft or publish immediately; publish/unpublish any time.
- Guestbook moderation β approve, hide or delete entries, with a pending counter on the dashboard.
- Dashboard stats β total photographs, published count, series count, and guestbook thoughts.
- Safe deletion β deleting a photograph removes the Cloudinary asset first and only then the database record, so nothing is orphaned.
- Security page β register and remove passkeys per device and set a backup password.
- Client-side validation β 50 MB limit, extension check, empty-file check, and magic-byte inspection (JPEG, PNG, WebP, HEIC/HEIF, AVIF) rather than trusting the browser-reported MIME type.
- Server-side verification β before a photograph is saved, the Cloudinary asset is re-checked: it must exist, be an image, be an allowed format, be β€ 50 MB and have valid dimensions. Failing assets are deleted automatically.
- Transactional rollback β if the database insert fails after a successful upload, the uploaded Cloudinary asset is removed.
| Layer | Technology |
|---|---|
| Framework | Next.js 15 (App Router, Server Components, Server Actions, Route Handlers, Middleware) |
| UI | React 19, TypeScript (strict mode) |
| Styling | Tailwind CSS v4 with design tokens defined in CSS (@theme) |
| Animation | Framer Motion |
| Typography | Bebas Neue, Inter, Playfair Display via next/font |
| Database | Supabase Postgres with Row-Level Security |
| Auth | Supabase Auth β passkeys (WebAuthn), password, magic link β via @supabase/ssr |
| Media | Cloudinary β unsigned direct uploads, on-the-fly transforms, authenticated server-side deletion |
| EXIF | exifr in the browser; BigDataCloud client reverse-geocoding API |
| AI captions | Google Gemini API (multimodal), called server-side only |
| PWA | Web app manifest + hand-written service worker |
| Hosting | Vercel (auto-deploys from main) |
flowchart LR
V["Visitor browser"]
A["Admin studio"]
N["Next.js 15 on Vercel"]
S[("Supabase: Postgres + Auth")]
C[("Cloudinary")]
G["Google Gemini API"]
V -->|"pages, reactions, guestbook"| N
V -->|"optimised images"| C
N -->|"queries with anon key, protected by RLS"| S
A -->|"unsigned direct upload"| C
A -->|"server actions, session required"| N
N -->|"verify and delete assets, server-only keys"| C
N -->|"caption request, admin only"| G
How the pieces fit
- Reads are server-rendered. Public pages are Server Components that query Supabase with the public anon key. Row-Level Security guarantees visitors can only ever see published photographs and approved guestbook entries. Admin actions also call
revalidatePathfor the pages they affect (home, dashboard and About). - Uploads bypass the server. The browser uploads the file straight to Cloudinary with an unsigned preset, so large photographs never pass through a serverless function. The server then verifies the asset by public ID before any database row is written.
- Writes are triple-guarded. Every admin mutation passes through the middleware, a
requireAdmin()check inside the Server Action, and a Postgres RLS policy that callsis_admin(). - Secrets stay on the server. Cloudinary API credentials and the Gemini key are only read in server code and are never prefixed with
NEXT_PUBLIC_.
| Route | Description |
|---|---|
/ |
Home β hero slideshow, ticker, series, selected photographs, journal teaser |
/series |
All series |
/series/[name] |
One series (addressed by its slug), with its photographs |
/work |
The full archive in an editorial masonry layout |
/work/[slug] |
A single photograph β caption, metadata, reactions, prev/next |
/about |
About Aryan, portraits, recent work, guestbook |
| Route | Description |
|---|---|
/admin/login |
Passkey, password or magic-link sign-in |
/admin |
Dashboard β stats, photograph manager, guestbook moderation, series |
/admin/upload |
Upload flow β metadata, AI caption, series, publish |
/admin/security |
Manage passkeys and the backup password |
| Route | Method | Description |
|---|---|---|
/auth/callback |
GET |
Completes magic-link / password-reset sign-in (token_hash flow, with PKCE code fallback). The next parameter is validated to same-origin paths only. |
/api/reactions |
GET, POST |
Read reaction counts for a photograph; add or remove a visitor's reaction |
/api/generate-caption |
POST |
Admin-only. Generates a caption for an image URL (or base64 image) and returns { "caption": "β¦" } |
Four public tables plus an admin registry, created by the migrations in supabase/migrations.
| Table | Purpose | Key columns |
|---|---|---|
photos |
Every photograph | slug (unique), title, caption, cloudinary_public_id, cloudinary_url, series, exif_location, exif_shot_at, published, created_at, updated_at |
series |
Themed collections | name, slug (both unique), description, cover_photo_id |
photo_reactions |
Anonymous reactions | photo_id, reaction_type (appreciate | beautiful | peaceful | caught_my_eye), client_id β unique per (photo_id, client_id) |
guestbook_entries |
Visitor notes | name, message, approved (default false) |
admin_users |
Controlled admin registry | user_id β auth.users, email |
Row-Level Security is enabled on every table:
| Table | Public (anon) | Admin |
|---|---|---|
photos |
SELECT where published = true |
Full access via is_admin() |
series |
SELECT all |
Full access via is_admin() |
photo_reactions |
SELECT, INSERT, DELETE |
β |
guestbook_entries |
SELECT where approved = true; INSERT only with approved = false |
Read all, update, delete via is_admin() |
admin_users |
β | Can read own row |
updated_at on photos is maintained by a trigger. Indexes cover the common queries (published photos by date, photos by series, reactions by photo, approved guestbook entries).
FRAME/
βββ app/
β βββ layout.tsx # Root layout: fonts, metadata, PWA, cursor, transitions
β βββ page.tsx # Home
β βββ globals.css # Tailwind v4 theme tokens + global styles
β βββ about/ # About page + guestbook server action
β βββ series/ # Series index and [name] detail
β βββ work/ # Archive and [slug] photograph pages
β βββ admin/ # Studio: dashboard, upload, security, login, server actions
β βββ auth/callback/ # Magic-link / recovery callback
β βββ api/
β βββ reactions/ # Reaction counts + toggle
β βββ generate-caption/ # Admin-only AI caption endpoint
βββ components/
β βββ admin/ # UploadZone, ExifReader, CaptionGenerator
β βββ guestbook/ # GuestbookSection
β βββ layout/ # Navbar (+ mobile tab bar), Footer, SettingsSheet, nav config
β βββ photos/ # MasonryGrid, PhotoCard, PhotoHero, ExifPills, PhotoReactions
β βββ sections/ # Hero, SeriesTeaser, GallerySection, AboutTeaser, AboutContent
β βββ ui/ # CustomCursor, Marquee, Reveal, PageTransition, PWARegister
βββ lib/
β βββ supabase/ # Browser client, server client, database types
β βββ cloudinary.ts # Client: URL builder + unsigned upload with progress
β βββ cloudinary-server.ts # Server-only: asset verification + deletion
β βββ image-validation.ts # Size, extension and magic-byte validation
β βββ exif.ts # EXIF parsing, reverse geocoding, slugify
β βββ auth-redirect.ts # Canonical base URL for auth emails
β βββ client-id.ts # Anonymous visitor ID (for reactions)
βββ supabase/
β βββ migrations/ # Schema, hardened RLS, reactions + guestbook
β βββ functions/generate-caption/ # Optional Deno edge function (not used by the app)
βββ public/ # Icons, manifest.json, sw.js, portrait images
βββ middleware.ts # Guards /admin/* and refreshes auth cookies
βββ next.config.mjs
βββ tsconfig.json
βββ .env.local.example
- Node.js 20 or newer (Next.js 15 requires at least 18.18; 20+ is recommended) and npm
- A free Supabase project
- A free Cloudinary account
- (Optional) a Google Gemini API key for AI captions
- (Optional) the Supabase CLI for
supabase db push
git clone https://github.com/aryanpol73/FRAME.git
cd FRAME
npm installcp .env.local.example .env.localFill in the values β see Environment variables for what each one does.
Apply the three migrations in order, either by pasting each file into the Supabase SQL editor, or with the CLI:
supabase login
supabase link --project-ref <your-project-ref>
supabase db push| Order | Migration | Creates |
|---|---|---|
| 1 | 20240101000000_init.sql |
photos, series, indexes, initial RLS, updated_at trigger |
| 2 | 20261005000000_production_security_rls.sql |
admin_users, is_admin(), auto-sync trigger, hardened per-operation RLS |
| 3 | 20261005000001_interactions_and_guestbook.sql |
photo_reactions, guestbook_entries and their policies |
Forking this project? The second migration contains the owner's email address in three places (the
is_admin()function, the admin sync trigger, and the seed insert). Replace it with your own admin email before running the migration, and set the same address asADMIN_EMAIL.
- Note your cloud name, API key and API secret from the Cloudinary dashboard.
- Create an unsigned upload preset (Settings β Upload β Upload presets) and put its name in
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET. It must be unsigned because the browser uploads directly.
- Disable public sign-ups (Authentication β Sign In / Providers). Admin access is single-owner.
- Create the admin user with the email you set as
ADMIN_EMAIL. - Add redirect URLs (Authentication β URL Configuration β Redirect URLs):
http://localhost:3000/auth/callbackhttps://<your-production-domain>/auth/callback
- Passkeys β the client opts in to Supabase's experimental passkey API (
experimental: { passkey: true }inlib/supabase/client.ts). Sign in once with a password or magic link, then register a passkey for each device from/admin/security. - (Optional but recommended) For magic links that work across devices, point your Supabase magic-link email template at the callback's token-hash flow:
/auth/callback?token_hash={{ .TokenHash }}&type=magiclink. Without it, the PKCE fallback requires opening the link in the same browser that requested it.
npm run devOpen http://localhost:3000. The site will be empty until you sign in at /admin/login and upload your first photograph.
Copy .env.local.example to .env.local for local development; add the same variables in Vercel for production.
| Variable | Required | Scope | Purpose |
|---|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Yes | Client + server | Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Yes | Client + server | Supabase public anon key (safe to expose; RLS protects data) |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME |
Yes | Client + server | Cloudinary cloud name, used to build image URLs and upload |
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET |
Yes | Client | Name of the unsigned upload preset |
CLOUDINARY_CLOUD_NAME |
Recommended | Server only | Cloud name for the authenticated API (falls back to the public one) |
CLOUDINARY_API_KEY |
Recommended | Server only | Enables server-side asset verification and deletion |
CLOUDINARY_API_SECRET |
Recommended | Server only | Enables server-side asset verification and deletion |
GEMINI_API_KEY |
Optional | Server only | Enables the Generate with AI caption button |
ADMIN_EMAIL |
Recommended | Server only | The single email allowed into the studio. Set this explicitly β if unset, the code falls back to the original owner's address |
NEXT_PUBLIC_APP_URL |
Production | Client + server | Canonical public URL, no trailing slash. Used for metadata and auth-email links |
SUPABASE_SERVICE_ROLE_KEY |
No | Server only | Listed in the example file but not used by the current code. Leave it unset |
π Never prefix secrets with
NEXT_PUBLIC_, and never commit.env.local(it is already in.gitignore).
What happens if optional variables are missing
- No server-side Cloudinary credentials β uploads still work, but server-side verification is skipped (with a console warning) and deleting a photograph is blocked so records are never orphaned.
- No
GEMINI_API_KEYβ the caption button reports that the key isn't configured; captions can still be written by hand.
| Command | Description |
|---|---|
npm run dev |
Start the development server on http://localhost:3000 |
npm run build |
Create an optimised production build |
npm run start |
Serve the production build |
npm run typecheck |
Run the TypeScript compiler in no-emit mode (tsc --noEmit) |
- Sign in at
/admin/loginwith a passkey (or the backup password / magic link). Only the account matchingADMIN_EMAILis allowed in. - Upload β go to Upload and drop a photograph (JPEG, PNG, WebP, HEIC/HEIF or AVIF, up to 50 MB). It uploads to Cloudinary immediately, with a progress bar, so the AI has a real URL to look at.
- Review the metadata β location, date and time are pre-filled from the image's EXIF data and can be corrected.
- Write the caption β press Generate with AI for a first draft, then edit it, or write your own from scratch. Press Regenerate for another take.
- Title and series β add a title, choose an existing series or type a new one.
- Publish β tick Publish immediately, or leave it as a draft and publish later from the dashboard.
- Manage β from the Dashboard you can publish/unpublish or delete photographs, add or remove series, and approve, hide or delete guestbook entries.
- Security β on each device you use, open Security and register a passkey. Set a backup password as a safety net.
Each photograph gets a URL slug made from its title plus a short random suffix (for example first-light-over-kamshet-x7k2), so titles never collide.
The Generate with AI button calls POST /api/generate-caption:
- The route confirms the caller is the signed-in admin (otherwise
403). - It downloads the image server-side and sends it, with a short editorial style prompt, to the Google Gemini API.
- The prompt asks for a quiet, first-person, journal-style caption of two to three sentences β no hashtags, no emojis, no social-media clichΓ©s, and no mention of camera gear.
- The caption is returned as JSON and dropped into the editable caption field.
The API key lives only in server environment variables, and rate-limit responses from the provider are surfaced with a friendly message. The model identifier is set in app/api/generate-caption/route.ts, so upgrading to a newer model is a one-line change.
About
supabase/functions/generate-caption: this is an alternative Deno edge function that streams captions from the Anthropic API. The app does not call it. If you deploy it, add your own authorization check first β the function itself does not check who is calling, so anyone holding your public anon key could invoke it.
FRAME is deployed on Vercel, with the Supabase and Cloudinary services running separately.
- Import the repository in Vercel. The framework preset is Next.js; no
vercel.jsonis needed. - Add environment variables from the table above to the Vercel project. Set
NEXT_PUBLIC_APP_URLto your production URL. - Add the production redirect URL (
https://<your-domain>/auth/callback) in Supabase β Authentication β URL Configuration. - Deploy. Every push to
maindeploys automatically.
Defence in depth, with the database as the final authority:
| Layer | What it does |
|---|---|
| No public sign-ups | The studio has exactly one authorised account, identified by ADMIN_EMAIL. |
| Passkeys first | WebAuthn credentials stored in the device's own secure credential system; password and magic link are backups. |
| Middleware | middleware.ts redirects unauthenticated or non-admin users away from /admin/*, and refreshes auth cookies. |
| Server-side re-checks | The admin layout, every Server Action (requireAdmin()), and /api/generate-caption each verify the session and admin email again. |
| Row-Level Security | Postgres policies enforce who can read and write each table; is_admin() is a SECURITY DEFINER function checking the admin registry. Drafts and unapproved guestbook entries are invisible to the public. |
| Open-redirect protection | /auth/callback accepts only same-origin relative next paths. |
| Upload hardening | Magic-byte format detection, 50 MB cap, and server-side re-verification of the Cloudinary asset with automatic cleanup. |
| Secret hygiene | Cloudinary secrets and the Gemini key are server-only; the browser only ever holds the public Supabase anon key and the unsigned upload preset. |
| Moderation | Guestbook submissions are stored unapproved and enforced as such by RLS (with check (approved = false)). |
Reactions and guestbook notes are anonymous by design. A visitor is identified only by a random ID stored in their browser, so reaction counts are a lightweight signal rather than a verified tally.
A restrained, warm-dark palette defined once as Tailwind v4 theme tokens in app/globals.css.
| Token | Hex | Used for |
|---|---|---|
base |
#0d0b0a |
Page background (OLED near-black) |
surface |
#141210 |
Cards, panels, inputs |
cream |
#f5f0e8 |
Primary text |
muted |
#9a9088 |
Secondary text |
gold |
#e8c170 |
Accent, focus, calls to action |
sienna |
#c4704a |
Errors and destructive actions |
line |
#1e1a17 |
Borders and dividers |
Typography β Bebas Neue for display headings, Inter for body text, and Playfair Display italic for captions and quotations.
Motion β a single easing curve, cubic-bezier(0.16, 1, 0.3, 1), shared across reveals, page transitions and hover states.
- "Not authorised" after signing in. The signed-in email must exactly match
ADMIN_EMAIL(and the email in the migrations'is_admin()function). - Magic link says it's invalid. Open it in the same browser that requested it, or switch the email template to the token-hash flow described in setup step 5.
- Upload fails with "Cloudinary env vars missing". Set
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAMEandNEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET, and make sure the preset is unsigned. - Delete reports missing Cloudinary credentials. Set
CLOUDINARY_CLOUD_NAME,CLOUDINARY_API_KEYandCLOUDINARY_API_SECRETon the server. - Passkey button is disabled. The browser doesn't expose WebAuthn; use the backup login.
- History. FRAME began life as a Framer export served through Next.js rewrites. It has since been rebuilt as a native Next.js application so every page, animation and interaction is editable source code.
FRAME is a personal project, but feedback is welcome. If you spot a bug or have an idea, please open an issue first so we can talk it through before any code is written.
The photographs, written content and brand (the FRAME name and logo) are Β© 2026 Aryan Pol. All rights reserved.
No open-source license is attached to the source code in this repository, so it is likewise all rights reserved unless a LICENSE file states otherwise.
Aryan Pol β photographer and developer
- Instagram β @aryan.on.cam
- GitHub β @aryanpol73
- Email β aryan.pol737@gmail.com
- Site β frame-aryan-on-cam.vercel.app
Next.js Β· React Β· Tailwind CSS Β· Framer Motion Β· Supabase Β· Cloudinary Β· Vercel Β· exifr Β· BigDataCloud Β· Google Fonts (Bebas Neue, Inter, Playfair Display)
FRAME Β© 2026 β Aryan Pol Β· Notice more. Keep what matters.