Skip to content
aryanpol73Public

About

Editorial photography journal and private studio, built with Next.js 15, Supabase and Cloudinary. Includes passkey admin, EXIF auto-fill, AI captions and an installable PWA.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

FRAME

Notice more. Keep what matters.

An editorial, image-led photography journal β€” with a private studio to run it.

Live Site

Next.js React TypeScript Tailwind CSS Supabase Cloudinary Vercel PWA

Live site Β· Features Β· Tech stack Β· Getting started Β· Deployment Β· Security


Table of contents


πŸ“· About

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.

Design principles

  • 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.

✨ Features

The public site

  • 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.

Experience and polish

  • 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.

The studio (admin)

  • 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.

Validation and safety nets

  • 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.

🧰 Tech stack

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)

πŸ— Architecture

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
Loading

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 revalidatePath for 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 calls is_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_.

πŸ—Ί Routes

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

Studio (authenticated admin only)

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

Auth and API

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": "…" }

πŸ—„ Data model

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).


πŸ“ Project structure

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

πŸš€ Getting started

Prerequisites

1. Clone and install

git clone https://github.com/aryanpol73/FRAME.git
cd FRAME
npm install

2. Configure environment variables

cp .env.local.example .env.local

Fill in the values β€” see Environment variables for what each one does.

3. Set up the database

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 as ADMIN_EMAIL.

4. Set up Cloudinary

  1. Note your cloud name, API key and API secret from the Cloudinary dashboard.
  2. 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.

5. Configure Supabase Auth

  1. Disable public sign-ups (Authentication β†’ Sign In / Providers). Admin access is single-owner.
  2. Create the admin user with the email you set as ADMIN_EMAIL.
  3. Add redirect URLs (Authentication β†’ URL Configuration β†’ Redirect URLs):
    • http://localhost:3000/auth/callback
    • https://<your-production-domain>/auth/callback
  4. Passkeys β€” the client opts in to Supabase's experimental passkey API (experimental: { passkey: true } in lib/supabase/client.ts). Sign in once with a password or magic link, then register a passkey for each device from /admin/security.
  5. (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.

6. Run it

npm run dev

Open http://localhost:3000. The site will be empty until you sign in at /admin/login and upload your first photograph.


πŸ” Environment variables

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.

πŸ“œ Scripts

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)

πŸŽ› Using the studio (admin)

  1. Sign in at /admin/login with a passkey (or the backup password / magic link). Only the account matching ADMIN_EMAIL is allowed in.
  2. 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.
  3. Review the metadata β€” location, date and time are pre-filled from the image's EXIF data and can be corrected.
  4. 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.
  5. Title and series β€” add a title, choose an existing series or type a new one.
  6. Publish β€” tick Publish immediately, or leave it as a draft and publish later from the dashboard.
  7. Manage β€” from the Dashboard you can publish/unpublish or delete photographs, add or remove series, and approve, hide or delete guestbook entries.
  8. 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.


πŸ€– AI caption generation

The Generate with AI button calls POST /api/generate-caption:

  1. The route confirms the caller is the signed-in admin (otherwise 403).
  2. It downloads the image server-side and sends it, with a short editorial style prompt, to the Google Gemini API.
  3. 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.
  4. 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.


🚒 Deployment

FRAME is deployed on Vercel, with the Supabase and Cloudinary services running separately.

  1. Import the repository in Vercel. The framework preset is Next.js; no vercel.json is needed.
  2. Add environment variables from the table above to the Vercel project. Set NEXT_PUBLIC_APP_URL to your production URL.
  3. Add the production redirect URL (https://<your-domain>/auth/callback) in Supabase β†’ Authentication β†’ URL Configuration.
  4. Deploy. Every push to main deploys automatically.

πŸ›‘ Security model

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.


🎨 Design system

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.


πŸ“ Notes and troubleshooting

  • "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_NAME and NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET, and make sure the preset is unsigned.
  • Delete reports missing Cloudinary credentials. Set CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY and CLOUDINARY_API_SECRET on 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.

🀝 Contributing

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.


πŸ“„ License

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.


πŸ‘€ Author

Aryan Pol β€” photographer and developer


πŸ™ Acknowledgements

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.

About

Editorial photography journal and private studio, built with Next.js 15, Supabase and Cloudinary. Includes passkey admin, EXIF auto-fill, AI captions and an installable PWA.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages