LETICIA is a web platform intended to be an open-source solution to deploy study designs in the Interactive Information Retrieval (IIR) field. Besides deploying these studies, LETICIA can conduct them and collect various types of data from user's interactions. LETICIA presents several features out of the box that can be customized to researchers' needs: A built-in search engine, a tool to build document collections, an interactive application programming interface (API), a data logger, and a session flow manager.
For a quick deploy to test LETICIA's features, use the Docker deploy described below:
- Clone this repository or download it as ZIP
- Install required dependencies (Docker)
- Open the
src/
directory on your local version of this repository- Copy
.env.example
, rename it as.env
and edit the file to customize Environment Variables (if needed) - Run
leticia-build.sh
to build the Docker image of LETICIA - Run
leticia-up.sh
to run LETICIA as a Docker container
- Copy
- Open the
extras/
directory on your local version of this repository- Run
load-example-content.sh
, this will populate the database with some assets to test the platform
- Run
Now you can test the platform on localhost:3000
in a web browser. You can access to OpenAPI documentation on localhost:3001/openapi
. The MongoDB Database can be reached at localhost:3010
and the Solr Inverted Index can be accessed at localhost:3011
. To stop the LETICIA platform, run leticia-down.sh
located on the src/
directory.
LETICIA is designed to run on GNU/Linux distributions and it was tested on Ubuntu Server 20.04 LTS. The required software dependencies are listed as follows:
- Node.js (tested on LTS v16.x)
- MongoDB (tested on version 5.0)
- Solr (tested on version 8.11.1)
- Java JDK (tested on OpenJDK 11)
- Install the required dependencies (instructions are available below)
- Download or clone this repository
- On LETICIA's repository
src/
directory, copy.env.example
, rename it as.env
and edit the file to customize Environment Variables (if needed) - On
src/
directory, runnpm install
to install Node.js dependencies - On
src/
directory, runnpm run dev
to start LETICIA in watch mode for development
You can run LETICIA in production mode by one of these options: Docker or PM2.
This setup is recommended for quick-and-easy deploys on high-performance servers. All dependencies are downloaded as Docker images.
- Install Docker and Docker Compose (instructions are available below)
- Download or clone this repository
- On LETICIA's repository
src/
directory, copy.env.example
, rename it as.env
and edit the file to customize Environment Variables (if needed) - On
src/
directory, run./leticia-build.sh
to download and generate all required dependencies - On
src/
directory, run./leticia-up.sh
to deploy LETICIA on background - On
src/
directory, run./leticia-down.sh
to stop running LETICIA
This setup uses less resources than the Docker option, but involves more steps and manual install of dependencies.
- Install Node.js, MongoDB, and Solr (instructions are available below)
- Install PM2 globally for Node.js:
npm install -g pm2
- On LETICIA's repository
src/
directory, copy.env.example
, rename it as.env
and edit the file to customize Environment Variables (if needed) - On
src/
directory, runnpm install
and then runnpm run clean && npm run build
- On
src/
directory, run LETICIA with PM2:pm2 start ecosystem.config.js
, other actions that can be performed with PM2 to control the plaform on production are available on the PM2 documentation
The following instructions are designed for Ubuntu 20.04 LTS. Adapt them if you are using another GNU/Linux distribution.
Run these commands to install latest Node.js LTS:
$ curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
$ sudo apt-get install -y nodejs
Run these commands to install MongoDB:
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org
$ sudo systemctl start mongod
$ sudo systemctl enable mongod
-
Solr requires Java 8 JDK or greater to run. Run these commands to install OpenJDK:
$ sudo apt-get update $ sudo apt-get install default-jre default-jdk
-
Run the following commands to install Solr:
$ cd /tmp $ wget https://archive.apache.org/dist/lucene/solr/8.7.0/solr-8.7.0.tgz $ tar xzf solr-8.7.0.tgz solr-8.7.0/bin/install_solr_service.sh --strip-components=2 $ sudo bash ./install_solr_service.sh solr-8.7.0.tgz
-
Create a new core (collection) in Solr for LETICIA:
$ sudo su - solr -c "/opt/solr/bin/solr create -c leticia -n data_driven_schema_configs"
This is required only for Docker production deploy.
-
Install required dependencies for Docker
$ sudo apt-get update $ sudo apt-get install ca-certificates curl gnupg lsb-release
-
Add Docker's GPG key
$ sudo mkdir -p /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
-
Set up Docker's repository
$ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
Install Docker and Docker Compose
$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
-
Enable using Docker for current user (without requiring
sudo
):$ sudo usermod -aG docker $(whoami) $ logout
To run LETICIA, a file with environment variables called .env
is required on project's src/
directory. You can copy and rename the .env.example
file to get the default settings, or you can customize this file to customize the deploy. The following environment variables are available on LETICIA:
Env Variable | Default Value | Description |
---|---|---|
LETICIA_HOST | localhost | IP address or DNS domain where LETICIA is running |
LETICIA_PROTOCOL | http | Protocol used by LETICIA (http or https) |
LETICIA_PORT | 3000 | Local port to deploy LETICIA's WebApp |
MONGODB_HOST | localhost | URL for MongoDB |
MONGODB_PORT | 27017 | Port for MongoDB |
MONGODB_DATA_DB | leticia-data | Database name for experimental data |
MONGODB_USER_DB | leticia-user | Database name for credential data |
SOLR_HOST | localhost | URL for Solr (inverted index) |
SOLR_PORT | 8983 | Port for Solr |
SOLR_CORE | leticia | Core/collection for Solr |
ENABLE_GOOGLE_LOGIN | true | Toggles Google SSO Login |
GOOGLE_CLIENT_ID | insert-id | Google SSO Login client id |
GOOGLE_CLIENT_SECRET | insert-secret | Google SSO Login client secret |
ENABLE_FACEBOOK_LOGIN | true | Toggles Facebook SSO Login |
FACEBOOK_CLIENT_ID | insert-id | Facebook SSO Login client id |
FACEBOOK_CLIENT_SECRET | insert-secret | Facebook SSO Login client secret |
ENABLE_EMAIL_LOGIN | true | Toggles Email Login |
JWT_KEY | secret | String for JWT token generation |
LETICIA_PILOT_MODE | false | Toggles LETICIA's Pilot Mode (deprecated) |
CURRENT_SESSION_FLOW | short | Activity flow to run with new participants |
ENABLE_FRONTEND | true | Toggles deploy of LETICIA's Frontend |
ENABLE_API_DOCS | true | Toggles deploy of LETICIA's OpenAPI Documentation |
After deploying LETICIA either in development or PM2 deploy mode, is possible to install a pre-populated database as an example to create new experimental assets. You can do so by running the following commands from the project's root directory:
$ cd extras/databaseScripts/
$ mongo leticia-data populateDataDatabase-en.js
The source code of LETICIA is available under the GNU Affero General Public License version 3.
LETICIA's frontend uses some royalty-free images from Pixabay. They can be replaced with custom images under the src/client/assets/
directory.