satzbeleg / evidence-app

UI for the EVIDENCE project (BBAW/TUD)
Apache License 2.0
1 stars 0 forks source link
vue3

EVIDENCE project - Web Application (Vue3)

Table of contents

Purpose

The web application is programmed with Vue3 and provides user interfaces to conduct Best-Worst Scaling surveys about sentence examples, and search for good and diverse sets of sentence examples. The Web App accesses the databases via the REST API.

Installation

Please follow the instruction of the deployment repository.

Local Development

Start backend services

cd $EVIDENCE_DEPLOY 
docker-compose up --build dbauth dbeval mail api

Add a test account

cd $EVIDENCE_DEPLOY 
cat restapi/test/addtestaccount.sql | docker exec -i evidence_dbauth psql -U evidence -d evidence
username : nobody@example.com
password : supersecret

Setup and start local web server

1) Install NPM modules

yarn install

2) Setup .env

NODE_ENV=local
VUE_APP_REST_PUBLIC_URL=http://localhost:7070
# NODE_ENV=production
# VUE_APP_REST_PUBLIC_URL=https://youractualdomain.org
VUE_APP_GOOGLE_CLIENT_ID=verylongsometing.apps.googleusercontent.com

Please look here for help about .env. All variables needs to prefixed VUE_APP_ to be available as process.env.VUE_APP_... JS variable in Vue. Never expose secret keys or passwords as Vue environment variable because they are exposed on client-side.

3) Start web server

# export NODE_OPTIONS=--openssl-legacy-provider
yarn serve --port 9090

Use Node v16 to avoid the "error:0308010C:digital envelope routines::unsupported" Error

nvm install 16

Useful commands

Customizations

The source code contains files that are specific to the project AUTHORS needs, and must be customized to your needs if you decide to deploy this software.

Common Problems

CORS Error: Setup GCP bucket for TFJS models

echo '[{"origin": ["*"],"responseHeader": ["Content-Type"],"method": ["GET", "HEAD"],"maxAgeSeconds": 3600}]' > cors-config.json
gsutil cors set cors-config.json gs://tfjs-models-1

Force Cache Refresh

Bump the pwa.assetVersion value up in ./vue.config.js.

Changing the App Name

You need to change the following files:

Other

Appendix

Support

Please open an issue for support.

Contributing

Please contribute using Github Flow. Create a branch, add commits, and open a pull request. You are asked to sign the CLA on your first pull request.

Syntax

We are using