Get your app running locally

How to get your app running on your local environment

Monterosa / Interaction SDK is tool-agnostic. For simplicity we will be using Vite as a building tool but you can select your preferred tool such as rollup, webpack parcel or esbuild.

Let's start by creating a folder for the app and navigating into it:

mkdir app
cd app

Next, let's initialise the project:

npm init -y

Then, proceed to install Vite:

npm i vite

Create an index.html file in the root directory with the following content:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Monterosa / Interaction Cloud - Hello World</title>
  </head>
  <body>
    <h1 id="title"></h1>
    <div id="app">Sample App</div>
    <script type="module" src="/src/main.js"></script>
  </body>
</html>

And an empty JS in src/main.js.

Now update package.json to add the development and build scripts and to change its type to module:

{
  ...,
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build"
  },
  ...,
}

You can now launch the app for the first time:

npm run dev

Upon execution, you should see an output like so (please note that your Vite version may vary):

  VITE v5.3.1  ready in 123 ms
  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help

By accessing http://localhost:5173/, you can verify that our project template is successfully operational.

Last updated