a firebase app to annotate abstracts
- Create a firebase account
- Click on "Web Setup" and copy paste your config into
src/firebaseConfig.js
- Go to the Authentication and click "Sign-In method" and enable Email/Password
- Go to the Database tab and click "Rules" and copy paste the following:
{
"rules": {
".read": "auth != null",
".write": "auth != null",
"users": {
".read": true,
".write": "auth != null",
},
"settings": {
".read": true,
".write": false,
},
"imageCount": {
".indexOn": ["idx", "num_votes", "ave_score"],
},
}
}
- run the app:
npm run dev
and openlocalhost:8080
. Create a new account - Go to the Database tab in Firebase. Create a key value pairs like this:
imageCount: 1
- Click on imageCount. Import a JSON file w/ pointers to your images into here:
{
pmid: {
N: 0,
num_votes: 0
},
...
}
where each pmid key is the pmid of the abstract you want to annotate. For example see: https://github.com/akeshavan/appstract/blob/master/autism_manifest.json#L1 .
-
Also host your images somewhere else (like S3), it will be cheaper to pull images from there instead of firebase. The images will be found at:
https://yourS3bucket/pmid.json
. The content of the json file should look like: https://d2ndgqavqxbnim.cloudfront.net/autism/21192986.json -
Edit the
imageBaseUrl
here https://github.com/akeshavan/appstract/blob/master/src/config.js#L3 to point to your abstract json files -
Start playing to test that it works
-
To deploy. make a firebase directory here:
mkdir firebase
cd firebase
firebase init
ONLY select the hosting option here. Then choose your project, and say yes to everything else. Then do:
cd ..
npm run build
cd firebase
cp -r ../dist/* public/
The npm
step builds all your files into a single html file and a set of js files. Then we move them to the firebase public
folder and then deploy:
firebase deploy
These instructions will probably change soon. The app is still being actively developed!
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For a detailed explanation on how things work, check out the guide and docs for vue-loader.