In collaboration with communication design and web development studio Yil & Mann, the Berlin Art Prize e.V. has developed an online-based tool for anonymized selection processes. Complex artist portfolios are submitted and anonymized via the software. For the jury process, a linked CMS allows the portfolios to be viewed, indexed, and classified via interactive evaluation functions. The application is kept simple and streamlined for all users. Overall, the YesNoMaybe app is intended to prevent discrimination in selection processes and focus attention on the content of the applications.
The application is in alpha state While we tried to minimize the chance to introduce vulnerabilities (authentication/file-system), this application and its codebase haven't been audited by security specialists and it shouldn't be used to store, share or publish sensitive information.
Developers should be able to setup a new project by providing Firebase Config file and update the links to a Hasura instance (cloud/self-hosted). Please check the section Getting Started for more details regarding the configuration of Firebase and Hasura. The Section Deploy contains information on how to built the frontend.
Other authentication/storage/hosting providers may be added at a later stage.
- install Angular CLI
- install Hasura CLI
- install Docker
- install Firebase CLI
- Built upon the Hasura GraphQL engine
- Frontend built with Angular + Tailwind CSS
- Multi-language support (supported languages: EN/DE)
- Authentication (e-mail/password with Firebase Authentication)
- File Storage (supported with Firebase Storage)
- Automatic image resizing (built with Firebase Functions)
- Automatic video converter (built with Firebase Functions and Coconut.co)
- Angular for Frontend
- Hasura as Database and GraphQL Layer
- Firebase
- Firebase Authentication
- Firebase Storage
- Firebase Hosting
- Firebase Functions
- Firebase Remote Config (for App Settings etc)
- Coconut.co for automatic video conversion
cd frontend
- duplicate
.env.example
and rename to.env
and adapt accordingly. Please adapt firebase env accordingly (see firebase section) npm i
npm start
- duplicate
.env.example
and rename to.env
and adapt accordingly. please adapt firebase env accordingly (see firebase section) docker-compose up -d
cd database
- First time:
hasura migrate apply --admin-secret myadminsecretkey --envfile .env
hasura metadata apply --admin-secret myadminsecretkey --envfile .env
hasura migrate apply --admin-secret myadminsecretkey --envfile .env
hasura metadata reload --admin-secret myadminsecretkey --envfile .env
hasura console --admin-secret myadminsecretkey
Important: always run via hasura console --admin-secret myadminsecretkey
inside folder database
to keep track of changes!
Currently, session variables are not available in computed fields by default and/or can be added via the console but must be added via the Hasura Endinge API. For more details see their article: Accessing Hasura Session Variables in Computed Fields.
rated_by_user
field
The field rated_by_user
has to be added via the Hasura API on each machine hasura will run on.
- POST to
http://localhost:8080/v1/query
Request
POST /v1/query HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
X-Hasura-Admin-Secret: <your-admin-secret>
{
"type": "add_computed_field",
"args": {
"table": {
"name": "applications",
"schema": "public"
},
"name": "rated_by_user",
"definition": {
"function": {
"name": "application_rated_by_user",
"schema": "public"
},
"table_argument": "application_row",
"session_argument": "hasura_session"
}
}
}
Expected Response
{
"message": "success"
}
hasura metadata export --admin-secret myadminsecretkey
hasura migrate squash --name "<feature-name>" --from <start-migration-version> --admin-secret myadminsecretkey
hasura migrate apply --version "<squash-migration-version>" --admin-secret myadminsecretkey --skip-execution
hasura metadata apply --endpoint <external-hasura-endpoint> --admin-secret <admin-secret>
hasura migrate apply <squash-migration-version> --database-name default --admin-secret <admin-secret> --endpoint <external-hasura-endpoint>"
hasura metadata reload --admin-secret <admin-secret> --endpoint <external-hasura-endpoint>
Firebase config data will be extracted via REST-API before publishing the project. (see Firebase Remote Config API as an example)
cd functions
firebase login
and select your project- Set the admin account which gets the team role assigned on sign-up with
firebase functions:config:set hasura.admin_email="webmaster@example.com"
- (optional) Set automatic team member accounts by defining your email domain with
firebase functions:config:set hasura.team_role_email_domain="@example.com"
- Set admin secret key for synchronization from Firebase back to Hasura with
firebase functions:config:set hasura.endpoint="http://localhost:8080/v1/graphql"
- Set admin secret key for synchronization from Firebase back to Hasura with
firebase functions:config:set hasura.admin_secret="myadminsecretkey"
- Set shared secret key so hasura is able to interact with firebase storage with
firebase functions:config:set hasura.shared_secret="somesecuresecretkey"
To be able to download PDF files and show them inside the application tool, you need to configure CORS for Firebase Storage
- Run
gsutil cors set cors.json gs://<your-cloud-storage-bucket>
in the root folder. For more information check the documentation.
cd functions
npm install
firebase init emulators
firebase functions:config:get > .runtimeconfig.json
npm start
Limitation: Currently only S3 Buckets are supported
Videos are automatically converted via Coconut.co For support the following environment variables must be set for firebase:
firebase functions:config:set coconut.api_key="k-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
firebase functions:config:set coconut.access_key="XXXXXXXXXXXXXXXXXXXXXXXX"
firebase functions:config:set coconut.secret_key="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
firebase functions:config:set coconut.webhook="https://app.coconut.co/tools/webhooks/<coconut-webhook-id>/<user-name>"
;
Check https://docs.coconut.co/ for more information.
The Hasura database and GraphQL engine can be deployed either via Hasura's own Cloud Service, which offers a fairly generous free tier. Otherwise you can deploy Hasura on your own server. Please see their documentation for all deployment guides: https://hasura.io/docs/latest/graphql/core/deployment/deployment-guides/index.html
The app can be deployed using Firebase Hosting, but any other static file server should work as well (for example Netlify, GitHub Pages or your own server).
For deploying the application, the build script needs to run inside the frontend folder npm run build:prod
.
Firebase Hosting example: cd frontend && npm run build:prod && cd .. && firebase deploy --only hosting
- Add function to let the team add notes to applications the jury should see when evaluating an application, e.g. where to pause a video.
- Add internal tagging system.