Environment
Explore the solution

Explore the solution

This section of the guide will give you an overview of the Sitecore XM Next.js code repository solution.

Take note that rather than having separate repositories for configuration, Sitecore, and Next.js, all of the source code is within this single repository. This is by design; this is to prevent having to sync different versions across multiple repositories.

Root directory

The repository of the solution contains the following folders:

Environment - root folder

  1. docker - configurations for docker builds and mounts.
  2. run - docker compose to run your environment. If you're following along our guide, run/sitecore-xm1 is the directory we use. This was the topology we specified when we initialized our solution on step 4.1
  3. src - contains code that is specific to your solution. Your day-to-day work will live under this directory.
    1. items - contains Sitecore items serialization
    2. platform - Sitecore specific code and configuration
    3. rendering - Next.js application to render your website

Most developers will only need to work under the src directory.

rendering directory

The rendering directory is where you'll spend the majority of the time as a Sitecore Next.js developer.

Environment - rendering folder

  1. data - mocked Sitecore data. Used for running the site in disconnected mode
  2. public - native next.js directory. This is used if you want to place static files such as favicon
  3. scripts - various scripts from Sitecore's JSS SDK that allows communication with the CMS
  4. sitecore - component and template definition used for running the site in disconnected mode
  5. src - your custom implementation. Contains your css, javascript, .jsx, etc.