Tailwind Logo

Create a new project

Experience Manager (XM)Next.jsDocker

Published: 2023-01-10

While there's plenty of Sitecore information available in Japanese, knowing where to start can be challenging. For our first post of the year, we'll show you how to quickly create a new project.

Preparation for Template Creation

Various samples are available on the Internet, and it is easy to get started by bringing code from GitHub, but this flow will introduce what a plain project looks like and how to work from there. The following page from an online article will be used as a basis for the process.

First, run the following commands from the PowerShell command line with administrative privileges to make the template available

PowerShell
dotnet new install Sitecore.DevEx.Templates --nuget-source https://sitecore.myget.org/F/sc-packages/api/v3/index.json

The execution results are as follows

newproject01.png

The results of the execution are as follows.

Plain Text
テンプレート名                                         短い名前                        言語        タグ
-----------------------------------------------------  ------------------------------  ----------  --------
Sitecore Simple Container-based ASP.NET Core Solution  sitecore.aspnet.gettingstarted  [C#]        Sitecore
Sitecore Simple Container-based Next.js Solution       sitecore.nextjs.gettingstarted  JavaScript  Sitecore

You can select either C# or JavaScript as the project type. You are now ready to create a new project.

Create a new project

You want to create a new project. Go to any directory (`c:\projects` at hand) and execute the following command

PowerShell
dotnet new sitecore.nextjs.gettingstarted -n DockerStarter

After a few moments of execution, you will be asked if you want to run dotnet tool restore. Press `Y` to proceed.

newproject02.png

Then the text will be garbled. The display here indicates whether or not to run the commands to create the Next.js project. For reference, the display in English is as follows.

newproject03.png

In this case, we will select `N` to proceed, since our goal is to first set up an instance of XM1.

See what's in the project

Check the structure of the project you have created. First, there are folders such as docker folder, src folder, etc. In the src folder, you can see that Visual Studio project files, etc. have been created.

newproject04.png

In the Docker folder, you can see that dockerfiles have been prepared for many instances of Sitecore.

newproject05.png

Under the Run folder, you will find the docker-compose.xml file for use with XM1 and XP1.

newproject06.png

By using this template, you can see that it contains the necessary resources to launch locally using Docker, not just XM1.

Summary

In this case, we used the command to create a project about Sitecore's Next.js. However, there are a few more preparations that need to be made in order to get it up and running. In the next article, we will perform the additional work necessary to get it up and running in the XM1 configuration.

Tags