Welcome to the open source project for the Sitecore Migration app. The purpose of this application is to help customers and partners alike in guiding them to their ideal migration path. The "choose your own adventure" story approach to the questions represents a fun way to learn about the migration process, and the various tools and techniques that can be used to help you along the way.
- Node 16.17.0 or higher
- NPM 8.15.0 or higher
- Next.js 13.4.1
- Cypress 16.6.0
- Sitecore Content Hub One (to drive the data for the application)
- Sitecore CDP/Personalize (not required)
- Azure Table Storage (either using the emulator or a live account)
- Azurite for Local Development with Azure Table Storage (Version 3.29.0)
To get started you need to follow the following steps:
- Clone the repository
- You'll need access to a Sitecore Content Hub One tenant, and you'll need to create an API key for the development environment. To learn more, check out this guide here: [].
- Duplicate the
.env.template
and name it.env
and update the values with the information you collected in step #2. - Run
npm install
to install all the dependencies. - Run
npm run dev
to start the development server.
This project relies on creating outcome urls on the fly based on the users answers. To do this, we use Azure Table Storage to store the outcome urls. You can configure in your .env
file the connection string to your Azure Table Storage account. The environment variables needed to connect to Azure Table Storage consist of:
- AZURE_TABLE_NAME
- AZURE_TABLE_CONNECTION_STRING
The name of the table should always be Urls
to match up with the code.
You can run Azure Table Storage locally, but not required. Below are the steps to run Azure Table Storage locally.
- Install the Azure Storage Emulator (azurite). You can follow these instructions: (https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=npm%2Cblob-storage). Or you can install azurite globally by running
npm install -g azurite
. - Ensure you are able to run the command
azurite
in your terminal. If you are not able to run this command, you may need to add the path to yourazurite
executable to your PATH environment variable. - Update your
.env
file with the following values:
AZURE_TABLE_NAME=Urls
AZURE_TABLE_CONNECTION_STRING='UseDevelopmentStorage=true'
- Run
npm run dev:azurite
which will start the Next.js development server and azurite local service simultaneously.
This will start the Azure Table Storage emulator and the development server at the same time. You can now run the application locally.
- If this is the first time running the above command, you will need to create the table in Azure Table Storage manually (after you've run step 4). You can do this by connecting to the local emulator using Azure Storage Explorer. You can download Azure Storage Explorer here: https://azure.microsoft.com/en-us/features/storage-explorer/
- Once you have downloaded Azure Storage Explorer, install it, and then open the tool.
- Along the left side of the tool is the "Explorer", you should see an option for "Emulator & Attached" which you should expand.
- You should then see an option for "Emulator - Default Ports" which you should expand.
- You should then see an option for "Tables", which you should right click on and select "Create Table".
- Enter the name of the table as
Urls
and click "Create". - You should now see the table in the list of tables and now be able to run the application locally. Navigate to your website in the browser (ie. http://localhost:3000).
We use Cypress to create End-to-End and Component Test use cases.
To Open the Cypress Testing Console
- Clone the repository
- Run a
npm install
to install all the dependencies. - If you have
npm run dev
running in a different terminal, please stop before running the next command. - Run
npm run cypress
which will runnpm run dev and npx cypress open
in parallel. - Select the test you want to run from the Cypress UI.
To Run the E2E Tests Headlessly and Locally
- Run
npm run dev
to start the app in localhost:3000 - Run
npx cypress run
to run the E2E tests on your local machine - View the terminal output to see passing or failing tests (no browser will open)
To Run the Component Tests Locally
- Run
npx cypress run --component
- View terminal output for passing or failing tests