For development, we sometimes want to run the testcenter locally without docker.

Requirements

Minimal requirements are: npm, node, php, apache2, MySQL. Have a look into the dockerfiles to get the exact versions.

Installation

Start

Install node-dependencies

npm install

cd frontend
npm install
cd ..

cd backend
npm install
cd ..

cd broadcasting-service
npm install
cd ..

Install php-dependencies

cd backend
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install
cd..

Create Database

Create Backend Config

Create a file backend/config/config.ini with your credentials and settings.

[database]
host=...
name=...
password=...
port=...
user=...

[broadcastingService]
external=http://localhost:3000/public/
internal=http://localhost:3000

[password]
salt=t

[system]
hostname=localhost
timezone=Europe/Berlin

[debug]
useInsecurePasswords=no
allowExternalXmlSchema=yes
useStaticTokens=no
useStaticTime=now

[language]
dateFormat=d/m/Y H:i

Not that files-service and cache-service are currently not available in local installation.

Initialize Backend

sudo --user=www-data php backend/initialize.php

Tipp: If you don’t want to use the broadcasting-service omit the last two lines.

Serve Backend

Disable cors

cp backend/config/no-cors.htaccess .htaccess

Prepare Frontend

echo "export const environment = { production: false, testcenterUrl: 'http://localhost/testcenter/backend/', fastLoadUrl: 'http://localhost/testcenter/backend/' };" \
 > frontend/src/environments/environment.ts

Run

Frontend

cd frontend
npm run start

Broadcasting-Service

(optional)

cd broadcasting-service
npm run start

File-Service

Can not be run locally. It is not needed because files can be served by the regular backend as well.