1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00
REST api for demos.tf
  • PHP 87.4%
  • Nix 8.3%
  • JavaScript 3.4%
  • Makefile 0.5%
  • Dockerfile 0.4%
Find a file
2017-03-19 17:42:12 +01:00
Controllers upload wip 2017-01-31 13:34:54 +01:00
Demo upload wip 2017-01-31 13:34:54 +01:00
Providers fix queries 2017-03-19 17:42:12 +01:00
public import 2016-12-04 01:17:46 +01:00
.dockerignore import 2016-12-04 01:17:46 +01:00
.gitignore import 2016-12-04 01:17:46 +01:00
app.php fix queries 2017-03-19 17:42:12 +01:00
composer.json upload wip 2017-01-31 13:34:54 +01:00
composer.lock upload wip 2017-01-31 13:34:54 +01:00
Dockerfile import 2016-12-04 01:17:46 +01:00
Makefile fix queries 2017-03-19 17:42:12 +01:00
README.md readme 2017-01-31 13:48:33 +01:00

demos.tf api

Backend code for demos.tf

WIP

This repo is still somewhat wip and might not be in the state yet where it can deployed outside of the existing demos.tf environment.

Database

The api requires a PostgreSQL database to function, the database schema required can be found in 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 seperate 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

Installing

To install the project composer is required.

composer install

Deploying

Deploying the api requires php5.6 or later, the webserver needs to be configured to server all requests to public/index.php

The database details need to be configured with the same environment variables as are described for the docker image above. The environment variables can also be be put in a .env file in the root of the project.