unillett/dilps-tiresias

Sponsored OSS

By UNIL

Updated 6 days ago

Image database of the Art History and Architecture sections

Image
Security
Content management system
Databases & storage
0

10K+

unillett/dilps-tiresias repository overview

Dilps/Tiresias

Master: ci

Development: ci

Introduction

Dilps/Tiresias is a web application based on GraphQL for the API and Angular for the client.

Open in GitHub Codespaces

Installation

The recommended way to get a working copy is the following:

  1. Set up a nginx virtual host to point to htdocs/ directory and to include configuration/nginx.conf
  2. Create a database in MariaDB named "dilps"
  3. Configure database in config/autoload/local.php (see example config/autoload/local.php.dist)
  4. Copy & rename the example.env file to .env (cp example.env .env). Replace the values if needed.
  5. Finally, build the app:

./bin/build.sh

Development with Docker

Docker installation

A working Docker installation is mandatory.

Environment files

Copy the following files:

cp example.env .env
cp dev/example.env dev/.env
cp config/development.config.php.dist config/development.config.php
cp config/autoload/local.php.dist config/autoload/local.php
cp config/autoload/tiresias.local.php.dist config/autoload/tiresias.local.php
cp config/autoload/development.local.php.dist config/autoload/development.local.php

You can replace the values if needed, but the default ones should work.

Edit hosts file

Edit hosts file to point dilps.docker and tiresias.docker to your docker host.

Environment installation & configuration

Run the following docker commands from the project root directory.

Build & run all the containers for this project:

docker compose up (add -d if you want to run in the background and silence the logs)

The project is compiled each time the containers are started. You'll get a Build at log message as soon as everything is ready to be used.

To load some dummy data & users, please run the following command:

docker exec dilps-tiresias-app ./bin/load-test-data.php

To access the application container (apache-php):

docker exec -it dilps-tiresias-app bash

Data for the mysql service is persisted using docker named volumes. You can see what volumes are currently present with:

docker volume ls

If you want to remove a volume (e.g. to start with a fresh database), you can use the following command.

docker volume rm volume_name

Frontends

To access the main application please use the following links.

MailHog

To access mails please use the following link.

http://dilps.docker:8027

Or to get the messages in JSON format.

http://dilps.docker:8027/api/v2/messages

Server

To switch the API to development (to enable logging), run:

composer development-enable

Logs will be available in logs/all.log.

Configuration caching

When in development mode, the configuration cache is disabled, and switching in and out of development mode will remove the configuration cache.

You may need to clear the configuration cache in production when deploying if you deploy to the same directory. You may do so using the following:

composer clear-config-cache

Testing

PHPUnit

PHPUnit tests require a reference database dump. When the dump is loaded it will destroy existing database. This must be done once before running tests. Then each test is ran within a transaction which is rolled back, so the database state is always predictable.

To run PHPunit test:

./bin/load-test-data.php
./vendor/bin/phpunit # as many times as necessary
Karma

Run ng test to execute the unit tests via Karma.

End to end

Run pnpm e2e to execute the end-to-end tests via Playwright.

Credits

This project is tested with BrowserStack.

Tag summary

Content type

Image

Digest

sha256:37f112ed1

Size

508 MB

Last updated

6 days ago

docker pull unillett/dilps-tiresias

This week's pulls

Pulls:

306

Last week