Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
recap committed Jul 2, 2024
1 parent de86bac commit 6a79c7b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,19 @@ POSTGRES_PASSWORD=somepassword
OTREE_REST_KEY=somepassword
SECRET_KEY="some secret in quotes"
API_KEY="some other secret in quotes"
URL_PASS="some SHA256 hashed secret in quotes"
```

- `POSTGRES_IPS`: The POSTGRES server IPs comma separated.
- `OTREE_IPS`: The OTREE server IPs comma separated.
- `POSTGRES_USER`: The POSTGRES database username.
- `POSTGRES_DB`: The POSTGRES database name used by oTree.
- `POSTGRES_PASSWORD`: The POSTGRES user password.
- `OTREE_REST_KEY`: The oTree REST KEY to access the oTree API.
- `SECRET_KEY`: A secret key used to generate a waiting room URL signiture token.
- `API_KEY`: An API key to access the admin REST API for the waiting room.
- `URL_PASS`: A password used to access the waiting room info/helper pages. This password is created using the helper script `create-url-password-hash.js`

## Setup experiments config.json file

The Server needs to know some details of the oTree experiments being hosted on the servers.
Expand Down Expand Up @@ -92,7 +103,7 @@ Group by Arrival Time scheduler i.e. it will group people on a first come first

## File database

By default the waiting room will save user details in a json file database `data/userdb.json`.
By default the waiting room will save user details in a sqlite file database `data/userdb.sqlite`.
A different file can be passed as a parameter using `--db-file` option when starting the server.
The database stores the used urls i.e. urls that have alreaddy been used by a user.
On restarting the server waiting room, these urls are removed from the list of available urls so that
Expand All @@ -112,7 +123,13 @@ start the server with --reset-db flag.

## Generate test URLs

Use the encode-url.js helper script to generate test urls.
Use the helper URL path to generate tests URLS:

```
http://localhost:8060/urls/[EXPIMENT_NAME]/[NO_OF_URLS]?secret=[SECRET_USED_IN_URL_PASS]
```

Or use the encode-url.js helper script to generate test urls.

```shell
node encode-url.js -n 5 -h localhost:8080
Expand Down Expand Up @@ -150,6 +167,18 @@ To create session URLs for an experiment use the helper command `sessions.js`
node sessions.js create [NAME] --num [NUM OF PARTICIPANTS]
```

## Simple info dashboard

The server comes with a simple info page showing the number of available URLs, number of users and user ids per session.
The info page is accessed through the following path:

```
http://localhost:8060/info/[EXPERIMENT_NAME]?secret=[SECRET_USED_IN_URL_PASS]
```

E.g. for Experiment `DropOutTest`
![DropOutTest](./droptouttest_info.png)

## Starting the server using PM2

To manage the server with pm2, first install pm2
Expand Down
Binary file added dropouttest_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6a79c7b

Please sign in to comment.