sudo npm install -g yo generator-phovea
mkdir name_of_new_plugin
cd name_of_new_plugin
yo phovea
cd name_of_new_plugin
yo phovea:add-dependency
cd name_of_new_plugin
yo phovea:add-extension
cd name_of_new_plugin
npm install
npm run start
to get latest project updates and bugfixes
npm install -g github:phovea/generator-phovea
cd name_of_plugin
yo phovea:update
If you are developing multiple plugins at the same time a "workspace"
using Docker and
Docker Compose
can make the process easier. Creating a workspace this way also generates a PyCharm project.
The basic idea is to use the parent directory of the plugins, so that they can
share a common npm installation and docker setup.
Make sure you have NPM, Yeoman, Docker
and Docker Compose installed.
mkdir workspace
cd workspace
git clone https://github.com/phovea/phovea_server.git
# AND/OR clone any other repos that you will need.
yo phovea:resolve
yo phovea:workspace
npm install
docker-compose up
To add other Phovea plugins, halt Docker by hitting ctrl-C, and then:
# For example, if you want to support interactions with a SQL database:
git clone git@github.com:phovea/phovea_data_sql.git
yo phovea:resolve
yo phovea:workspace
npm install
docker-compose build api
docker-compose up
npm run start:name_of_application
cd workspace
yo phovea:clone
e.g., pull all git repos
cd workspace
./forEach git pull
The generator contains a special command to setup a workspace based on a Phovea product definition. This will clone all the repositories, download data packages, install dependencies, and build docker for you. By convention, product definition repositories are ending with the _product
suffix. For example, setting up the workspace for TaCo:
yo phovea:setup-workspace taco_product