Revision 62915
Added by Antonis Lempesis about 1 year ago
modules/open-science-observatory-ui/trunk/README.md | ||
---|---|---|
1 |
# OpenScienceObservatoryUi
|
|
1 |
# Open Science Observatory UI
|
|
2 | 2 |
|
3 |
## Introduction |
|
4 |
## Architecture |
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
## Building |
|
9 |
|
|
3 | 10 |
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.0.4. |
4 | 11 |
|
5 |
## Development server
|
|
12 |
#### Minimum requirements for installing and building the project
|
|
6 | 13 |
|
7 |
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. |
|
14 |
[Node.js](https://nodejs.org/en/) version 8.x or 10.x.<br> |
|
15 |
[npm client](https://docs.npmjs.com/cli/install) command line interface (it is installed with Node.js by default). |
|
16 |
- [Node.js version 16](https://nodejs.org/en/blog/release/v16.16.0) |
|
8 | 17 |
|
9 |
## Code scaffolding |
|
18 |
###### Build Instructions: |
|
19 |
Follow the instructions below to download the source code and build the application. |
|
20 |
For more information about building an Angular app you can refer to the official documentation: [Building and serving Angular apps](https://angular.io/guide/build#building-and-serving-angular-apps). |
|
10 | 21 |
|
11 |
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. |
|
22 |
1. Clone the repository and move inside the directory |
|
23 |
<br> `git clone https://code-repo.d4science.org/MaDgIK/uoa-repository-manager-ui.git && cd uoa-repository-manager-ui` |
|
24 |
<br> `svn checkout https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/open-science-observatory-ui/trunk open-science-observatory-ui && cd open-science-observatory-ui` |
|
25 |
2. Install Angular dependencies |
|
26 |
<br> `npm install` |
|
27 |
3. Build Angular app |
|
28 |
<br> `ng build --configuration production` |
|
29 |
<br> Produces the directory "dist/**open-science-observatory-ui**" which contains the compiled files. |
|
30 |
<br> |
|
31 |
<br> |
|
12 | 32 |
|
13 |
## Build
|
|
33 |
## Deployment
|
|
14 | 34 |
|
15 |
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. |
|
35 |
### Prerequisites |
|
36 |
- Nginx |
|
16 | 37 |
|
17 |
## Running unit tests |
|
38 |
### Instructions |
|
39 |
To deploy the Frontend app: |
|
40 |
1. Make sure that you have successfully built and installed the application on Nginx (or another Web Server). |
|
41 |
2. _Start_ or _reload_ the Web Server service. |
|
42 |
<br>e.g. `systemctl start nginx` or `systemctl reload nginx` |
|
18 | 43 |
|
44 |
## Installation |
|
45 |
|
|
46 |
### Prerequisites |
|
47 |
- [Nginx](https://www.nginx.com/) (or another Web Server like [Apache HTTP Server](https://httpd.apache.org/)) |
|
48 |
|
|
49 |
<br> |
|
50 |
<br> |
|
51 |
|
|
52 |
|
|
53 |
### Installation |
|
54 |
|
|
55 |
#### Nginx Configuration |
|
56 |
You have to create a [Server Block configuration](https://www.nginx.com/resources/wiki/start/topics/examples/server_blocks/) that will point to the directory "dist/**open-science-observatory-ui**" created by [building manually](./building.md#manual-build) the webapp. |
|
57 |
It must also be configured as a reverse proxy for the Backend Application (to serve it under the path '/api') and for the list of [Dependencies](#dependencies) of the project. |
|
58 |
|
|
59 |
See the example below: |
|
60 |
```nginx |
|
61 |
server { |
|
62 |
server_name ... |
|
63 |
access_log ... |
|
64 |
root /path/to/open-science-observatory-ui; # the directory of the application |
|
65 |
|
|
66 |
location / { |
|
67 |
try_files $uri$args $uri$args/ /index.html /index.php; |
|
68 |
} |
|
69 |
|
|
70 |
location ~* \.(eot|ttf|woff)$ { |
|
71 |
add_header Access-Control-Allow-Origin *; |
|
72 |
} |
|
73 |
|
|
74 |
[...] |
|
75 |
} |
|
76 |
``` |
|
77 |
|
|
78 |
Lastly, we would advice to validate the configuration of the Nginx to make sure it does not contain errors. |
|
79 |
<br>Execute `nginx -t` with elevated permissions to perform a validation. If the test is successful you can move on to [deploying](./deployment.md#frontend) the application. |
|
80 |
|
|
81 |
<br> |
|
82 |
<br> |
|
83 |
|
|
84 |
## Configuration |
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
## Security |
|
90 |
## Maintenance |
|
91 |
## Recovery |
|
92 |
## References |
|
93 |
|
|
94 |
|
|
95 |
## Other topics |
|
96 |
### Development server |
|
97 |
|
|
98 |
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.<br> |
|
99 |
Run `npm run start:proxy` (equivalent of `ng serve --proxy-config proxy.conf.json`) instead, to run the project using a development proxy. To configure the proxy modify the `proxy.conf.json` file (inside the root folder). |
|
100 |
|
|
101 |
### Code scaffolding |
|
102 |
|
|
103 |
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. |
|
104 |
|
|
105 |
### Running unit tests |
|
106 |
|
|
19 | 107 |
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). |
20 | 108 |
|
21 |
## Running end-to-end tests |
|
109 |
### Running end-to-end tests
|
|
22 | 110 |
|
23 | 111 |
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). |
24 | 112 |
|
25 |
## Further help |
|
113 |
### Further help
|
|
26 | 114 |
|
27 | 115 |
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). |
Also available in: Unified diff
First version of documentation