From the course: Next.js Ecommerce: Build a Shopping Platform from Scratch

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Section intro

Section intro

So now that we have our basic layout and we have some components including the product card display We can start to implement our database. Now, we're going to be using a cloud postgres database That's offered through Vercel, but it's managed by Neon Which is a great company and service and we're using the free tier So you don't need to pay for anything or enter any credit card information to use this service Now, we'll also be using Prisma as our ORM, our object relational mapper, to interact with our database. So instead of writing raw SQL queries, Prisma offers easy to use methods to create, read, update, and delete, and more in a very easy way. Now Prisma has models that we can set up in the schema file, and these models pertain to the database tables. So we'll have products, and users, sessions, so we'll have a whole bunch of different models in our schema. And this is where we define our fields, along with their types and other annotations, like default values and primary keys…

Contents