This is a starter template repo for Next.JS websites
This app was created with this template: https://github.com/nicholasgriffintn/nextjs-site-starter
This is a starter template that I have created to serve as an initial starting point for my side projects that use Next.JS.
It includes Next.JS, Prisma, a GraphQL server, Tailwind CSS styling and it's all typed, of course.
To get started, you first need to copy .env.example
to .env
.
In your new .env file, you need to edit the environment variables to match your application, in particular, you need to enter a DATABASE_URL
according to your database, this should be a connection string.
Once that's done, you should run yarn install
to retrieve and install the required dependencies.
If it's your first time connecting to the database, you should also run the command yarn migrate-dev
to initially setup your database.
Once you've installed and setup everything, you can run the command yarn dev
to start a local instance of the application.
It should be available at http://localhost:3000
.
To build the code, run the command yarn build
. For production, you should also run yarn gql-gen
to generate the urql hooks for the graphQL queries with GraphQL Code Generator
To generate the prisma client, you can also run yarn prisma-client
.
For development, run the following command:
yarn migrate-dev
For production, run the following command:
yarn migrate-deploy