THIS DOCUMENT REQUIRES UPDATING/REWORKING INTO MULTIPLE DOCS
https://ics-c.epos-ip.org/testing/epos-epos-gui/master/
Install Docker and run the epos-gui image:
https://www.docker.com/
https://hub.docker.com/r/wshelley/epos-gui/
- Discover (search)
- Visualise (spatial, temporal, etc)
Using the filters and map we can find People, Organisations, Software, Services and Data in a variety of Domains across Europe.
By clicking on the ‘Spatial Visualisation’ page you can see a quick overview of all the datasets that have been added to the map. This will provide some basic GIS functionality to help explore and compare the data.
Equally by clicking on the ‘Temporal Visualisation’ page you can see a quick overview of all the datasets that have been added to time series graphs. Eventually there will be some basic filters and tools to help explore this kind of data too.
But if more complex analysis is required you can download the raw data or connect directly to the web services via the metadata and service links provided.
When we have completely the platform you will be able to login from a variety of credential providers (click guest login at top right, then sign in)
There is a ‘Feedback’ button on the top bar of the website – please click on there and let us know what you think!
We're building the GUI from the ground up, aiming to build as much code clientside (html, javascript, css) so it can be served by any webserver (inside or outside of docker). We're designing the code to be as clean, modular and to some extent isomorphic. So if we need to move some aspects to a server we can do at a later date.
After extensive analysis we have decided to use the Single Page Application (SPA) web framework Angular and the associated, application scale, javascript superset language Typescript. These will help structure the project and enforce the original design principles above.
Languages: Typescript, Javascript, CSS, HTML
Framework: Angular
Location: epos-gui/src/app/
Dependencies: epos-gui/src/assets/
NPM Dependencies: epos-gui/package.json & epos-gui/node_modules/
Install node.js: https://nodejs.org/en/
git clone GIT_PROJECT_URL
cd epos-gui
npm install -g @angular/cli
npm install
The suggested IDE for development id VS code: https://code.visualstudio.com/
Some vs code plugins that will make life easier:
- ESLint
- Angular Language Service
npm start
Test on web browser on host machine: http://localhost:4200
Changes are detected by the angular-cli and the site is recompiled and auto refreshed.
npm test
This runs:
- Linting of entire source code (style and general code analysis)
- Unit Tests where provided by each source file (functions return expected values/behaviours)
- End-to-End testing of the application (application runs and works as expected to the agreed performance levels)
To run interactive (opens browser etc.) cypress e2e tests locally use:
ng e2e
To run them through from the command line use:
npm run e2e-run
Within 'epos-gui/src/app/app.module.ts' change the providers[] from 'mockApiServiceProvider' to 'devApiServiceProvider'
(Mock API has been removed, it served its purpose during early implementation stages, became a hinderance to productivity)
Within 'epos-gui/src/app/shared/api/mockApi.service.ts' change the call to 'return this.doMockLiveSearch()' as shown below
public doSearch(type: SearchType, searchCriteriaMap: Map<SearchCriteria, any>): Promise<ItemResultList> {
switch (type) {
case (SearchType.GENERIC): return this.doMockLiveSearch();
// case (SearchType.GENERIC): return this.doStationSearch();
}
}
For production docker image building - docker building below.
Alternatively:
ng build --prod --extract-css=false
Then deploy the epos-gui/dist/ folder on a webserver of your choice.
Note: the application makes use of the HTML5 browser url rewrites as part of Angulars routing so the web server config needs to be able to route all subpaths to the root index.html file.
E.g. http://website.com/myapp/mysuburl --> /myapp/index.html
An example nginx config can be found at: epos-gui/nginx-config/nginx-docker-sites-enabled-default
cd /opt/epos-gui/
./gitlab/build-docker-image.sh
Grab a Cuppa while dependencies are downloaded/compiled/installed! ☕
To explore inside the running docker image:
docker exec -it epos-gui bash
Test on web browser on host machine: http://localhost:8080
docker tag epos-gui wshelley/epos-gui:latest
docker login
docker push wshelley/epos-gui
Compodoc (https://compodoc.app/) is being used to create html documentation from code comments.
They can be generated locally by using the following command.
node_modules/.bin/compodoc -p src/tsconfig.doc.json --includes=docs
By adding "-s" to the command you can serve the docs locally. By also adding "-w" to the command, it will watch the files and generate and serve the new html documentation as you change the files.
node_modules/.bin/compodoc -p src/tsconfig.doc.json --includes=docs -w -s
The pipelines are set up to generate and serve these docs, so if you navigate to your deployed branch root, then add "/documentation/index.html" to the the url, you can interact with the documentation for your branch. e.g. for master branch: https://ics-c.epos-ip.org/testing/epos-epos-gui/master/documentation/