Vue 2 + PHP application for synesthesia research tests, built with Vite and stored in SQLite.
- Install JS dependencies with
yarn install. - Install PHP dependencies with
composer installinserver/. - Copy
.env.exampleto.envand adjust paths if needed. - Start Vite with
yarn dev. - Start PHP with
yarn dev:php. - Open
http://localhost:8000.
The API will create the SQLite database automatically at first request. You can also hit /api/setup.
Backups are pushed to SURFdrive over WebDAV:
- automatic backup:
- checked on normal page loads
- runs only when data changed since the last successful backup
- retries at most once per hour if a previous automatic attempt failed
- manual backup:
GET /backupGET /api/backup
Required env vars:
SURFDRIVE_WEBDAV_URL- full target WebDAV folder URL
SURFDRIVE_USERNAMESURFDRIVE_PASSWORD
Each successful backup uploads:
- a timestamped
profiles-*.csv - a timestamped
questions-*.csv profiles-latest.csvquestions-latest.csv
The app can refresh synesthesia_config directly from GitHub:
GET /updateGET /api/update
Update workflow:
- download the GitHub archive for
BSTN/synesthesia_configmaster - validate YAML and expected file structure there
- only replace the live
synesthesia_configdirectory if validation passes
Validation errors are returned with file-specific messages.
Optional env overrides:
CONFIG_REPO_URLCONFIG_REPO_BRANCHCONFIG_REPO_ARCHIVE_URL
Runtime diagnostics are available at:
GET /diagnosticsGET /api/diagnostics
This reports:
- PHP version / environment
- whether
curl,ZipArchive,pdo_sqlite, andsqlite3are available - whether config/data/temp paths are present and writable
- whether GitHub archive download is reachable from the host
- Use
server/as the web root if your hosting panel allows it. - Run
yarn buildbefore deployment soserver/dist/contains the frontend assets. - Run
composer install --no-devinserver/. - Ensure the directory configured by
DATA_PATHis writable by PHP. - Keep
synesthesia_configdeployed next to this repository and pointCONFIGPATHto it. - Ensure PHP has:
pdo_sqlitesqlite3curl
BASE
- Base path for the application, default
/.
CONFIGBASE
- Public path to the config repository, default
/synesthesia_config.
CONFIGPATH
- Filesystem path to the config repository, default
../synesthesia_config.
APP_ORIGIN
- Vite dev server origin, used only in development.
APP_ENV
- Application environment, default
production. Usedevelopmentlocally.
DATA_PATH, SQLITE_PATH, TEMP_PATH
- Writable filesystem paths for the SQLite database and temp/export files.
SURFDRIVE_WEBDAV_URL, SURFDRIVE_USERNAME, SURFDRIVE_PASSWORD
- WebDAV destination and credentials used by backup sync.
- Fonts still depend on the configuration/assets already used by the app.