Set up the InStore modular store

Learn how to set up and run the InStore modular store.

The InStore modular store is a collection of micro-frontends that implements each business process (such as cart management, payment, cash management, device management, and refunds) as an independent frontend module. Each micro-frontend can be developed, tested, and deployed individually, allowing you to freely customize and scale them. For more information about what each module does, see Working with InStore modules.

The modular store is a starting point for demo purposes, you can use it as a template starting point. However, it is your responsibility to build and maintain the modules you use.

Prerequisites

Before setting up the InStore modular store, you must have done the following:

  • Install Node.js version 18, Corepack, and Yarn.
  • Configure your .env files for any environment-specific settings, such as API endpoints or keys.
  • Ensure required backend APIs and services, such as authentication or payments, are running and accessible.
  • Integrate and configure your devices and ensure they are available.
  • Add translation files for supported languages to the appropriate directory.
  • Configure your stores, tenants, and workstations. For more information, see InStore Configuration.

Set up the modular store

To locally run the modular store, complete the following steps in the root of the repository directory:

  1. Create an .env file and add the following variables:
    VariableDescriptionExample
    LOCAL_BUILDSet to true to build the modular store locally, or false to build it remotely.LOCAL_BUILD=true
    REACT_APP_API_URLURL of your BFF server.REACT_APP_API_URL=http://test-server.bff.com
    MIST_CLIENT_MODULE_URLURL of the InStore payment module. Do not change this variable.MIST_CLIENT_MODULE_URL="https://mist.nebulaterra.com"
    CUSTOM_ROUTINGSet to true to use local module instances; set to false to use remote routes configured for your environment.CUSTOM_ROUTING=true
    INSTORE_AUTH_MODULE_URLHost location for the authentication module, the default is 8084. For running the modular store locally, do not edit the default.INSTORE_AUTH_MODULE_URL="http://localhost:8084"
    INSTORE_CART_MODULE_URLHost location for the cart module, the default is 8088. For running the modular store locally, do not edit the default.INSTORE_CART_MODULE_URL="http://localhost:8088"
    INSTORE_CASH_MANAGEMENT_MODULE_URLHost location for the cash management module, the default is 8098. For running the modular store locally, do not edit the default.INSTORE_CASH_MANAGEMENT_MODULE_URL="http://localhost:8098"
    INSTORE_CATALOG_MODULE_URLHost location for the catalog module, the default is 8086. For running the modular store locally, do not edit the default.INSTORE_CATALOG_MODULE_URL="http://localhost:8086"
    INSTORE_CONFIGURATION_MODULE_URLHost for the configuration module, the default is 8082. For running the modular store locally, do not edit the default.INSTORE_CONFIGURATION_MODULE_URL="http://localhost:8082"
    INSTORE_CUSTOMER_MODULE_URLHost location for the customer module, the default is 8092. For running the modular store locally, do not edit the default.INSTORE_CUSTOMER_MODULE_URL="http://localhost:8092"
    INSTORE_DEVICE_MANAGEMENT_MODULE_URLHost location for the device management module, the default is 8097. For running the modular store locally, do not edit the default.INSTORE_DEVICE_MANAGEMENT_MODULE_URL="http://localhost:8097"
    INSTORE_PAYMENT_MODULE_URLHost location for the payment module, the default is 8095. For running the modular store locally, do not edit the default.INSTORE_PAYMENT_MODULE_URL="http://localhost:8095"
    INSTORE_REFUND_MODULE_URLHost location for the refund module, the default is 8096. For running the modular store locally, do not edit the default.INSTORE_REFUND_MODULE_URL="http://localhost:8096"
    INSTORE_REPRINT_RECEIPT_MODULE_URLHost location for the reprint receipt module, the default is 8087. For running the modular store locally, do not edit the default.INSTORE_REPRINT_RECEIPT_MODULE_URL="http://localhost:8087"
    INSTORE_SHELL_MODULE_URLHost location for the shell module, the default is 8080. For running the modular store locally, do not edit the default.INSTORE_SHELL_MODULE_URL="http://localhost:8080"
    INSTORE_STATE_MODULE_URLHost location for the state module, the default is 8089. For running the modular store locally, do not edit the default.INSTORE_STATE_MODULE_URL="http://localhost:8089"
    INSTORE_TRANSACTION_HISTORY_URLHost location for the transaction history module, the default is 8081. For running the modular store locally, do not edit the default.INSTORE_TRANSACTION_HISTORY_URL="http://localhost:8081"
    INSTORE_UI_COMPONENTS_MODULE_URLHost location for the UI components module, the default is 8090. For running the modular store locally, do not edit the default.INSTORE_UI_COMPONENTS_MODULE_URL="http://localhost:8090"

Install and build the modular store

Run the following commands to install and build the modular store:

yarn install
yarn install:all
yarn build:all

Run the modular store

You can run a development build or production build of the modular store:

  1. To run the development server, use:

    yarn start:all
    
  2. To run the production server, use:

    yarn serve
    
  3. Retrieve the tenant key from your integration server, and the location ID, and workstation ID from the InStore Center, then access the application using the following URL: http://localhost:8080/<tenant_key>/<location_id>/<workstation_id>/
    For example: http://localhost:8080/CTShop_US/002/002/.