Skip to content

TEESlab-UPRC/prospect-plus-rdm

Repository files navigation

Recommendations-Decision Matrix Tool

PROSPECT+ Recommendations-Decision Matrix tool, powered by TEESlab.

Requirements

  • PHP 8.1

For development & building

  • Node.js (>=16, latest LTS recommended)
  • Composer

Setup

composer install
npm ci
cp .env.example .env
php artisan key:generate

Make a DB and update .env as needed.

php artisan migrate
php artisan db:seed

Development

Debugging

php artisan serve
npm run dev

Test by connecting to the Artisan server. For debugging the PHP side, XDebug can be used (+ PHP Debug plugin, if on VS Code).
Vite should hot reload parts of the app, as files get changed (note: if using WSL2, this might not trigger, if the workspace is stored on Windows' hard drives, instead of inside WSL's FS).

DB migrations

set up/upgrade DB: php artisan migrate
reset DB: php artisan migrate:fresh --seed
add DB table: php artisan make:migration create_<name>_table --create=<name>
alter DB table: php artisan make:migration <change>_<name>_table --table=<name>

DB seeding

run seeders: php artisan db:seed
new seeder: php artisan make:seeder <name>
for the seeder to be called, it has to be executed via DatabaseSeeder's run function, using the call method, like so:

$this->call([
    ...,
    <name>::class,
]);

i18n

Translations in PHP: __($key, $replacements)
Text Translations in JS: t(key, replacements)
HTML Translations in React element properties: {...tHTML(key, replacements)}
see resources/js/Helpers/TransHelpers.js

The language files are in JSON and in lang.
They can automatically be added to and translated using the following commands:

  • Auto-add simple entries (from code & DB) and translate lang files: php artisan lang:gen
  • Add new EN entry, no translation: php artisan lang:add <langKey>
  • Translate lang files from EN: php artisan lang:translate <engine> <lang>

Automatic translations require a DeepL API key and a Google Cloud Translation API key to be set in .env.
Extra settings for the automatic translations can be found in config/autotranslate.php.

Building & deploying

Adjust .env accordingly.

composer install --no-dev --optimize-autoloader --no-plugins --no-scripts # for automations, also: --no-ansi --no-interaction --no-progress
npm run build

The web server should serve public.
More deployment info here.

Licensing notes

The LICENSE does not apply to the images included in this repo.
The fonts in this repo are licensed under the SIL Open Font License, Version 1.1.

Disclaimer

This tool was developed under the H2020 PROSPECT+ project.
The PROSPECT+ project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 101023271. The content of this page is for information purpose only. The relevant legal instruments and the text of the call shall take precedence over the information contained in this page. The European Commission or CINEA does not accept responsibility for any use made of the information contained therein.

About

Prospect+ Recommendations-Decision Matrix tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published