---
title: "S3 Movie Search"
description: "Amazon S3 general purpose buckets with Next.js and Vercel"
url: "https://vercel.com/templates/next.js/s3-movie-search"
links:
  repository: "https://github.com/vercel/aws-s3-general-purpose-buckets-demo"
  demo: "https://aws-s3-general-purpose-buckets-demo.vercel.app/"
  deploy: "https://vercel.com/new/clone?demo-title=S3+Movie+Search&demo-description=Amazon+S3+general+purpose+buckets+with+Next.js+and+Vercel&demo-url=https%3A%2F%2Faws-s3-general-purpose-buckets-demo.vercel.app%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F75-f-39554123-d-9665-da-35-ba-02-e-57-a-3-b-23%2F3e7d7f14d0b2fd880700ef6c440fcde1%2FVercel-AWS-GitHub-s3-clean.png&project-name=S3+Movie+Search&repository-name=s3-movie-search&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Faws-s3-general-purpose-buckets-demo&from=templates&build-command=npm+run+build&install-command=npm+install&products=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22aws-s3%22%2C%22integrationSlug%22%3A%22aws%22%7D%5D"
---

# S3 Movie Search

Amazon S3 general purpose buckets with Next.js and Vercel

# Amazon S3 Movie Poster Search

This demo uses Amazon S3 general purpose buckets with Next.js to fetch movie
metadata and poster images. It securely connects to S3 without hardcoded access
tokens through Vercel's
[OIDC Federation](https://vercel.com/docs/security/secure-backend-access/oidc).

[![This is an alt text.](https://github.com/vercel/aws-s3-general-purpose-buckets-demo/blob/main/public/Vercel-AWS-GitHub-s3.png?raw=true)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Faws-s3-general-purpose-buckets-demo&project-name=aws-s3-general-purpose-buckets-demo&repository-name=aws-s3-general-purpose-buckets-demo&products=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22aws%22%2C%22productSlug%22%3A%22aws-s3%22%2C%22protocol%22%3A%22storage%22%7D%5D)

**Demo:** [View Demo](https://s3-vercel-general-purpose-buckets.vercel.app/)

## Getting Started

Click the "Deploy" button to clone this repo, create a new Vercel project, set up
the AWS integration, and provision a new S3 general purpose bucket:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Faws-s3-general-purpose-buckets-demo&project-name=aws-s3-general-purpose-buckets-demo&repository-name=aws-s3-general-purpose-buckets-demo&products=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22aws%22%2C%22productSlug%22%3A%22aws-s3%22%2C%22protocol%22%3A%22storage%22%7D%5D)

Every deployment prepares the catalog and posters and uploads them to the bucket
before building, so the first deployment fills the bucket on its own.

To connect a bucket to an existing project instead, use the Vercel AWS Native
Integration. It provisions an IAM role and adds the required S3 environment
variables to the Vercel project.

Prepare the movie catalog and posters locally, then run `npm run upload:s3`.
The command uploads the files directly to the private S3 bucket using Vercel
OIDC credentials. The catalog contains 4,395 poster-backed movies from the
[TMDB 5000 Movie Dataset](https://www.kaggle.com/datasets/tmdb/tmdb-movie-metadata);
movies without a confirmed poster are omitted.

For complete preparation, upload, verification, and troubleshooting steps,
see the [S3 and Vercel setup guide](https://github.com/vercel/aws-s3-general-purpose-buckets-demo/tree/main/docs/setup-guide.md).

## Requirements

- Installed Amazon S3 through the
  [Vercel AWS Marketplace integration](https://vercel.com/marketplace/aws)
- Node.js 20 or newer
- The [Vercel CLI](https://vercel.com/docs/cli)

## Local Setup

1. Link the directory to a Vercel project and pull its environment variables:

   ```bash
   npx vercel link
   npx vercel env pull .env.local
   ```

   `vercel env pull` reads the project's **Development** environment. The Deploy
   button connects the bucket to every environment, but connecting it from the
   dashboard leaves Development unchecked by default. If `.env.local` has no
   `S3_BUCKET_NAME`, edit the bucket's project connection, enable Development,
   and pull again.

2. Install dependencies:

   ```bash
   npm install
   ```

3. Prepare the catalog and poster files:

   ```bash
   npm run prepare:static
   ```

4. Upload the files directly to the connected S3 bucket:

   ```bash
   npm run upload:s3
   ```

5. Start the development server:

   ```bash
   npm run dev
   ```

6. View local development at [http://localhost:3000](http://localhost:3000).

The S3 bucket remains private. Vercel exchanges its OIDC token for temporary
AWS credentials, and poster responses are cached on Vercel's CDN.

This product uses the TMDB API but is not endorsed or certified by TMDB.

## Related Integrations

### [AWS](https://vercel.com/marketplace/aws)

Serverless, reliable, secure AWS Services.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
