- Node.js 16.8 or later.
- macOS, Windows (including WSL), and Linux are supported.
- MySQL server according to your system.
-
In case you need tutorial for MySQL installation, follow this link.
-
After installing MySQL, you can use your preferred method(shell or workbench) and create an empty database for the project.
- Run
npm installto make sure that there are no missing packages for running the application.
-
Create a file named .env in the root directory of the project folder.
-
Copy the lines of code from .env.example to .env.
-
Change the connection string based on your MySQL credentials and database you want to use. (details are described in comment lines which you just copied)
-
First, run
npx prisma migrate dev --name initfor prisma migration according to your database. -
Then, run
npx prisma generate clientto let prisma create a client that works with your database.
- Make sure you have two tables named scores and users tables in your database that will work with the project.
-
Open terminal(command Prompt) and change directory to app directory.
-
Alternatively, you can locate the app directory and open it in the terminal.
-
Once you are on terminal opened app directory, run
npm run devto start the app. -
Running the command will show you a prompt in console where you can see the running application.
-
By default, Next.js app runs on http://localhost:3000/.