Skip to main content

NextJS

Next.js is an open-source, React-based framework for building server-side rendered (SSR) and static JavaScript applications. It offers features like hybrid static & server rendering, TypeScript support, smart bundling, and route pre-fetching. It provides a seamless developer experience for creating high-performance web applications.

Next versions​

The template now support the following versions of Next: >=13

May works with other versions, but not tested.

Next installation​

To use this template, you need to install Next first. You can do it by following the official documentation

With NextJS CLI

dcmd toolbox start # in the parent of your project folder
npm create next-app --typescript

Get the template​

At root of your project (where the package.json file is located), run the following command:

dcmd template get nextjs

Configure the template​

  • Create and configure the environnement file by copying the .env.example file to .env
  • Set the name of your project in the docker-compose.yml file
  • Set the right name for your virtual host in .docker/etc/apache/httpd-vhosts.conf

More information here : project configuration

Initialize the project​

At root of your project (where the package.json file is located), run the following command:

dcmd up

Start the project​

At root of your project (where the package.json folder is located), run the following command:

dcmd next
Website URL

You're good to go! You can now access your project at : http://${PROJECT_NAME}.dev.local Or : http://localhost:3000