---
title: "Next.js Vercel app with Aurora PostgreSQL"
description: "This demo uses Amazon Aurora PostgreSQL with Next.js to fetch movies from the database. It is able to securely connect to Aurora PostgreSQL."
url: "https://vercel.com/templates/next.js/next-js-vercel-app-with-aurora-postgresql"
links:
  repository: "https://github.com/vercel/aws-aurora-postgresql-demo"
  demo: "https://aws-aurora-postgresql-demo.labs.vercel.dev/"
  deploy: "https://vercel.com/new/clone?demo-title=Next.js+Vercel+app+with+Aurora+PostgreSQL&demo-description=This+demo+uses+Amazon+Aurora+PostgreSQL+with+Next.js+to+fetch+movies+from+the+database.+It+is+able+to+securely+connect+to+Aurora+PostgreSQL.&demo-url=https%3A%2F%2Faws-aurora-postgresql-demo.labs.vercel.dev%2F&project-name=aws-aurora-postgresql-demo&repository-name=aws-aurora-postgresql-demo&repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Faws-aurora-postgresql-demo&products=%5B%7B%22type%22%3A%22integration%22%2C%22integrationSlug%22%3A%22aws%22%2C%22productSlug%22%3A%22aws-apg%22%2C%22protocol%22%3A%22storage%22%7D%5D&teamSlug=aws-sa-partner-sandbox&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F2MbToRLFR1jn44dCXbnGVe%2F5b97fae2ea610a551a576b899399ed79%2FVercel-AWS-GitHub-apg.png"
---

# Next.js Vercel app with Aurora PostgreSQL

This demo uses Amazon Aurora PostgreSQL with Next.js to fetch movies from the database. It is able to securely connect to Aurora PostgreSQL.

# AWS Aurora PostgreSQL Movies Demo

This demo uses AWS Aurora PostgreSQL with Next.js to fetch movies from the database. It is able to securely connect to Aurora PostgreSQL without using hardcoded access tokens through Vercel's [OIDC Federation](https://vercel.com/docs/security/secure-backend-access/oidc) and RDS IAM authentication.

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

**Demo:**
[View Demo](https://aws-aurora-postgresql-demo.labs.vercel.dev)

**Getting Started:**
Click the "Deploy" button to clone this repo, create a new Vercel project, setup the AWS integration, and provision a new Aurora PostgreSQL database:

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

Once the process is complete, you can clone the newly created GitHub repository and start making changes locally.

## Requirements

- Installed Aurora PostgreSQL. You can do that via [Vercel Marketplace](https://vercel.com/marketplace/aws)

## Local Setup

1. Pull vercel environment variables locally

```bash
vercel env pull
```

2. Install dependencies:

```bash
pnpm install
```

3. Run migrations to create tables:

```bash
pnpm run db:migrate
```

4. Seed the database with movie data:

```bash
pnpm run db:seed
```

5. Start the development server:

```bash
pnpm run dev
```

6. View development server:
   <http://localhost:3000>

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