Resources / User guide

Deploy a new
template

Purchase a storefront template, add it to your StoreNext.js project, then preview and apply it from Manage → Templates.

01Introduction

StoreNext.js allows users to extend and customize their storefront by adding new templates without modifying the existing application code.

Users can purchase additional storefront templates through the StoreNext.js website using an active membership plan. After purchasing a template, users can download its ZIP package and integrate it into their existing StoreNext.js project.

Once a new template is installed, it will automatically appear in the Manage → Templates section of the StoreNext.js management panel. Users can preview, apply, and switch between available templates according to their preferences.

This guide explains the complete process, starting from purchasing a template through the StoreNext.js website to installing and activating it in your local StoreNext.js project.

02System Requirements

Before downloading and running this project, ensure you have the following installed on your system:

  • Node.js: Version 18.17 or higher (nodejs.org).
  • npm: Version 9.x or higher (comes with Node.js).
  • Git: For cloning the repository (git-scm.com).

Download & Installation

1Clone the Repository

git clone -b main https://github.com/spurtcommerce/StoreNextjs.git
cd StoreNextjs
npm install

2Environment Configuration

Create a .env file in the root directory with the following variables:

NEXT_PUBLIC_ENV='production'
NEXT_PUBLIC_IMAGE_URL="https://your-image-cdn.com/"

# Admin Authentication Credentials (Optional)
NEXT_PUBLIC_MANAGE_USERNAME="[email protected]"
NEXT_PUBLIC_MANAGE_PASSWORD="your-secure-password"

3Run the Development Server

node server.js

Open http://localhost:3000 in your browser to see the application.

03Purchase a New Template from StoreNext.js

Before adding a new template to your project, you must first purchase your desired template through the StoreNext.js website.

Download the Purchased Template ZIP

  • Navigate to your purchased templates section.
  • Locate the purchased template.
  • Download its ZIP package.
  • Save the ZIP file to your local system.
Downloaded template ZIP package (example: horizon 1.zip)
Figure 1: Downloaded template ZIP package (example: horizon 1.zip)
Important: You must purchase the desired template through the StoreNext.js website before integrating it into your local project. The downloaded ZIP package contains the required template files, components, configurations, thumbnail, and preview assets.

04Extract the Purchased Template ZIP File

After downloading the purchased template ZIP package, extract it before adding it to your StoreNext.js project.

Follow these steps:

  • Locate the downloaded template ZIP file on your computer.
  • Right-click the ZIP file.
  • Select Extract All or use your preferred extraction software.
  • Extract the files into a temporary folder.
  • Open the extracted folder.
  • Verify that the template files and folders are available.

Preserve the original folder structure and ensure that all required files are included.

05Copy the New Template into the StoreNext.js Project

Copy the extracted template folder into the project’s root-level templates directory.

  • Open your StoreNext.js project in Visual Studio Code or another code editor.
  • Locate the templates directory in the project root.
  • Open the folder created when you extracted the purchased package.
  • Copy the complete template folder, including all of its contents.
  • Paste that folder inside the project’s templates directory.
templates directory before adding the new template
Figure 2: The templates directory before adding the new template (only default is present)
templates directory after pasting the new template folder
Figure 3: The templates directory after pasting the new template folder (horizon)

For example, if the extracted template folder is named harvest-horizon, place it alongside default.

Example Project Structure

StoreNext.js/
├── adapters/
│   └── spurt/
├── public/
├── scripts/
├── src/
├── templates/
│   ├── default/
│   ├── harvest-horizon/
│   └── new-template/
│       ├── components/
│       ├── pages/
│       ├── assets/
│       ├── thumbnail.png
│       └── preview.png
├── .env
├── package.json
└── store-config.json
Note: The internal folder structure and asset filenames may vary depending on the purchased template package. Always preserve the original package structure when copying the template.
Warning: Do not delete or overwrite the existing default template.

06Restart the StoreNext.js Project

After copying the new template into the templates directory, restart your StoreNext.js application to allow the template discovery mechanism to identify the newly added template.

Follow these steps:

  • Open your StoreNext.js project in Visual Studio Code.
  • Open the integrated terminal.
  • Stop the currently running development server, if applicable.
  • Navigate to your StoreNext.js project directory.
  • Execute the following command:
node server.js
Starting the server from the VS Code integrated terminal
Figure 4: Starting the server from the VS Code integrated terminal

When the server starts successfully, the terminal shows the local address and a Ready message:

Server running and ready at http://localhost:3000
Figure 5: Server running and ready at http://localhost:3000
  • Wait until the application starts successfully.
  • Open your StoreNext.js application in the browser.
Important: Restarting the development server allows the application to discover and load the newly added template.

07View the Newly Added Template in Manage → Templates

After the application has restarted, sign in to the StoreNext.js management panel and locate the template management page.

Follow these steps:

  • Open your StoreNext.js management panel.
  • Log in using your administrator credentials.
  • Navigate to Manage → Templates.
  • Locate the Explore Templates section.
  • Find your newly added template.

The newly added template should appear with its associated information, including:

  • Template thumbnail image.
  • Template name.
  • Template description.
  • Preview image.
  • Template activation status.

You can now explore the newly installed template alongside your existing templates.

Manage Templates showing the Current Theme and the new template
Figure 6: Manage → Templates showing the Current Theme and the new template under Explore Templates

08Preview and Apply the New Template

Once the newly added template appears in the Manage → Templates section, you can preview and apply it to your storefront.

Follow these steps:

  • Navigate to Manage → Templates.
  • Locate the newly added template under Explore Templates.
  • Select the template you want to use.
  • Click the Preview option to review its storefront design.
  • Once satisfied with the design, click Apply Template or Activate, depending on the available interface option.
  • Confirm the selection if prompted.
  • Wait until the template activation process is completed.
Hovering over a template in Explore Templates shows the Apply Theme option
Figure 7: Hovering over a template in Explore Templates shows the Apply Theme option

A confirmation dialog appears. Click Replace Template to continue, or Cancel to go back:

Replace your current template confirmation dialog
Figure 8: Replace your current template? confirmation dialog

After successful activation:

  • The selected template becomes your current active theme.
  • The selected template appears under the Current Theme section.
  • Its status is updated to Active.
  • Your storefront displays the newly selected template design.

09Verify the Active Storefront

After activating the new template, verify that it is correctly displayed on your storefront.

Follow these steps:

  • Navigate to the StoreNext.js management panel.
  • Click View Your Store.
  • Open your storefront in the browser.
  • Refresh the storefront.
  • Verify that the newly selected template design is displayed correctly.

Check the following storefront sections:

  • Homepage.
  • Product listing pages.
  • Product detail pages.
  • Navigation and menus.
  • Product images and other content.
  • Other available storefront sections.

Ensure that the storefront content is displayed correctly and that the existing store data is accessible.

10Switching Between Installed Templates

StoreNext.js also allows users to switch between previously installed templates whenever required.

To change the currently active storefront design:

  • Navigate to Manage → Templates.
  • Browse the available templates under Explore Templates.
  • Select the template you want to use.
  • Preview the selected template.
  • Click Apply Template or Activate.
  • Confirm the selection if prompted.
  • Wait for the activation process to complete.

The newly selected template becomes the active storefront theme.

Your previously installed templates remain available under Explore Templates, allowing you to switch between different storefront designs whenever required.

Note: Only one template should be active as the current storefront theme at a time.

11Important Considerations

  • An active StoreNext.js membership plan is required to purchase additional templates.
  • Purchase the desired template through the StoreNext.js website before downloading its ZIP package.
  • Always extract the purchased ZIP package before copying its contents into your project.
  • Copy the complete template folder into the root templates directory.
  • Preserve the original template folder structure and configuration files.
  • Ensure that the template contains its required thumbnail and preview assets.
  • Do not delete or overwrite the existing templates/default directory.
  • Restart the development server after adding a new template.
  • Verify that the new template appears under Manage → Templates.
  • Only one template should be active as the current storefront theme at a time.
  • Switching templates changes the storefront presentation; existing store data and backend integrations should remain available through the shared StoreNext.js data layer.

12Troubleshooting

IssuePossible Solution
Purchased template is not available for downloadVerify your membership and purchase status.
New template is not displayedVerify that the template folder is inside the root templates directory. Restart the development server.
Thumbnail image is missingCheck whether the template package contains the required thumbnail asset and verify its configuration.
Preview image is not displayedVerify the preview image path and template metadata.
Template is not loadingCheck the terminal for errors and verify the template folder structure.
Changes are not reflectedRestart the development server and refresh the browser.
Template activation is unsuccessfulCheck the template configuration and activation process.
Storefront design is not updatedVerify that the correct template is active under the Current Theme section.

13Conclusion

StoreNext.js makes it easy to extend and customize your storefront by purchasing and integrating additional templates.

The complete process involves:

  • Visiting the StoreNext.js website.
  • Navigating to Browse Templates.
  • Selecting and purchasing your desired template using an active membership plan.
  • Downloading the purchased template ZIP package.
  • Extracting the ZIP file.
  • Copying the extracted template folder into the StoreNext.js project’s templates directory.
  • Restarting the development server using node server.js.
  • Navigating to Manage → Templates to discover the newly added template.
  • Previewing and applying the new template.
  • Switching between installed templates whenever required.

By following these steps, users can easily purchase, install, preview, apply, and switch between different storefront templates without creating a separate StoreNext.js project for each design.