Skip to content
Readme.md 2.28 KiB
Newer Older
Maxime Chaillet's avatar
Maxime Chaillet committed
# DOI landing page
## Introduction
Maxime Chaillet's avatar
Maxime Chaillet committed
This project handles the management of the doi landing page at ESRF.
A person is searching for information from a given DOI code. He/she can go to datacite [search page](https://search.datacite.org/) and will enter the doi code he/she is looking at. In response, from his own database, the datacite server will redirect the search to the doi landing page which is located on esrf server.
Maxime Chaillet's avatar
Maxime Chaillet committed

### Usage
In production, the doi landing page is part of a docker container containing an apache2 server. 
To perform a request use the following address (provided the page is accessible from doi.esrf.fr)
   http://doi.esrf.fr/DOIprefix/DOIsuffix



## Technicalities for developers

The grunFile.js has 2 tasks.
* the default task will check and prepare the project for production. js files will be minified and concatanated. Consequently debugging of the js files is not easy using this task. 
* the dev task which is meant for debugging purpose. In this case the js files are not minified.

### How to develop

Below are the steps to follow after the implementation of a new functionnality or for debugging purpose. In this mode, we use the dev.html page instead of the index.html.

* check js files, create the dev.html file from the dev.tpl.html template.
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
grunt dev
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
* copy the www folder  (not all files are needed but it is easy) to apache folder
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
sudo rm -fr /var/www/html &&  sudo cp -r www/. /var/www/html/
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
* access the doi landing page with the following address http://localhost/dev.html?DOI=prefix/suffix
Maxime Chaillet's avatar
Maxime Chaillet committed

### How to prepare the docker container
* check js files, concatene them, minify them, handle other js dependancies
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
grunt
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
* prepare the docker container
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
cd rootOfTheProject
sudo ./build.sh
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed

### How to test the page in production setting (ie using the docker container)
you can install the container locally to your docker instance
* start docker daemon
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
sudo /etc/init.d/docker start
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
* install the docker container created before.
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
cd rootOfTheProject
sudo ./run.sh
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed

Maxime Chaillet's avatar
Maxime Chaillet committed
* retrieve the name of the container which has been installed locally listing all none running containers
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
sudo docker ps -a
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed

* start the given container
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed
sudo docker start nameOfTheContainer
Maxime Chaillet's avatar
Maxime Chaillet committed
```
Maxime Chaillet's avatar
Maxime Chaillet committed

* access the doi landing page http://localhost:8092/DOIprefix/DOIsuffix