Unverified Commit 07d921fc authored by Jhoan Manuel Muñoz Serrano's avatar Jhoan Manuel Muñoz Serrano Committed by GitHub

[159111761] Getting Started Docs (#47)

* [159111761] Getting Started Docs

- Add documentation for getting stated with the application 
- Add config.properties template
- Minor fixes to the read me document
parent bbd0013a
......@@ -5,7 +5,54 @@ Bio-studies web application provides http services used by submission tool and w
1. Temporally data storing
1. Security login and access check
# How to generate artifacts
## Getting Started
### Dependencies
In order to build and execute the application in your local environment, it's necessary to have the following
dependencies installed:
* Java SDK (version 8 at least)
* Gradle 4.7
* Docker
>Notes: <br/>
Oracle Java should be used instead of openJDK <br/>
Docker needs to be configured to be used without super user privileges. Check
[here](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) for more info.
### Application Setup
Once the dependencies mentioned above are up and running, please follow these steps to configure the application:
1. Clone the repository
2. Go to the app directory
3. Execute `gradle build`
4. Move to `BackendWebApp` folder
5. Execute `gradle setUpDatabase`
6. In a different location from the repository, create a folder which will be used as the **nfs** folder
7. Go to `BackendWebApp/src/test/resources/nfs/templates` directory
8. Copy the `config.properties` file into the **nfs** folder, created in step 6
9. Replace `${BASE_PATH}` with the actual path for the **nfs** folder
10. Open `BackendWebApp/src/main/resources/application.yml` file
11. Set the `baseDir` property to the path for the **nfs** folder
12. Go back to root directory
13. Execute `gradle bootRun`
14. The application should now be up and running at
[http://localhost:8586/biostd/test/testLogin.html](http://localhost:8586/biostd/test/testLogin.html)
### Session Key
There are two mechanisms to get a session key to be used for the requests to the backend:
* **Command Line:**
1. Inside `BackendWebApp` folder execute `gradle getAuthToken`
2. Copy the value after **Session Key:**
* **UI:**
1. Go to [http://localhost:8586/biostd/test/testLogin.html](http://localhost:8586/biostd/test/testLogin.html)
2. Type the username `admin_user@ebi.ac.uk`
3. Type the password `123456` (yes, we know, remember this is a local instance :grimacing:)
4. Leave the PassHash field empty
5. Click `Login`
6. Copy the value after **Session Key:**
## How to generate artifacts
Both war and jar deployment type is supported only execute build command
gradle bootJar
......
db.hibernate.cache.use_query_cache=false
db.hibernate.cache.use_second_level_cache=false
db.hibernate.ejb.discard_pc_on_close=true
db.hibernate.connection.url=jdbc:mysql://localhost:3306/BioStudiesDev?useSSL=false
db.hibernate.dialect=org.hibernate.dialect.MySQLDialect
db.hibernate.connection.username=root
db.hibernate.connection.password=admin
db.hibernate.connection.driver_class=com.mysql.jdbc.Driver
db.hibernate.hbm2ddl.auto=none
db.hibernate.c3p0.max_size=20
db.hibernate.c3p0.min_size=0
db.hibernate.c3p0.timeout=5000
db.hibernate.c3p0.max_statements=50
db.hibernate.c3p0.idle_test_period=300
db.hibernate.c3p0.acquire_increment=2
db.hibernate.show_sql=true
db.hibernate.search.default.indexBase=index
db.hibernate.search.default.directory_provider=filesystem
db.hibernate.search.lucene_version=LUCENE_54
biostd.createFileStructure=true
biostd.enableUnsafeRequests=true
biostd.workDir=temp
biostd.userGroupDir=dropbox
biostd.userGroupIndexDir=ugindex
biostd.submissionDir=submission
biostd.submissionHistoryDir=history
biostd.submissionTransactionDir=transaction
biostd.publicFTPDir=${BASE_PATH}/FTP
biostd.updateDir=updates
biostd.updateWaitPeriod=30
biostd.defaultSubmissionAccNoPrefix=SBMd-
biostd.defaultSubmissionAccNoSuffix=-def
biostd.mandatoryAccountActivation=false
biostd.dataMountPath=/data
biostd.recapcha_private_key=6Lcmlv0SAAAAANysy6M8YdozfJnOQxc2JB9WaOS1
......@@ -7,4 +7,4 @@ RESPONSE=$(curl -s \
TOKEN=$(echo $RESPONSE | python -c 'import sys, json; print json.load(sys.stdin)["sessid"]');
echo "Auth Token: $TOKEN";
echo "Session Key: $TOKEN";
......@@ -2,7 +2,7 @@
## Modules
### Backend Web App
Java application that support bio studies data submission thought http web services.
Java application that supports the bio studies data submission thought http web services.
### Core Model
Contains model/database representation classes of Bio-Studies backend application.
......@@ -14,13 +14,13 @@ Contains utility methods and classes.
Contains utility methods and classes used to read submissions input files.
### Submit Tools
Help perform submissions thought terminal
Helps to perform submissions through terminal
### Convert tool
Helps to converts between different submissions formats
Helps to convert between different submissions formats
## Coding standards
Project follow google [java coding standards](https://google.github.io/styleguide/javaguide.html)
The project follows the google [java coding standards](https://google.github.io/styleguide/javaguide.html)
- [Eclipse formatter](https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml)
- [Idea formatter](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml)
......@@ -30,7 +30,7 @@ Project follow google [java coding standards](https://google.github.io/styleguid
### Importing project
import as gradle project in your favorite IDE
Import as gradle project in your favorite IDE
### Generating artifact
......@@ -43,4 +43,3 @@ Run gradle build command either using local distribution or wrapper
```
Generated war will be available under `BackendWebApp/builds/libs` folder.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment