Introduction

A personal boilerplate based on Next.js.

features:Next.js, TypeScript, GraphQL, Prisma, Tailwind CSS

How do I build

I built this boilerplate in the following order.

Getting started

Before getting start, please make sure you have created an empty database (e.g. PostgreSQL). Then, rename .env.example to .env and edit the environment variable. This will enable Prisma database connection, and the GraphQL communicate between client and server.

  1. Install npm dependencies
npm install
  1. Create and seed the database
npx prisma migrate dev --name init
  1. Seed the database with the sample data in prisma/seed.ts
npx prisma db seed
  1. Start the app
npm run dev

Reset the database

You can use the following command to reset the database. It will also automatically seed the database as well.

npx prisma migrate reset

Don't forget to push the database structure again.

npx prisma db push

Document for further reading

Notes