Setting up the LS Pay Admin UI

Setting up

You will need:

  • Node.js and npm

Building and running the project

Building the project for the first time:

  1. Open a terminal in VS Code (Terminal > New Terminal).
  2. Run npm install to install the project's dependencies.
  3. Run npm install -g vite and wait for Vite to install.
  4. Run vite build.

To view the UI in dev mode (port 3000):

  1. Open a terminal in VS Code (Terminal > New Terminal).
  2. Run vite.
  3. To stop the project running, press Ctrl+C.

To view the UI in production mode (port 5050):

  1. Open a terminal in VS Code (Terminal > New Terminal).
  2. Run vite build.
  3. Run vite preview.
  4. To stop the project running, press Ctrl+C.

Errors and how to fix

"The term 'npm' is not recognized as the name of a cmdlet, function, script file or operable program."

Reason: Npm is not installed or VS Code has not been restarted after installing Npm.

Fix: Follow the link above to install Npm, or restart VS Code if it has already been installed.

"'vite' is not recognized as the name of a cmdlet"

Reason: Vite is not installed.

Fix: In a VS Code terminal, run npm install -g vite.

"vite.ps1 cannot be loaded because running scripts is disabled on this system"

Reason: PowerShell (the default terminal used by VS Code) by default restricts running scripts.

Fix: You can switch to using the cmd terminal or configure your Powershell settings by following the steps below:

  1. Open the dropdown next to the '+' sign on the right hand side of the terminal window > Configure terminal settings > Edit in settings.json".

  2. Input these settings in settings.json:

Copy
"terminal.integrated.profiles.windows": {
  "PowerShell": {
    "source": "PowerShell",
    "icon": "terminal-powershell",
    "args": ["-ExecutionPolicy", "Bypass"]
  }
},
"terminal.integrated.defaultProfile.windows": "PowerShell",
  1. Save and close settings.json.
  2. Open a new terminal and the new settings take effect.