How To Create An Application
A quick summary of How To Create An Application
Create a new application
An application is the end point of the Phovea platform implementing an interface for the user. For example, Ordino is an application plugin.
This tutorial requires you to complete the following steps / tutorials (with links):
Create a client-side application
- Go to the directory of the workspace you want to add the application
yo phovea:init-appand follow the prompts.
npm run build
The build step is optional since it is not required for testing/development.
The build process itself includes:
- running all unit tests -> karma
- checking code quality -> tslint
Create a server-client application
Here we assume that you want to create a client side app, called
myapp, that speaks to a server side app
myapp_server. The workspace directory is called
myapp_workspace. Note that plugins must always be lowercase.
Create the client side as follows:
- Go to the directory of the workspace
yo phovea:init-appand follow the prompts. This initializes a new client app.
If you have an existing phovea client side app, you can just clone that repository into this directory.
Create the server side as follows:
yo phovea:init-sliband follow the prompts. The promt asks you for your application's name, put in
myapp. This initializes a new server app.
Clone and resolve the
phovea_server as follows:
yo phovea:clone phovea_serverand follow the prompts.
If you are developing against the
develop branch (which is very likely), you must also switch the repository to the
Adding other plugins
yo will resolve all dependencies for you. If you, however, want to also edit things like
phovea_core at the same time, you can just check it out and switch it to the right branch:
yo phovea:clone phovea_core cd phovea_core git checkout develop
If you want to change any phovea plugins, you should first create a new feature branch. Don't commit directly to develop or master.
Keep Docker running.
Keep Docker running.
docker-compose up -d
npm run start:myapp
Now in the browser check adress
http://localhost:8080/ for accessing the app or
http://localhost:8080/api/hello_world/ for accessing the API.