Skip to content

good-loop/studio

Repository files navigation

Widgets Studio

How to use:

Visit https://localstudio.good-loop.com

or to run tests:

node runtest.js

Motivation

Widgets are critical components used across multiple projects. Testing should be robust enough to give us confidence that code changes will not break them in any way. Performing this testing through e2e tests using puppeteer on each individual website is not ideal. So this is a dedicated site for it.

Setup for New Developers

studio is the ideal project for a new Good-Loop front-end developer. So let's run through it's setup:

These instructions assume Linux.

  1. Install npm and less via apt-get.

  2. Make a folder to hold this repo + its siblings. We'll name this winterwell, after the company that wrote the original code.

    cd ~
    mkdir winterwell
    cd winterwell
    
  3. Clone this repo and its sibling wwappbase.js

    git clone [email protected]:winterstein/sogive-app.git
    git clone [email protected]:winterstein/wwappbase.js.git
    

Note: the studio repo contains some symlinks to folders in the wwappbase.js repo.

  1. Install npm packages

    cd studio
    npm i
    
  2. Compile the js (and watch for edits)

    ./watch.sh
    
  3. Setup a local web-server. Let's use nginx, serving the studio/web folder, using a ready-made config file.

    sudo apt install nginx cd /etc/nginx/sites-available sudo ln -s /home/{myusername}/winterwell/stduio/config/studio.good-loop.com.nginx

    cd /etc/nginx/sites-enabled sudo ln -s ../sites-available/studio.good-loop.com.nginx .

    sudo ln -s /home/{myusername}/winterwell /home/winterwell

    sudo service nginx restart

  4. Modify your /etc/hosts to have 127.0.0.1 localstudio.good-loop.com

  5. Test: You should be able to view your local web-app from a browser at https://localstudio.good-loop.com

  6. Celebrate as you see best.