Sitecore XM Cloud - Multiple repository and multi language solution - Nextjs and Aspnet core - Part 1

 The most anticipated feature from Sitecore that arrived in XMCloud is the ability to have multiple repositories for the XMCloud website, as well as the option to use different programming languages to create environments.

Consider a scenario where a client requires both Next.js and ASP.NET solutions within the same Sitecore XM Cloud project. This new capability directly addresses such a need. It empowers the client to maintain separate code repositories for each technology, alongside the Sitecore editing host. This separation allows for independent management of environments for each application.

I'm really happy to see this feature available, allowing .NET developers like myself to explore more in the .NET world and leverage the same offerings that Sitecore XM Cloud provides with Next.js.

Let's dive into the step-by-step process to configure both Next.js and ASP.NET applications in a single XM Cloud project.

Enable this multiple repo feature

  • Go to the XM Cloud Deploy portal and select the Settings tab.
  • Enable the setting shown below


Project Creation:

  • To support multiple repositories and programming languages after enabling the above step, we need to create two different environments for Next.js and ASP.NET Core, based on their respective code repositories.
  • Go to the Project Tab and click the Create Project button
  • Follow the steps to create the Project, Authoring environment, and Editing host.
  • We can create the Authoring environment from the out-of-the-box provided Starter kit or by using our own code repository, either from GitHub or Azure DevOps.
  • If we are going to use the Starter Kit, then we need to select where we want the starter kit code to be added, either in GitHub or Azure DevOps.

     
  • After adding your project, the next crucial step is configuring the Authoring Environment.
    Click on the "Set up authoring environment" tab and provide a suitable name for the authoring environment.
  • As mentioned in the previous steps, we will need to select the repository where our Starter Kit code will be stored, like below.

  • Let's now configure the Editing host to enable metadata editing functionality for the Next.js Authoring Environment we just set up.
    By default, this Editing host is automatically configured directly from the Starter Kit. We have the option to disable this default Editing host if it's not needed, or if we plan to use our own custom Editing host later.


  • Once all the preceding steps are completed, review and proceed with the deployment. The Project, Environment, and Editing host for the Next.js application will then be created as shown below.








  • We have now successfully created the Next.js Environment using the default Next.js Starter Kit. It's time to create an ASP.NET Core Environment.
  • To do this, navigate to the Project Tab, select the project we just created, then go to the Authoring Environments Tab, and finally click "Add authoring environment."



  • We now have two distinct environments, each with its own dedicated repository: one for Next.js and one for ASP.NET Core.



Let's explore the Metadata Editing feature for both Next.js and ASP.NET Core within this article.

Let's learn and grow together, happy programming 😊

Comments

Popular posts from this blog

Sitecore Upgrade from 8.1 XP to 10.4 XM Scaled - Part 1

Custom Item Url and resolving the item in Sitecore - Buckets

Sitecore Custom Rule (Action and Condition)