Skip to main content

Run Dev/Production Mode

Install Dependancies

To prepare the CLI environment, Please run the following commands to get started:

nvm install
npm install

npm install prisma -g

Run in Dev Mode

To run migration for database models

# Run this command if you have any changes to prisma/schema.prisma
npm run migrate:dev

Seeding the models

npm run migrate:seed

Dummy Data

If you wish to create dummy data in your database run the following script with ENABLED_DUMMY_DATA environment variable.

export ENABLE_DUMMY_DATA=true

npm run migrate:seed

Truncate Data

If you wish to truncate (delete) data from database before seeding, run the seeding script with ENABLE_TRUNCATE environment variable.

export ENABLE_TRUNCATE_DATA=true

npm run migrate:seed

Start dev mode

# To start the Next.js application
npm run dev

The application is set up to host on port 3000. Visit http://localhost:3000 with your browser.

Run in Production Mode

To Build/Compile the project

npm run build

To Start in production mode

npm run start

This process run the Migration, Seed and then start the project in production mode.

To Customize the process, refer to package.json file.