Skip to content
Paul Kiddle edited this page Sep 5, 2019 · 1 revision

Environment Guide

App server

Software Requirements:

  • Python v3.6 (& pip)
  • Node.js v10 (& npm)
  • openctm

The phenome10k web application is written in Python3 as a Flask application. Many of the views are written using Vue.js as .vue files, and require Node both for transpilation to JavaScript and for on-demand server-side rendering.

As part of the upload process, 3D models are converted to CTM files for viewing in the browser using the JSC3D library. This process uses the ctmconv tool from the openctm library.

Config & environment:

By default the application stores data in the working directory, including using sqlite as the database. The application can be configured using the following environment variables:

Key Description
SECRET_KEY Flask encryption key
DATABASE_URL URL of database to connect to, including protocol
THUMB_DIRECTORY Path of directory to store automatically generated thumbnails to
MODEL_DIRECTORY Path of directry to save original uploaded models to
UPLOAD_DIRECTORY Path of directory to save all other user files to
LOG_FILE Filepath of where to write logs to
MAIL_DEFAULT_SENDER From address of emails sent by the system
ADMIN_EMAIL Email of admin user to send admin-related requests to

These may also be added to a .env file either in the working directory or the parent directory (parent takes priority).

Production environment

The production environment comprises two load balancers in HA-pair configuration, two app servers, and one data server for mysql database and nfs file storage. The storage server is to be replaced in future by separate database and nfs clusters.

The private variables used on production are stored in the museum's Vault service.

Deployment

The application can be deployed to production using the ansible script included in the project's git repository. Instructions on how to run the script are included in the README.md file. There is also a vagrant-based local test/development available.

Clone this wiki locally