Install & setup - Traceton/next-generator GitHub Wiki

Navigate to your desired directory, install Next.js:

npx create-next-app your-app-name-here

Next, install next-generator as a development dependency:

npm i next-generator -D

Create and configure a nextGenConfig.json:

nextGen You'll be prompted to enter a next-generator command, enter init This will generate a nextGenConfig with some default settings.

nextGenConfig.json settings

database

  • database can currently be set as mongodb or postgresql. If using mongodb you'll need to install mongoose from npm by running npm i mongoose. If using postgresql, you'll need to install Prisma and the prisma client by running npm i -D prisma and npm i @prisma/client.

pageType

  • pageType can currently be set as none or tailwindcss. If using Tailwind Css, make sure to follow the install instructions for Next.js HERE.

projectRootPath

  • projectRootPath can be configured for any route you want to prepend your generated code, but most people should just leave this blank.

Last step

That's it! Now go check out how to use next-generator!