Clone this repository:
git clone [email protected]:boostvolt/nextjs-prisma-graphql-nexus-poc.git
Install npm dependencies:
cd nextjs-prisma-graphql-nexus
npm install
Run the following command to create your SQLite database file. This also creates the User
and Post
tables that are defined in prisma/schema.prisma
:
npm run prisma:dev
npm run prisma:deploy
When the command is executed against a newly created database, seeding is also triggered. The seed file in prisma/seed.ts
will be executed and your database will be populated with the sample data.
Run the following command to automatically generate a GraphQL schema and collection based on the specified mutations
, queries
and types
.
npm run generate
npm run dev
The app is now running, navigate to http://localhost:3000/
in your browser to explore its UI.
Next.js Documentation - learn about Next.js features and API.
Learn Next.js - an interactive Next.js tutorial.
Prisma Documentation - learn about Prisma features.
Prisma Getting started - getting started with Prisma.
GraphQL - the specification for GraphQL
GraphQL Code Generator - read more about the generation of the schemas
Nexus - the code first GraphQL schema construction used in this project
Nexus Prisma - the official Prisma plugin for Nexus
Apollo - the GraphQL client used in this project