Skip to main content
Version: 1.1.0

Deploy online

Usage with PsiTurk

While this set up is optimized for Electron, we added functionality that will make use with PsiTurk easy. The application will detect if it's being used in a Turk environment and will:

  • Save the data to the default PsiTurk SQLite database.
  • Switch the language to Turk specific, if src/language/<locale>.mturk.json exists.
  • Use the Turk specific timeline if different than the primary timeline.

Prebuilt version

When GitHub Actions is run, a psiturk build will be created automatically, and can be downloaded from its artifacts (skip next step if using). The workflows responsible for building the PsiTurk application are .github/workflows/package-home-all.yml and .github/workflows/release-home-all.yml. The first one has to be triggered manually, the latter is triggered when you tag a release.

Build instructions

To set up your PsiTurk project, we provide a script that does the conversion. PsiTurk is a Python package used to manage HITs in Mechanical Turk. Before using the provided script, install PsiTurk.

You'll need to follow these steps (the path to the PsiTurk project should be a directory you wish to be created):

  • Build the application: npm run build

  • Move to the psiturkit directory: cd psiturkit

  • If it's the first time you're running the script:
    ./psiturk-it -p <PATH_TO_NEW_PSITURK_PROJECT>

  • To update an existing PsiTurk project (the path to the PsiTurk project should already exist from the previous steps):
    ./psiturk-it -u -p <PATH_TO_NEW_PSITURK_PROJECT>

Running psiturk

After that, just navigate to your newly created PsiTurk project directory.

shell> psiturk #start psiturk
psiturk> server on #start server
psiturk> debug #debug mode

Running on the Web

Running npm run build generates static content into the build directory that can be served using any static contents hosting service. The workflow .github/workflows/release-home-all.yml uploads the build directory to the gh-branch to serve the application on GitHub pages as an example. After a creating a tag, the workflow will run and your application will be served at <githubuser>.github.io/<repository>. For this step to succeed you will need to create a deploy key and enable GitHub Pages for your repository.

  1. Generate a new SSH key.
  2. By default, your public key should have been created in ~/.ssh/id_rsa.pub or use the name you've provided.
  3. Copy key to clipboard with xclip -sel clip < ~/.ssh/id_rsa.pub and paste it as a deploy key in your repository. Copy file content if the command line doesn't work for you. Check the box for Allow write access before saving your deployment key.
  4. You'll need your private key as a GitHub secret to allow the workflow to run the deployment for you.
  5. To create the secret copy your private key e.g. xclip -sel clip < ~/.ssh/id_rsa and paste a GitHub secret with name GH_PAGES_DEPLOY. Copy file content if the command line doesn't work for you. Save your secret.
  6. Make sure the publishing source for your repository is configured for gh-pages branch.