Lee starts with a Next.js and Tailwind CSS starter and builds a responsive image grid. He adds hover styling and a square aspect ratio, then switches to Next.js Image to crop images cleanly, allowlist image domains, and show a blur-up loading effect.
Building an Image Gallery with Next.js, Supabase, and Tailwind CSS
Lee Robinson, a developer at Vercel as identified by the project context, demonstrates how to build and deploy a Next.js image gallery backed by Supabase.
He creates a Supabase Postgres project, stores its URL and service role key in local environment variables, and creates an `images` table with name, link, username, and image source fields. He imports sample rows and uses `getStaticProps` to fetch them on the server, then passes the results into the gallery.
Lee pushes the repository to GitHub and imports it into Vercel, adding the Supabase environment variables before deployment. The deployed gallery serves the images with the blur effect and lazy loading.
Because `getStaticProps` generates a static page, database edits do not appear until a redeployment unless the page is revalidated. Lee configures a Supabase database hook to call a Vercel API route after image inserts, updates, or deletes. The route checks a secret and revalidates the index page; changing a name in Supabase then updates the deployed gallery after reload.
Takeaways
- Use Next.js Image with an explicit domain allowlist for optimized, well-cropped images.
- Keep the Supabase service role key on the server and out of client-side code.
- Use `getStaticProps` to fetch database content at build time and pass it to the page.
- Pair database change hooks with a secret-protected revalidation route to refresh static pages after edits.
Mentioned in this talk
Search inside this talk
What was claimed 7
- usescore_product
“which will start creating our Postgres database”
YouTube Verified6 sources· Talk, Job posting· archived
- feature
Next.js: Built-in Image component supports image optimization and lazy loading
“use the built-in Next.js Image component, which gives us better performance out of the box”
YouTube Unverified1 source· Talk
- usesNext.js 15 RC uses React 19 RC under the hood
“Next.js also released the RC version of Next.js 15, which uses React 19 RC under the hood”
3:09inReact Universe BriefingYouTube Verified3 sources· Talk
- featureBlurImage: Applies a blur and scaling effect while an image loads
“giving it this nice blur effect at the top”
YouTube Unverified1 source· Talk
- feature
Next.js: GetStaticProps fetches data on the server and forwards it as page props
“getStaticProps only ever runs on the server”
YouTube Unverified1 source· Talk
- featureon-demand Incremental Static Regeneration: Updates a deployed page after database changes without redeploying
“allows you to update your pages after they've been deployed”
YouTube Unverified1 source· Talk
- feature
Supabase: Function Hooks can watch table changes and call an external API“Function Hooks allow us to listen for changes to any of our database tables and then call a function”
YouTube Unverified1 source· Talk
Related talks
14:29
1:21:37
59:53
50:44
26:10
18:46
