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
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
The results of the execution are as follows.
テンプレート名 短い名前 言語 タグ
----------------------------------------------------- ------------------------------ ---------- --------
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
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.
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.
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.
In the Docker folder, you can see that dockerfiles have been prepared for many instances of Sitecore.
Under the Run folder, you will find the docker-compose.xml file for use with XM1 and XP1.
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.