Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Setting Up a Project Database | Deploying a Next.js App and Setting Up a Database
Next.js 14 Mastery for Building Modern Web Apps

bookSetting Up a Project Database

For this project, we will use the Postgres database. Let's see how to set it up on Vercel.

Instructions

  1. Click "Continue to Dashboard";
  2. Choose "Storage" from the header tabs;
  3. Create "Postgres (Serverless SQL)";
  4. Accept the terms and conditions;
  5. Name the database and click "Create and Continue";
  6. Click the "Connect" button.

After creating and connecting the database, we must set it up and populate it with data to work with.

Instructions

  1. Visit the ".env.local" tab;
  2. Ensure you have all the necessary data:
    • POSTGRES_URL;
    • POSTGRES_PRISMA_URL;
    • POSTGRES_URL_NON_POOLING;
    • POSTGRES_USER;
    • POSTGRES_HOST;
    • POSTGRES_PASSWORD;
    • POSTGRES_DATABASE.
  3. Copy all the data and navigate to the project;
  4. Find the .env.example file in the project root. Rename it to .env;
  5. Paste the copied data from Vercel;
  6. Finally, open the terminal and run npm i @vercel/postgres to install Vercel Postgres.

The last step left is to populate the database with data. Let's focus on it in the following chapter.

In Practice

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Awesome!

Completion rate improved to 2.08

bookSetting Up a Project Database

Scorri per mostrare il menu

For this project, we will use the Postgres database. Let's see how to set it up on Vercel.

Instructions

  1. Click "Continue to Dashboard";
  2. Choose "Storage" from the header tabs;
  3. Create "Postgres (Serverless SQL)";
  4. Accept the terms and conditions;
  5. Name the database and click "Create and Continue";
  6. Click the "Connect" button.

After creating and connecting the database, we must set it up and populate it with data to work with.

Instructions

  1. Visit the ".env.local" tab;
  2. Ensure you have all the necessary data:
    • POSTGRES_URL;
    • POSTGRES_PRISMA_URL;
    • POSTGRES_URL_NON_POOLING;
    • POSTGRES_USER;
    • POSTGRES_HOST;
    • POSTGRES_PASSWORD;
    • POSTGRES_DATABASE.
  3. Copy all the data and navigate to the project;
  4. Find the .env.example file in the project root. Rename it to .env;
  5. Paste the copied data from Vercel;
  6. Finally, open the terminal and run npm i @vercel/postgres to install Vercel Postgres.

The last step left is to populate the database with data. Let's focus on it in the following chapter.

In Practice

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3
some-alt