Skip to content

tsg-humlab/autinto

Repository files navigation

TODI Frontend

This folder contain the code to both the mdbook (uploads/) containing the course text content and the exercise widget source code (js/).

Structure

For more information on the Resynthesis module, which handles resynthesis web requests, look at the README in resynthesis/

Dependencies

You need to install both mdbook (either prepackaged or built from source) and npm.

Run npm install in js/ to install all necessary javascript dependencies.

To install all necessary Python dependencies run pip install -r requirements.txt

The contour image creation uses the tool pdftocairo, which means that Poppler must be installed (poppler-utils on Ubuntu).

Lastly, the project needs a Praat executable. This project has been tested with Praat version 6.3.10. In particular, it will not work on Praat version 6.2. When installing, be sure to put the nogui version of Praat in the resynthesis folder, with the name praat_nogui. The executable used in development can be found here.

Build

To build the entire project, run npm run build in js/.

The full html build can then be found under static/.

Running the server

python3 manage.py runserver

Setting up the SFTP server

To set up the SFTP server, follow this tutorial and use the uploads folder as directory for the server. Change users and permissions the way you like. You can then connect to it over SSH by either using a client like filezilla or by using the sftp command.

Setting up Nginx

To set up Nginx, follow this tutorial and use the todi folder as Django project and the corresponding paths on your system. Also uWSGI is needed but that is explained in the tutorial.

Error messages frontend

In the valdiate.js script, you can change the rules and the error messages the user gets depending on their input when they click on "resynthesize". Using the combination of the key and the filled annotations (which are arrays that do not include the by-default filled-in annotations), a rule can be made.