Skip to content

Local Dev

To enable developers to use their own tools as an alternative to the Web Ide, We've adapted the Web Host to run on a local machine in any operating system inside a docker container.

Prerequisites

  1. Install Microsoft WSL. Ensure that you are running WSL version 2
  2. Install docker desktop.
  3. Use WSL Not Hyper-V
  4. Ensure that docker containers are running in linux mode
  5. Minimum version of docker desktop should be 4.34
  6. Install dotnet 8
  7. Install Git

Local Dev Kit

Local dev kit is a sample API & Web Project made for testing and learning. You can download the local dev it from here

Running The API

  1. Open a terminal and navigate to the Api directory in the Local Dev Kit folder.
  2. Run dotnet watch

Debugging The API

  1. Under the Api directory in your Local Dev Kit folder, open the Ecommerce.Api.csproj in your IDE
  2. Run the Ecommerce.Api project

Running the Web Host container

  1. Open a terminal
  2. Login to the experience builder developer container registry with

    docker login experiencebuilder.azurecr.io -u  experiencebuilder -p Ne+aX4L901Q6AdY91xUbSnBHR4rSVL5uNz5hHiZYOb+ACRCQzPc7
    
  3. Run the container with

    docker run -p <YOUR PORT>:8080 -v <YOUR RESOURCE PATH>:/app/localresources --env RESOURCE_PATH=/app/localresources API_SDK=<YOUR API SDK URL> experiencebuilder.azurecr.io/experiencebuilder-localdev:latest
    

Linux Sample

  • Local Path = "/usr/Local Dev Kit/Local"
  • Local Web Host = http://localhost:8080
  • Api SDK = http://localhost:5000

    docker run -p 8080:8080 -v /usr/youngliving-store:/app/localresources --env RESOURCE_PATH=/app/localresources API_SDK=https://host.docker.internal:5000 experiencebuilder.azurecr.io/experiencebuilder-localdev:latest
    

Windows Sample

  • Local Path = "C:\Users\developer\Local Dev Kit\Local"
  • Local Web Host = http://localhost:8080
  • Api SDK = http://localhost:5000

    docker run -p 8080:8080 -v "C:\Users\developer\Local Dev Kit\Local:/app/localresources" --env RESOURCE_PATH="/app/localresources" --env API_SDK="http://host.docker.internal:5000" experiencebuilder.azurecr.io/experiencebuilder-localdev:latest
    

Running a Real Website

Cloning the API SDK

From Exigo Admin, using the left hand navigation menu, go to Sdk -> API. Then click on the view link.

ApiSdkMain.png

Click on the Git Credentials link in the left navigation menu of the Api SDK manager. From the credentials manager, click the "Copy to Clipboard" button under the "Url" heading. ApiSdkCredentials.png

On your local machine open up a terminal and execute the following command

   git clone <git url you copied from the previous step> 

git-clone-terminal.png

Cloning a Website

From Exigo Admin, using the left hand navigation menu, go to Web 2.0 -> Web Sites. Then click on the view link for the website you want to clone.

WebsiteManager.png

Click on the Git Credentials link in the left navigation menu of the Web Site manager. From the credentials manager, click the "Copy to Clipboard" button under the "Url" heading.

website-manager-git-credentials.png

On your local machine open up a terminal and execute the following command

   git clone <git url you copied from the previous step> 
git-clone-website.png

Finally, run the API Sdk and Web Host docker the same as described in the Local Dev Kit section

IDE Support

We have create plugins for both visual studio code / cursor & Jetbrains Rider these can be found in the Local Dev Kit