Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Documentation for Honeycomv v3.3 #115

Merged
merged 117 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
eb09795
docs: Build documentation for 3.2.x version of Honeycomb
RobertGemmaJr Feb 12, 2024
e74bfb0
chore: lock
RobertGemmaJr Feb 12, 2024
de135be
wip: Add prolific page and external_tools subfolder
RobertGemmaJr Feb 12, 2024
db3490d
docs: Add documentation page for Prolific
RobertGemmaJr Feb 12, 2024
50d5f89
chore: lock
RobertGemmaJr Feb 14, 2024
592e6e3
chore: Add code suggestions frm @tdivoll in PR #98
RobertGemmaJr Feb 26, 2024
b64ddfd
Merge pull request #97 from brown-ccv/docs-3.3
RobertGemmaJr Feb 26, 2024
874f3f5
docs: Move manual installation sections for the OS under a secondary …
RobertGemmaJr Feb 26, 2024
225b54b
docs: Remove quick start unnecessary stuff
RobertGemmaJr Feb 26, 2024
aba96d5
chore: Cleanup jsPsych stuff in the introduction
RobertGemmaJr Feb 26, 2024
3549ba9
ref: Move "Registering Studies" below developing and deploying with F…
RobertGemmaJr Feb 26, 2024
2359336
docs: Remove "Testing in Linux" section
RobertGemmaJr Feb 26, 2024
7a99ea1
feat: Add page with links to the github dicussions board
RobertGemmaJr Feb 26, 2024
f2dcf7c
feat: Link to discussions board in the footer
RobertGemmaJr Feb 26, 2024
9db8944
chore: cleanup
RobertGemmaJr Feb 26, 2024
769ebc2
chore: Remove "docs" section in footer
RobertGemmaJr Feb 26, 2024
6882708
wip(directory_structure): re-order sections to match the new director…
RobertGemmaJr Feb 26, 2024
965ee91
feat: Add documentation for the new experiment/ folder
RobertGemmaJr Feb 26, 2024
0e90b75
chore: PR cleanup
RobertGemmaJr Feb 26, 2024
1837037
chore: More docs cleanup
RobertGemmaJr Feb 26, 2024
008b3ad
ref(troubleshooting): Add steps for re-setting the node_modules
RobertGemmaJr Feb 26, 2024
d410326
chore: Rewording
RobertGemmaJr Feb 26, 2024
243e681
chore: Revert uneeded step
RobertGemmaJr Feb 26, 2024
45a7648
ref: Reorganize npm scripts
RobertGemmaJr Feb 26, 2024
db0887f
Update docs/troubleshooting.mdx
RobertGemmaJr Feb 27, 2024
fb24d13
Merge pull request #98 from brown-ccv/prolific
RobertGemmaJr Feb 27, 2024
3bf5df2
wip: Clean up quick start steps for editing the task
RobertGemmaJr Feb 27, 2024
70bab17
Merge branch 'feat-v3.3' into chore-pr
RobertGemmaJr Feb 27, 2024
1b7bc62
Merge pull request #99 from brown-ccv/chore-pr
RobertGemmaJr Feb 27, 2024
5d6def8
Merge pull request #101 from brown-ccv/second-pass
RobertGemmaJr Feb 27, 2024
648eac1
Merge pull request #102 from brown-ccv/docs-discussions
RobertGemmaJr Feb 27, 2024
e81ae85
Update docs/troubleshooting.mdx
RobertGemmaJr Feb 27, 2024
304eba3
docs: Add documentation for running and working with data in the loca…
RobertGemmaJr Feb 27, 2024
5365fc6
chore: grammer cleanup
RobertGemmaJr Feb 27, 2024
eed452b
Merge branch 'ref-procedures' into ref-npm
RobertGemmaJr Feb 27, 2024
1d16c74
Merge branch 'ref-quick-start' into ref-npm
RobertGemmaJr Feb 27, 2024
dd85bdc
Merge branches 'ref-scripts' and 'ref-troubleshooting' into ref-npm
RobertGemmaJr Feb 27, 2024
8a8f9ad
wip: Remove yarn files
RobertGemmaJr Feb 27, 2024
a794c0d
docs: Update readme to use npm commands
RobertGemmaJr Feb 27, 2024
5b1b344
docs: One extra yarn
RobertGemmaJr Feb 27, 2024
ccd1bbc
wip: Run an npm install
RobertGemmaJr Feb 27, 2024
9647086
wip: Update github action to to use npm
RobertGemmaJr Feb 27, 2024
fbfd003
build: Add nvmrc file for node 20
RobertGemmaJr Feb 27, 2024
7ebfec7
wip: Update workflows to use the node version file
RobertGemmaJr Feb 27, 2024
6db09ea
chore: Remove deploy script
RobertGemmaJr Feb 27, 2024
9587622
ci: Cleanup build action
RobertGemmaJr Feb 27, 2024
a5f6cd1
ci: Release to gh-pages as CJ
RobertGemmaJr Feb 27, 2024
83221a4
chore: Remove node versions
RobertGemmaJr Feb 27, 2024
996d1b6
chore: comments
RobertGemmaJr Feb 27, 2024
7a77a92
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
ab2e108
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
b789f75
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
29529bd
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
18d1bd5
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
8cd1efc
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Feb 29, 2024
0bc9211
Merge pull request #107 from brown-ccv/ref-electron
RobertGemmaJr Mar 1, 2024
f829485
Merge pull request #104 from brown-ccv/ref-troubleshooting
RobertGemmaJr Mar 1, 2024
e8e368a
fix: Remove unneeded script
RobertGemmaJr Mar 1, 2024
e012746
ref: Move dev:firebase into firebase section
RobertGemmaJr Mar 1, 2024
bdb5b0f
Merge pull request #105 from brown-ccv/ref-scripts
RobertGemmaJr Mar 1, 2024
234968e
Merge branch 'feat-v3.3' into ref-npm
RobertGemmaJr Mar 1, 2024
4d4f3fc
Merge branch 'feat-v3.3' into ref-procedures
RobertGemmaJr Mar 1, 2024
a833e11
wip: Merge party cleanup
RobertGemmaJr Mar 1, 2024
c1f7590
wip: merge party cleanup
RobertGemmaJr Mar 1, 2024
888d163
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Mar 1, 2024
05e6d52
Merge pull request #103 from brown-ccv/ref-procedures
RobertGemmaJr Mar 1, 2024
368b9d1
Merge branch 'feat-v3.3' into ref-npm
RobertGemmaJr Mar 1, 2024
f49ed7e
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Mar 11, 2024
6f0701d
chore: Revert quick start changes
RobertGemmaJr Mar 11, 2024
f4bb4bf
chore: Revert quick_start changes
RobertGemmaJr Mar 11, 2024
2137bf9
chore: Fix revert
RobertGemmaJr Mar 11, 2024
58d6f4e
chore: Fix revert
RobertGemmaJr Mar 11, 2024
637260e
Merge branch 'ref-npm' of https://github.com/brown-ccv/honeycomb-docs…
RobertGemmaJr Mar 11, 2024
e21254e
Merge branch 'ref-npm' of https://github.com/brown-ccv/honeycomb-docs…
RobertGemmaJr Mar 11, 2024
7413eb3
Merge branch 'ref-npm' of https://github.com/brown-ccv/honeycomb-docs…
RobertGemmaJr Mar 11, 2024
c3bfe09
Merge pull request #108 from brown-ccv/ref-npm
RobertGemmaJr Mar 11, 2024
489deac
Merge pull request #109 from brown-ccv/build-node-20
RobertGemmaJr Mar 11, 2024
7012d15
chore: lock
RobertGemmaJr Mar 11, 2024
dde22b5
wip: Add quick start changes back
RobertGemmaJr Mar 11, 2024
dd39a5e
docs: Add documentation for adding the startProcedure and endProcedur…
RobertGemmaJr Mar 11, 2024
e334dbd
feat: Add delete line highlighting
RobertGemmaJr Mar 11, 2024
85c0162
CHORE: WIP
RobertGemmaJr Mar 11, 2024
78dbd74
docs: Add instructions for updating the `index.js` file
RobertGemmaJr Mar 12, 2024
4389f05
docs: Add codeblock for package.json changes
RobertGemmaJr Mar 12, 2024
4c2eab7
chore: Fix erroneous paste
RobertGemmaJr Mar 12, 2024
ce0b5cc
Merge branch 'main' into feat-v3.3
RobertGemmaJr Mar 12, 2024
1cb6bfd
chore: Add same Community Driven piece to 3.2.x docs
RobertGemmaJr Mar 12, 2024
1c95033
chore: lock
RobertGemmaJr Mar 12, 2024
ced574e
Merge branch 'feat-v3.3' into ref-quick-start
RobertGemmaJr Mar 12, 2024
0a40954
chore: lock
RobertGemmaJr Mar 12, 2024
3a25419
Update docs/quick_start.mdx
RobertGemmaJr Mar 12, 2024
b3b312b
Update docs/quick_start.mdx
RobertGemmaJr Mar 12, 2024
8e20e4b
Update docs/quick_start.mdx
RobertGemmaJr Mar 12, 2024
5a84801
Update docs/quick_start.mdx
RobertGemmaJr Mar 12, 2024
aa13e58
chore: Fix brew install command
RobertGemmaJr Mar 12, 2024
2e2f104
docs: Update Firebase security rules
RobertGemmaJr Mar 12, 2024
5114567
ref: Blur our API keys
RobertGemmaJr Mar 12, 2024
929598e
chore: PR cleanup
RobertGemmaJr Mar 12, 2024
dd96c39
Update docs/deployments/firebase.mdx
RobertGemmaJr Mar 18, 2024
4614fc7
Update docs/deployments/firebase.mdx
RobertGemmaJr Mar 18, 2024
c1273e7
Update docs/deployments/firebase.mdx
RobertGemmaJr Mar 18, 2024
e594066
chore: Vocab cleanup
RobertGemmaJr Mar 18, 2024
e005300
Merge pull request #116 from brown-ccv/docs-cleanup
RobertGemmaJr Mar 18, 2024
b72d8ba
Merge branch 'feat-v3.3' into ref-quick-start
RobertGemmaJr Mar 18, 2024
fcd2937
Merge pull request #114 from brown-ccv/ref-quick-start
RobertGemmaJr Mar 18, 2024
a66658c
Update docusaurus.config.js
RobertGemmaJr Mar 18, 2024
b113a3b
Update docs/deployments/local_application.mdx
RobertGemmaJr Mar 18, 2024
3d17d00
Update docs/deployments/local_application.mdx
RobertGemmaJr Mar 18, 2024
afcdfdf
Update docs/prerequisites.mdx
RobertGemmaJr Mar 18, 2024
6122eb6
docs: UPdate about Python version
RobertGemmaJr Mar 18, 2024
9e20c3c
Merge branch 'feat-v3.3' of https://github.com/brown-ccv/honeycomb-do…
RobertGemmaJr Mar 18, 2024
b2cdcaf
chore: lock
RobertGemmaJr Mar 25, 2024
584445a
Apply suggestions from code review
RobertGemmaJr Mar 25, 2024
a686125
Update docs/project_organization/directory_structure.mdx
RobertGemmaJr Mar 25, 2024
90169dc
Update docs/quick_start.mdx
RobertGemmaJr Mar 25, 2024
dfd93d9
docs: Reorder sections of the version control page
RobertGemmaJr Mar 25, 2024
21dce51
docs: Clean up quick start
RobertGemmaJr Mar 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
name: Test Build
name: 🧪 Test Build
on: pull_request

on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Test Build
run: |
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npm run build
node-version-file: .nvmrc
cache: npm

- name: 📥 Install Dependencies
run: npm ci

- name: 🔨 Test Build
run: npm run build
57 changes: 26 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
name: Release to GitHub Pages
on:
push:
branches: [main]
branches: main

permissions:
contents: write

jobs:
gh-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "${{ secrets.GH_PAGES_DEPLOY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
cat <<EOT >> ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/id_rsa
EOT
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: git
run: |
git config --global user.email "[email protected]"
git config --global user.name "gh-actions"
if [ -e yarn.lock ]; then
yarn install --frozen-lockfile
elif [ -e package-lock.json ]; then
npm ci
else
npm i
fi
npx docusaurus deploy
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: 📥 Install Dependencies
run: npm ci

- name: 🔨 Build the website
run: npm run build

- name: 🚀 Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: ccv-cj
user_email: [email protected]
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.11.1
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern
## Installation

```console
yarn install
npm run install
```

## Local Development

```console
yarn start
npm run start
```

This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.

## Build

```console
yarn build
npm run build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.
Expand All @@ -35,7 +35,7 @@ To edit files for the current version, update the files under the `docs` directo
1. To add a new version, make sure that the new version content is finalized in the `docs` directory, then run:

```console
yarn run docusaurus docs:version <version number>
npm run docusaurus docs:version <version number>
```

2. Update `versions.json` to include the new version (make sure "current" is first in the array)
Expand Down
126 changes: 69 additions & 57 deletions docs/deployments/firebase.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Please have your PI contact [[email protected]](mailto:[email protected]

First we'll configure [Firebase Hosting](https://firebase.google.com/docs/hosting) and [Cloud Firestore](https://firebase.google.com/docs/firestore) on your project.

1. Log in to Firebase with your Google account on the [Firebase console](https://console.firebase.google.com/).
1. Log in to Firebase with your Google account on the [Firebase console](https://console.firebase.google.com/)
2. Navigate to your project from the console
3. Register a new web app to your project ([Register your app](https://firebase.google.com/docs/web/setup#register-app))

Expand All @@ -34,7 +34,7 @@ First we'll configure [Firebase Hosting](https://firebase.google.com/docs/hostin
4. Add Firestore Database to your project ([Create a Cloud Firestore database](https://firebase.google.com/docs/firestore/quickstart#create))

:::note
Chose `production mode` for the starting mode and the default "Cloud Firestore Location"
Choose `production mode` for the starting mode and the default "Cloud Firestore Location"
:::

The Firebase project is now fully set up! Now we'll connect your task to that project from your computer.
Expand All @@ -43,15 +43,11 @@ The Firebase project is now fully set up! Now we'll connect your task to that pr

The Firebase CLI is installed with the node package manager just like the rest of Honeycomb's dependencies. Be sure to log in with same account you used when logging into the console!

```shell title="Install the Firebase CLI"
npm install -g firebase-tools
```

```shell title="Login to Firebase"
firebase login
```

_A "command not found" error usually indicates `firebase-tools` has not been installed correctly_
_A `command not found` error usually indicates firebase-tools has not been installed correctly. Re-running `npm install -g firebase-tools` should fix this issue._

### Connecting Your Firebase Project

Expand All @@ -67,7 +63,7 @@ _A "command not found" error usually indicates `firebase-tools` has not been ins

2. Copy the web app credentials from the Firebase console to the corresponding variables in `.env.firebase`

1. Return to your project on the [Firebase console](https://console.firebase.google.com/).
1. Return to your project on the [Firebase console](https://console.firebase.google.com/)
2. Navigate to your project setting

<img
Expand Down Expand Up @@ -104,39 +100,6 @@ firebase deploy --only firestore:rules

Your task is now connected to an initialized Firebase project!

## Registering Studies

:::caution
This step must be followed **exactly**. See [Security Rules](#security-rules) for more information.
:::

1. Navigate to your Firestore Database in the [console](https://console.firebase.google.com/).
2. Click "Start collection"
3. Enter `registered_studies` for the collection id and click "next"
4. Enter the id of your study for the document id
5. Add a field named `registered_participants` with the type "array"
6. Add the id of each study participant as a string inside the array

<div style={{ textAlign: "center" }}>
<img
src={firestoreCreateStudy}
alt="Create a study"
style={{ maxHeight: "600px" }}
/>
</div>
<br />

The study should like this when you're finished:

<img
src={firestoreExampleStudy}
alt="Example study"
/>
<br />
<br />

**Additional studies must be created inside the `registered_studies` collection**

## Developing With Firebase

_Two terminal windows must be used while developing for Firebase. See [here](https://code.visualstudio.com/docs/terminal/basics#_groups-split-panes) for instructions on splitting terminals in VSCode._
Expand All @@ -149,24 +112,24 @@ npm run dev:firebase
npm run firebase:emulators:start
```

Honeycomb is now running in the browser and connected to data on an emulated instance of Firestore. It may be viewed at [http://localhost:4000/firestore](http://localhost:4000/firestore).
Honeycomb is now running in the browser and connected to data on an emulated instance of Firestore. It may be viewed on [localhost:4000](http://localhost:4000/firestore).

:::info
Honeycomb populates the Firestore emulators with the study `s1` and participant `p1`.
:::

## Deploying on Firebase

Firebase deployments are handled automatically following [Continuous Integration Continuous Development (CI/CD)](ci_cd) practices using GitHub Actions. Here we will connect create custom actions that are connected to the task's Firebase project.
Firebase deployments are handled automatically following [Continuous Integration Continuous Development (CI/CD)](ci_cd) practices using GitHub Actions. Here we will create custom actions that are connected to the task's Firebase project.

Execute the following command to begin initializing Firebase hosting via GitHub actions. Be sure to follow the instructions below as the prompts appear.

```shell title="Initialize Firebase hosting via Github actions"
firebase init hosting:github
```

1. The window should log you in automatically. If not, follow the prompts to log in with the same account you used in the console.
2. `<username>/<repository name>` refers to the name of your repository in Github. Be sure it's typed correctly!
1. The window should log you in automatically; if not, follow the prompts to log in with the same account you used in the console
2. `<username>/<repository name>` refers to the name of your repository in Github - be sure it's typed correctly!
3. Enter `y` for the prompt "Set up the workflow to run a build script before every deploy?"
4. Enter `npm install && npm run build:firebase` for the prompt "What script should be run before every deploy?"
5. Enter `y` to overwrite the current workflow file
Expand All @@ -189,15 +152,15 @@ Honeycomb ships with a CLI script for managing data in Firebase. A local service

Service accounts are accounts that are not attached to a human user. They authorize access to a Firebase project without someone physically logging in online. We use a service account to give the download script access to the Firestore database automatically.

1. Return to the project settings your project on the [Firebase console](https://console.firebase.google.com/).
1. Return to the project settings your project on the [Firebase console](https://console.firebase.google.com/)
<img
src={firebaseConsoleSettings}
alt="Firebase project settings"
/>
2. Click on the "Service accounts" tab
3. Near the bottom, click "Generate new Private key" and "Generate Key"

4. Rename the key `firebase-service-account.json` and move it to the root directory of your task. Be sure the file looks grayed out and is not picked up by git!
4. Rename the key `firebase-service-account.json` and move it to the root directory of your task - be sure the file looks grayed out and is not picked up by git!

:::danger
A service account has total administrative access to ts Firebase project. The file and keys inside should never be shared and **never committed to GitHub.**
Expand Down Expand Up @@ -238,24 +201,73 @@ Firestore rules are defined in the `firestore.rules` file in the home directory.
```firestore-security-rules title="firestore.rules" showLineNumbers
rules_version = '2';
service cloud.firestore {
//highlight-start
match /databases/{database}/documents {
match /participant_responses/{studyID}/participants/{participantID} {
allow create, read:
if participantID in get(/databases/$(database)/documents/registered_studies/$(studyID)).data.registered_participants;
//highlight-end
// ...
match /participant_responses/{studyID}/participants/{participantID} {
allow create, read:
// highlight-start
if
// Allows any combination of studyID and participantID to be created in Firebase
true
// participantID must be in the registered_participants array in the registered_studies/{studyID} document
// participantID in get(/databases/$(database)/documents/registered_studies/$(studyID)).data.registered_participants;
// highlight-end

// experimentID must be in the data subcollection
match /data/{experimentID} {
allow create, read: if true

// trialID must be in the trials subcollection
match /trials/{trialID} {
allow create, read: if true
}
}
}
}
}
```

Lines 3 and 4 indicate that Honeycomb attempts to connect to a document at `/databases/{database}/documents/participant_responses/{studyID}/participants/{participantID}` where `studyID` is a given study and `participantID` is a given participant within that study.

Line 6 defines our rule - it must pass for Honeycomb to connect to the document. `participantID` must be found in an array called `registered_participants` inside of a document at `/databases/{database}/documents/registered_studies/{studyID}`.
Line 5 indicates how Honeycomb can interact with that document. Note that Honeycomb cannot update or delete data! You must use the [CLI script](#using-the-cli-script) to delete data.

Line 5 indicates how Honeycomb can interact with that document. Note that Honeycomb cannot update or delete data! You must manually make these changes from the Firestore console.
Lines 6 through 10 defines our rule for creating a document for a given participant at `participant_responses/{studyID}/participants/{participantID}`. Honeycomb ships with two possible rules:

1. Line 8 specifies `true` which allows any combination of `studyID` and `participantID` to be created in Firebase.

:::info
This is the default rule Honeycomb ships with. It is recommended to leave this rule as is and handle the registration of studies in another tool such as [Prolific](prolific).
:::

2. Line 10 only allows a `participantID` to be created if the value is in an array called `registered_participants` inside of a document at `registered_studies/{studyID}`. This ensures pre-registration of every study and participant - the [next section](#registering-studies) explains how to register studies.

:::caution
Firestore rules define every valid path for data in your project. Attempting to connect anywhere besides the paths in your Firestore rules will be automatically denied, even if you have manually saved data elsewhere. This is why `firestore.rules` contains the nested rules in lines 12 - 20. These should be left alone.

:::danger
Firestore rules must define every match pattern in your project. Attempting to connect anywhere other than `/participant_responses/{studyID}/participants/{participantID}` will be automatically denied even if you add other collections to your database. This is why `firestore.rules` contains additional nested rules - these should be left alone.
:::

#### Registering Studies

1. Navigate to your Firestore Database in the [Firebase console](https://console.firebase.google.com/)
2. Click "Start collection"
3. Enter `registered_studies` as the collection ID
4. Enter the id of your study as the document id
5. Click "Add Field".
6. Enter `registered_participants` as the field name, and set the type "array"
7. Add the id of each study participant to the array as type "string"

<div style={{ textAlign: "center" }}>
<img
src={firestoreCreateStudy}
alt="Create a study"
style={{ maxHeight: "600px" }}
/>
</div>

The study should look like this when you're finished:

<img
src={firestoreExampleStudy}
alt="Example study"
/>

**Additional studies are created as documents inside the `registered_studies` collection**
Loading
Loading