REST api for demos.tf
  • PHP 87.4%
  • Nix 8.3%
  • JavaScript 3.4%
  • Makefile 0.5%
  • Dockerfile 0.4%
Find a file
2025-06-04 18:24:49 +02:00
.forgejo/workflows workflow updates 2025-05-25 14:31:25 +02:00
.phan add phan 2017-07-30 15:57:14 +02:00
nix update parser to 0.6.1 2025-06-04 18:24:49 +02:00
src separate key files for module 2025-05-19 21:36:32 +02:00
test separate key files for module 2025-05-19 21:36:32 +02:00
.dockerignore update parser 2020-02-02 22:52:09 +01:00
.envrc add flake 2022-11-10 18:59:23 +01:00
.gitignore flake reorg, nix integration testing 2024-12-24 18:31:46 +01:00
.php-cs-fixer.dist.php fmt, typings, typos 2022-05-16 00:51:50 +02:00
composer.json flake reorg, nix integration testing 2024-12-24 18:31:46 +01:00
composer.lock update flight 2024-03-17 00:59:12 +01:00
Dockerfile fpm config 2022-08-01 20:24:40 +02:00
flake.lock 25.05 2025-05-28 22:02:15 +02:00
flake.nix update parser to 0.6.1 2025-06-04 18:24:49 +02:00
LICENCE Create LICENCE 2017-04-13 14:37:52 +02:00
Makefile add xdebug to flake 2024-06-30 14:36:56 +02:00
nginx_test.conf serve demos from test nginx 2022-05-09 22:10:32 +02:00
NginxTestDockerfile ensure chat is sorted 2020-11-28 02:08:41 +01:00
package-lock.json bumb dependencies 2019-01-26 21:17:15 +01:00
package.json bumb dependencies 2019-01-26 21:17:15 +01:00
php-fpm.conf update flight 2024-03-17 00:59:12 +01:00
README.md flake reorg, nix integration testing 2024-12-24 18:31:46 +01:00

demos.tf api

Build Status

Backend code for demos.tf

Database

The api requires a PostgreSQL database to function, the database schema required can be found in demostf/db/demos_schema.sql.

Note that the pg_trgrm extension in required.

Docker image

A prebuild docker image exists in the docker hub which contains nginx, php and this code.

A separate PostgreSQL database is required to run the image, the database details need to be configured with the following environment variables:

  • DB_TYPE=pgsql
  • DB_HOST=$database_host
  • DB_DATABASE=$database_name
  • DB_USERNAME=$database_user
  • DB_PASSWORD=$database_password
  • BASE_HOST=$host // the domain the frontend site will be running on
  • PARSER_URL=$parser_host // the full url for the demo parser's upload endpoint
  • DEMO_ROOT=/demos // the folder uploaded demos will be stored in
  • DEMO_HOST=static.$HOST // the hostname from which the uploaded demos will be served
  • APP_ROOT=api.$HOST // the domain the api will be running on

Installing

To install the project composer is required.

composer install

Deploying

Deploying the api requires php7.1 or later, the webserver needs to be configured to server all requests to public/index.php execept for request to /upload which needs to be handled by public/upload.php.

The database details need to be configured with the same environment variables as are described for the docker image above.

More information for hosting and a pre-configured docker based setup can be found at demostf/setup