NodeJS apps

A minimal NextJS app consist of the following 2 files :

my-next-app/
├── package.json
├── pages/
│   └── index.js

Here is a typical package.json file :

{
  "name": "my-next-app",
  "version": "1.0.0",
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  }
}

It can be created manually or with npm init -y and then edited.

Here is a typical index.js file :

export default function Home() {
  return <h1>Hello from Next.js on Plesk!</h1>;
}

To install the NextJS app in a Plesk server in a sub-domain we run the following commands in the Plesk terminal :

cd sub-domain.ki-leierbud.lu/my-next-app
npm install
npm run build

A lot of files and folders is created in the /my-next-app folder.

Development of complex NextJS apps

The AI tool lovable.dev is a great development assistent for creating powerful NextJS apps. Here is a list of a few wordpress articles which I edited to help coders to use this tool :