The VitiVir database was developped as part of the INRAE project MYCOVIR with the goal of identifying and discovering grapevine associated phytoviruses and mycoviruses. The following instructions can be used to set up the VitiVir database locally.
Clone repository
+ vagrant up
+ vagrant ssh
+ cd /vagrant
Within the vagrant ssh
+ mkvirtualenv venv_viti --python=python3
to work with venv_viti
+ workon venv_viti
to deactivate the virtuan environment
+ deactivate
In vagrant ssh Activate venv
+ cd /vagrant
+ pip install -r requirements.txt
Within the vagrant ssh In Vagrant, locking isn't supported when syncing files, so npm install fails without symlinking node_modules outside of the synced folder. The name of this directory MUST be node_modules. See here for more information.
+ mkdir ~/node_modules
+ cd /vagrant/src/vitivir_frontend
+ rm -rf node_modules package-lock.json
+ sudo npm cache clean -f
+ ln -s ~/node_modules node_modules
+ npm init
[enter, enter, enter...]
+ npm install
If symlinks are not functioning, enable them manually in Vagrany by:\
-
On the host machine: Windows
cd C:\Program Files\Oracle\VirtualBox
MacOScd /Users/username/VirtualBox\ VMs
-
Run the following command:
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
replacing VM_NAME with your Virtual Machine's name (if you don't know this, in VBox go to Machine > Settings > General > Basic > Name --- also replace SHARE_NAME with the name of your shared folder, if you don't remember this, go to Machine > Settings > Shared Folders. verify with:VBoxManage getextradata "<vm name>" enumerate
-
Restart your VM AND VirtualBox, run as administrator
First time setup
In a new terminal, execute:
+ cd /path/to/vitiVir
+ vagrant ssh
+ sudo mkdir /data
+ cd /data
+ sudo mkdir db
+ sudo chmod 777 /data/db
Start mongod\
+ mongod
or start mongod in the background using:
+ sudo service mongod start
Mongo shell
Run to execute queries in MongoDB:
+ mongo
For instructions on how to populate the database, see the README.md in the db/ directory.
First time setup - migrate db and create superuser
+ cd /path/to/vitiVir
+ vagrant ssh
+ cd /vagrant/src/vitiVir_project
+ workon venv_viti
+ python manage.py makemigrations
+ python manage.py migrate
+ pyton manage.py createsuperuser
Then run the server with:
+ python manage.py runserver 0.0.0.0:9000
On your local browser, go to http:https://0.0.0.0:9000/
urls: /admin/ /api/data/entries/ /api/data/entries_csv/ /users/
In a new terminal with the venv activated, execute:
+ cd /path/to/vitiVir
+ vagrant ssh
+ cd /vagrant/src/vitivir_frontend
+ npm run serve
+ touch /vagrant/src/vitivir_frontend/.env
Inside .env, add your backend path (where Django is running). Example:
VUE_APP_API_HOST='http:https://localhost:9000'
On your local browser, go to http:https://0.0.0.0:8080/landing