-
During this guide we assume you are working on either a Linux machine or on Windows Subsystem for Linux (WSL).
-
Make sure you have created a
data
folder within theapi
folder in the root of the application. This folder is not included in the GitHub repository due to privacy reasons.- Make sure that within the
data
folder there is also anessays
,processLabel
,spiderScript
, andtest
folder. Finally, alabel_names.csv
file must be present in thedata
folder. - The
essays
folder contains the text-written essays. - The
processLabel
folder contains the patterns for every student which is necessary for plotting the graphs. - The
spiderScript
folder contains the language scaffolds needed for the script to process text from the essays. - The
test
folder contains the pre- and posttest files needed for each pilot as a baseline.
- Make sure that within the
You should have access to these files, if not please contact the product owner.
-
In your command line, clone the repository using the command
git clone https://github.com/PeaceDucko/flora-lighthouse.git
-
Create a virtual environment using
virtualenv venv
in the root folder of the project. If you don't have virtualenv pre-installed then follow the steps in the command line to install virtualenv -
Once the virtual environment is created type
source venv/bin/activate
(Linux) to activate the environment -
Install the required packages into the environment using
pip install -r requirements.txt
. Due to some large language packages this might take a while -
When the packages are installed you can run the application. Change into the
api
folder usingcd api
and run Flask:$ flask run --port=5000
Sometimes port 5000 is taken, in that case use another port.
- Congrats! Your app is running. Go to
localhost:<port>
to check out the api andlocalhost:5000/docs
to check the api documentation. 7. If you want to see the results of a single user (for example user fsh4_360 on port 5000) go tolocalhost:5000/result?studentNumber=fsh4_360
To get access to the FLORA Lighthouse API you first need access to the credentials which are required to establish a secure shell tunnel into the Radboud servers. These credentials are found in the main folder of the shared Google Drive under the name credentials.txt
. When you have the credentials you can continue to the next step.
- Establish a secure shell between your PC and the Radboud servers by executing the command
ssh joep@131.174.75.218
from your command window. Enter the password when asked. Note: if this is your first time logging into the server you will be asked to confirm the fingerprint. Answer yes. - Once in the server, type and execute
./start.sh
to execute the bash script. This should launch the API on localhost 127.0.0.1 and port 5000 - Open a new command window and make sure you are not logged into the server. Execute the command
ssh -N -L 5000:localhost:5000 joep@131.174.75.218
and enter the password which you used before. Nothing interesting should happen but when you navigate to 127.0.0.1:5000/home you should see the text"This is my first API call!"
Once the SSH tunnel is established between the server and your local machine you can start working with the API. Documentation of the API, its usage and endpoints can be viewed on the URI /docs
(so: on localhost this is http://127.0.0.1:5000/docs/)
This API does not yet use authentication methods