This is the repository for the SPARC-Portal Web Application. The application is build using Nuxt.js and Vue.js.
It depends on the SPARC-API which can be found here
We recommend using Anaconda to create and manage your development environments for KnowMore. All the subsequent instructions are provided assuming you are using Anaconda (Python 3 version).
Clone the repo and submodules
git clone https://github.com/SPARC-FAIR-Codeathon/KnowMore.git --recurse
Open Anaconda prompt (Windows) or the system Command line interface then naviguate to the KnowMore folder
cd ./sparc-app$ conda create -n "sparc-app-env" nodejs=12.14.1 yarn
$ conda activate sparc-app-env$ yarn install
The environment variables required are listed in the table below along with information on how to get them
| Suggested name | Value or instructions for obtaining it | Purpose |
|---|---|---|
| PORTAL_API_HOST | "http://localhost:3000" | |
| FLASK_API_HOST | "localhost:5000" | |
| CTF_SPACE_ID | ||
| CTF_CDA_ACCESS_TOKEN | ||
| CTF_API_HOST | cdn.contentful.com | |
| SCICRUNCH_API_KEY | ||
| ALGOLIA_API_KEY | ||
| ALGOLIA_APP_ID |
Each of them can be set in your conda environment as follows
$ conda env config vars set MY_VAR=value1 MY_OTHER_VAR=value2$ yarn dev
$ yarn build
$ yarn start
$ yarn generate
For detailed explanation on how things work, check out Nuxt.js docs.
- hot reload for frontend server isn't working, seems like each time it reloads it starts reading on a path that prepends the prefix (
sparc-app) Everytime.-
e.g., first time it's correct (
http://localhost:3000/sparc-app/enrich-data-for-datasets) -
second time it prepends the prefix again (
http://localhost:3000/sparc-app/sparc-app/enrich-data-for-datasets) -
third time it adds the prefix again, and so on
-
To solve, just restart the dev server and start again using
yarn dev
-
This can happen even if all data for graph vis is correct, but there's some other error that happens before vega finishes that messes stuff up. Probably need better error handling so this doesn't happen...but it's happening, so just know that the vega spec can be perfect but this still happens