
Set up your Storefront
Overview
The SCAYLE Storefront Application is built on top of Nuxt, Vue, and Tailwind CSS frameworks, leveraging TypeScript for type safety. This guide will walk you through the essential steps to set up your local development environment and run the application in both preview and production-like modes.
Before You Start: Prerequisites
Before you begin the installation process, ensure you have the following necessary tools installed locally:
Package | Version |
---|---|
git | |
node | LTS (currently v22.14.0 ) |
yarn | v1 |
docker |
Tool Installation Guide
Install Node.js
We recommend using nvm (Node Version Manager) to install and manage Node.js versions:
- Run
nvm install lts/*
to download and install the latest supported Node.js LTS version. - Run
nvm use lts/*
to set this newly downloaded Node.js version as active for your terminal session.
Install yarn
Yarn is used for dependency management:
Install Storefront Application
The following steps outline the Storefront Application installation process:
- Get the Storefront Application source code from GitLab.
- Install dependencies.
- Configure application.
- Create HTTPS certificate.
1. Get the Storefront Application Source Code
The source code of available SCAYLE Storefront Application release versions is distributed via a GitLab repository.
Access the Repository: Contact your SCAYLE Account Manager to obtain your GitLab Access Token (OAUTH token).
This GitLab Access Token provides read-only access via the command line using git
to clone the storefront-boilerplate-nuxt-public
repository. It doesn't grant additional access rights or ability to access the repository via the GitLab UI.
Use the git clone
command to checkout the latest source code using OAUTH via HTTPS:
2. Install Dependencies
Navigate into your Storefront Application directory:
Then, install all required dependencies:
Set Up Redis (with Docker)
Redis is used for caching and sessions. Ensure Docker is running on your machine.
- Open a terminal and navigate to your Storefront Application directory, where the
docker-compose.yml
file is located. - Start the Redis service:\
- Verify Redis is running by checking the container status:\
- Check the official Redis documentation for additional details.
3. Configure Application
The SCAYLE Storefront command-line interface (CLI) tool accelerates feature adoption in SCAYLE Storefront tenant projects by simplifying the integration of new features and updates from the Storefront Application.
The setup
command initializes a Storefront Application by fetching available shops from the SCAYLE Admin API using the provided tenant space.
Prerequisites
To run the setup, you need an Admin API token and the tenant space. Please follow the instructions in Create an Admin API Token to generate one.
Setup Command
To configure the Storefront Application using the CLI, run:
During this setup, you will be prompted to select a shop, after which the necessary configuration files .env
, shops.ts
, and locale translation files—will be automatically generated.
Additional Secrets
To run the Application, you still need to create and configure a few secrets:
Secret | Used for | Environment Variable (.env) |
---|---|---|
Storefront API Key | Required for authenticating requests to the Storefront API. | NUXT_STOREFRONT_SAPI_TOKEN |
Checkout Auth Credentials | Used for OAuth authentication with SCAYLE Checkout, enabling custom login forms. |
|
Checkout Token & Secret | Required for the Checkout Web Component (provided by your SCAYLE Account Manager). |
|
4. Create a Local HTTPS Certificate
Features like Checkout require a working HTTPS connection. We recommend using the mkcert tool to generate a local certificate and key.
Create a local HTTPS certificate, as features like Checkout require a working HTTPS connection.
To generate a certificate and key, we recommend using the mkcert tool.
- Follow the mkcert installation instructions (Github).
- After installation, run:\
- Add both the generated local key and certificate file paths to your
.env
file:\
Your project will now be served on https://localhost:3000
.
How To Turn Off Local HTTPS
As the local HTTPS encryption is directly coupled to the HTTPS_KEY
and HTTPS_CERT
, simply remove or comment out the entries in your .env
-file, like this:
Run Your Application
Run a Development Preview
- Open a new terminal.
- Start a
redis-server
. - Navigate to your Storefront Application.
- Run
yarn dev
:yarn dev
→ Starts the Nuxt development server with hot-reloading enabled.- Uses the configuration from
.env
ornuxt.config.ts
.
- Open your project at
http(s)://localhost:3000/
.
Run a Production-Like Preview
To start a production-like preview, run:
- Open a new terminal.
- Start a
redis-server
- Navigate to your Storefront Application:
- Build the latest changes:
yarn build
→ Compiles your Nuxt 3 app into static assets & server bundle inside the.output/
directory.- This command optimizes and minifies the code for production.
- Then, run
yarn preview
:yarn preview
→ Runs the built Nuxt app from the.output/
directory.- This simulates how the app will work in a real production server environment.
- Open your shop at
http(s)://localhost:3000/
.
The local application will run over https
if you set it up using the steps described in Create a Local HTTPS Certificate.
Manual Environment & Shop Setup (Advanced / Alternative)
If you prefer to set up your environment and shops manually instead of using the CLI tool:
- Create a local .env file: This file will hold all the application's relevant credentials, secrets, and override values. The Storefront Application contains a
.env.example
file you can copy and populate with your credentials. For an in-depth explanation of the required environment variables, see Configuration.\
Important: Environment variables for shop-specific settings, defined in the.env.example
file, must include a{UNIQUE_IDENTIFIER}
for each shop. These variables need to be duplicated for every shop that will be run from the project. The{UNIQUE_IDENTIFIER}
should match either theshop.shopId
(recommended) or theshop.locale
used in theshops.reduce
function inconfig/storefront.ts
: - Update locales: The Storefront Application typically includes
de-DE
anden-US
locales by default. To ensure your application starts properly, adjust thelocales
array inconfig/storefront.ts
to match your existing shop configurations and replace the exampleshopId
s with your actualshopId
s from the SCAYLE Panel (Shops ➜ Dashboard).\ - Update shops: Adjust the
shops
array innuxt.config.ts
to reflect your existing shop configurations.\
{% hint style="success" %}
RECOMMENDED:
if [shop.shopId]
is used -> Overrideable environment variable: NUXT_STOREFRONT_SHOPS_1001_CHECKOUT_USER
if [shop.locale]
is used -> Overrideable environment variable: NUXT_STOREFRONT_SHOPS_EN_US_CHECKOUT_USER
{% endhint %}
Recommended: Use overrideable environment variables based on the shop identifier:
- If
shop.shopId
is used → useNUXT_STOREFRONT_SHOPS_1001_CHECKOUT_USER
- If
shop.locale
is used → useNUXT_STOREFRONT_SHOPS_EN_US_CHECKOUT_USER
Further Education – SCAYLE Academy
