Skip to content

Next.js Setup

Ben Marshall edited this page Feb 1, 2023 · 6 revisions

Prerequisites

Before you get started, make sure you have the following dependencies installed on your computer:

If you run into issues with NPM installing, try using npm i --legacy-peer-deps instead.

Step 1: Install

  1. Clone the frontend framework with create-next-app
npx create-next-app -e https://github.com/Highfivery/nextjs-starter/tree/main --use-npm nextjs-starter
  1. Change directories
cd nextjs-starter

Step 2: Setup ENV Variables

ENV variables are like constants in wp-config.php. They're required in order for things like authentication with WordPress and other 3rd party services.

  1. Copy the sample ENV file:
cp .env.sample .env
  1. Open the .env file in your code editor & add your credentials

Step 3: Start the Dev Server

You can kick off a development server by running:

npm run dev