An example of how to seed your DB when using Prisma and Next.js.
Read the short explanation on Benevolent Bytes
This is a Next.js project bootstrapped with
create-next-app.
- Setup the DB,
cp .env.example .envand update values as you see fit. Tih project uses SQLite for ease of use. - Create the DB with
yarn prisma db push, this will create a SQLite DB in the directory specified by the .env file. - Run
yarn db:seedto seed the coffee data
Run the development server:
npm run dev
# or
yarn devOpen http://localhost:3000 with your browser to see the result.