Skip to content

Commit 2a9c586

Browse files
committed
Add tutorial docs
1 parent 518fc23 commit 2a9c586

14 files changed

Lines changed: 267 additions & 244 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 92 deletions
This file was deleted.

.github/workflows/pr_close.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.
153 KB
Loading
122 KB
Loading

docs/getting-started/installation.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,31 @@ ReVISit project is open-source – meaning anyone can see the entire codebase. M
44

55
For most users, the best place to start is the template repository (first option below). If you want all demos and tighter upstream parity, or are considering contributing to reVISit, we recommend you fork the repository instead.
66

7+
## Before you start
8+
9+
Install these tools before cloning and running a study locally:
10+
11+
- [Git](https://git-scm.com/downloads), so you can clone the template repository and share changes with collaborators.
12+
- [Visual Studio Code](https://code.visualstudio.com/), or another editor with JSON support.
13+
- The Active LTS version of [Node.js](https://nodejs.org/).
14+
- [Yarn](https://yarnpkg.com/), which reVISit uses to install dependencies and run the local server.
15+
16+
You can check whether Git, Node, and Yarn are already installed with:
17+
18+
```bash
19+
git --version
20+
node --version
21+
yarn --version
22+
```
23+
724
## Starting from the Template Repository (Recommended)
825

926
Navigate to the [template repository](https://github.com/revisit-studies/template), and click the "Use this template" button. This will create a new repository in your GitHub account with the same files as the template repository, based on the latest stable release of reVISit.
1027

1128
![Use this template button](./img/template-repo.png)
1229

30+
![Create a new repository from the template](./img/create-new-repo.png)
31+
1332
:::info
1433
You can choose a name for the repository to suit your needs, but if you choose anything other than `study`, you also need to adjust the `VITE_BASE_PATH` in your [`.env`](https://github.com/revisit-studies/study/blob/main/.env) file to reflect that change.
1534
:::
@@ -25,6 +44,21 @@ Most likely, you will **receive a warning from GitHub about a potential security
2544
You can safely ignore this warning. The reason for this is that the Firebase API key is not a secret key, and it is intended to be shared publicly in client-side code. For more information, see the [Firebase documentation on API keys](https://firebase.google.com/docs/projects/api-keys#api_key_security_recommendations).
2645
:::
2746

47+
### Clone your template repository
48+
49+
After GitHub creates your repository from the template, open the repository page and click "Code". Copy the clone URL from the HTTPS and clone it to your computer:
50+
51+
```bash
52+
git clone https://github.com/your-github-name/your-repository-name.git
53+
cd your-repository-name
54+
```
55+
56+
![Copy the repository clone URL from GitHub](./img/clone-repo.png)
57+
58+
:::note
59+
If you have not configured GitHub authentication locally, you can use "Download ZIP".
60+
:::
61+
2862
## Forking Repository (Advanced Alternative to Template Repository)
2963

3064
Forking the repository is a more advanced option that allows you to have a copy of the entire `study` repository in your GitHub account. This means that you will have access to all the demo studies and that you can choose to follow the latest changes from the main repository (e.g., by following the `dev` branch). However, it also means that your repository will be linked to the upstream repository's fork network, which can make it more complex to manage.
@@ -49,7 +83,7 @@ After the repository is on your local machine, you will have the entire codebase
4983

5084
## Installing Required Software
5185

52-
To continue, you will need the Active LTS [Node.js](https://nodejs.org/) version, and [Yarn](https://yarnpkg.com/) installed. If you already have Yarn installed, you can go to Step 2 below.
86+
If you already have Git, Node.js, Yarn, and a code editor installed, you can go to Step 2 below.
5387

5488
:::info
5589
Yarn requires that you have the package manager NPM installed. If you do not have NPM installed, please review the [NPM documentation](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to get started. These docs will also direct you on how to install Node – a prerequisite of NPM.
@@ -59,6 +93,14 @@ Yarn requires that you have the package manager NPM installed. If you do not hav
5993

6094
```npm i -g yarn```
6195

96+
:::note
97+
If your machine restricts global installs, run the command with administrator permissions:
98+
99+
```bash
100+
sudo npm i -g yarn
101+
```
102+
:::
103+
62104
**Step 2: Once Yarn is successfully installed, navigate to your local repository and run the following Yarn command:**
63105

64106
```yarn install```
@@ -71,8 +113,16 @@ This will install all the packages that the reVISit requires to run.
71113

72114
This will launch a local web server which can be accessed to view and interact with reVISit. By default, you can access this by visiting [http://localhost:8080/](http://localhost:8080/). Any change you make to the code will automatically update the website.
73115

116+
:::warning
117+
If `yarn install` or `yarn serve` says it cannot find `package.json`, you are probably not inside the repository folder. Run `cd your-repository-name` first, then try the command again.
118+
:::
119+
74120
When you visit the site, you'll see a list of demo studies, identical to [the demo page](https://revisit.dev/study/). You can interact with any of these studies to get some familiarity (and hopefully some inspiration) for how reVISit can help you quickly launch a crowd-sourced visualization study.
75121

122+
:::note
123+
If you started from the template repository, this will be a smaller set of starter tutorial studies.
124+
:::
125+
76126
:::warning
77127
We do not support using `npm` to run reVISit. Please use `yarn` for all package management and running commands.
78128
:::
@@ -85,8 +135,10 @@ import StructuredLinks from '@site/src/components/StructuredLinks/StructuredLink
85135
{name: "ReVISit Template Repository", url: "https://github.com/revisit-studies/template"},
86136
{name: "ReVISit Main Repository", url: "https://github.com/revisit-studies/study"},
87137
{name: "Cloning Repository", url: "https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository"},
138+
{name: "Git Installation", url: "https://git-scm.com/downloads"},
139+
{name: "Visual Studio Code Installation", url: "https://code.visualstudio.com/"},
88140
{name: "Node.js Installation", url: "https://nodejs.org/en"},
89141
{name: "Yarn Installation", url: "https://yarnpkg.com/"},
90142
{name: "NPM Installation", url: "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm"}
91143
]}
92-
/>
144+
/>

docs/tutorial/config.json.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# config.json
22

3-
In this part of the tutorial, you will build the main [Study Config](../typedoc/interfaces/StudyConfig.md), [`public/tutorial/config.json`](https://github.com/revisit-studies/template/blob/main/public/tutorial/config.json). The completed version is [`public/tutorial/_answers/config.json`](https://github.com/revisit-studies/template/blob/main/public/tutorial/_answers/config.json). Use the completed version to check the step you just finished, not as something to copy all at once.
3+
In this part of the tutorial, you will build the [Study Config](../typedoc/interfaces/StudyConfig.md), [`public/tutorial/config.json`](https://github.com/revisit-studies/template/blob/main/public/tutorial/config.json). The completed version is [`public/tutorial/_answers/config.json`](https://github.com/revisit-studies/template/blob/main/public/tutorial/_answers/config.json). Use the completed version to check the step you just finished, not as something to copy all at once.
44

55
:::info
6-
Before starting this page, complete the [Installation guide](../getting-started/installation.md) using the **Starting from the Template Repository** workflow.
6+
Before you start editing tutorial files, complete the [Installation guide](../getting-started/installation.md) using the **Starting from the Template Repository** workflow.
77
:::
88

99
## Step 1: Run the local server
@@ -200,7 +200,7 @@ Add `demographics` to the sequence:
200200
}
201201
```
202202

203-
Click "Next Participant" and confirm that the demographics page appears after consent.
203+
Click "Next participant" and confirm that the demographics page appears after consent.
204204

205205
![The tutorial study with demographics](./img/config.json/step4.png)
206206

@@ -305,6 +305,7 @@ Add `coinImage` to the sequence after `trainingWithFeedback`.
305305
"welcome",
306306
"consent",
307307
"demographics",
308+
"trainingWithFeedback",
308309
"coinImage"
309310
]
310311
}
71.2 KB
Loading
243 KB
Loading
250 KB
Loading
258 KB
Loading

0 commit comments

Comments
 (0)