WordNext – NextJS Frontend for LearnPress

Prerequisites

Before getting started, make sure you have the following in place:

  1. A live WordPress site with LearnPress installed.
    Your WordPress site will act as the data source (backend) for this application.
  2. The LearnPress Add-on for Mobile App plugin installed and activated on your WordPress site.
    This plugin exposes the REST API endpoints that this application relies on to fetch courses, users, and other LearnPress data.
  3. Node.js 22 or higher and npm installed on your server or local machine.
    Verify your versions: node -v npm -v If Node.js is not installed, download it from https://nodejs.org (choose the latest LTS version).

Installation

Step 1 — Extract the package

Unzip the wordnext.zip file you received and navigate into the folder:

unzip wordnext.zip
cd wordnext

Step 2 — Install dependencies

npm install

This will download all required libraries. It usually takes 1–2 minutes.

Step 3 — Configure environment variables

Create your local environment file from the provided example:

cp .env.example .env.local

Open .env.local and set your WordPress site URL:

WP_API_BASE=https://your-wordpress-site.com

Replace https://your-wordpress-site.com with the actual URL of your WordPress site.


Running the Application

Development mode

npm run dev

Open your browser and go to http://localhost:3000.

Production mode

Build first, then start:

npm run build
npm start

Available Commands

CommandDescription
npm run devStart the development server (with hot-reload)
npm run buildBuild the application for production
npm startStart the application after building
npm run typecheckCheck for TypeScript errors
npm run cleanRemove build artifacts and temporary files

Updating to a Newer Version

When an update is available, run the following command inside the application folder:

npm update @learnpress/api @learnpress/utils

Then rebuild:

npm run build