Skip to content

Commit

Permalink
Merge pull request #75 from i-on-project/staging
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
RicardoFilipe99 authored Jul 22, 2021
2 parents 2bbd291 + 5724315 commit ca68878
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .docker/docker-compose-heroku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
context: ../project
dockerfile: ./web-dockerfile
args:
OPERATION_MODE: "${OPERATION_MODE-core-data}"
OPERATION_MODE: "${OPERATION_MODE-integrated}"
CORE_URL: "${CORE_URL-http://172.17.0.1:10023}"
CORE_READ_TOKEN: "${CORE_READ_TOKEN-l7kowOOkliu21oXxNpuCyM47u2omkysxb8lv3qEhm5U}"
CORE_CLIENT_ID: "${CORE_CLIENT_ID-22dd1551-db23-481b-acde-d286440388a5}"
Expand Down
2 changes: 1 addition & 1 deletion .docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
context: ../project
dockerfile: ./web-dockerfile
args:
OPERATION_MODE: "${OPERATION_MODE-core-data}"
OPERATION_MODE: "${OPERATION_MODE-integrated}"
CORE_URL: "${CORE_URL-http://172.17.0.1:10023}"
CORE_READ_TOKEN: "${CORE_READ_TOKEN-l7kowOOkliu21oXxNpuCyM47u2omkysxb8lv3qEhm5U}"
CORE_CLIENT_ID: "${CORE_CLIENT_ID-22dd1551-db23-481b-acde-d286440388a5}"
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ i-on Web has the following functionalities available:
- Make it possible to view the list of selected courses;
- Notify the student, on the home page, of upcoming events (tests, exams, among others) of the courses he / she attends;
- Construction of the student's calendar with the events of the courses to which he is enrolled;
- Make it possible to download the student's schedule.
- Make it possible to download (pdf file) the student's schedule;
- Allow the user to change his/hers username.

i-on Web is continuously being developt, as such, more funcionalities will be / are being added, namely:

- User settings that allow the user to change the programme, username, among other information;
- Switch the language (between Portuguese and English) of the web interface.

# Getting started
Next we will see how we can run the i-on Web application according to its operation modes and using docker compose.

## Docker-compose
The docker compose file contains the following enviroment variables:
- __`OPERATION_MODE`__ - Where we can specify the operation mode. As seen previously, the operation mode by default, is using the i-on Core data;
- __`OPERATION_MODE`__ - Where we can specify the operation mode. By default, its integrated mode which connects to i-on Core;

- __`CORE_URL`__ - Where we can indicate the location of i-on Core. By default is set to `http://172.17.0.1:10023` since i-on Core listens on port `10023` and since both applications are running locally but in isolated containers, in order to make requests from i-on Web to i-on Core we can use the IP `172.17.0.1`;

Expand All @@ -82,18 +82,17 @@ When building the docker image we can specify the development operation mode by
docker-compose -f .docker/docker-compose.yml build --build-arg OPERATION_MODE="standalone"
```

In similarity to the command previously shown, where we assigned a value to the variable `OPERATION_MODE`, the same can be done with the remaining variables. Assigning the multiple variables can be done, like the following example:
```
docker-compose -f .docker/docker-compose.yml build --build-arg OPERATION_MODE="standalone" --build-arg CORE_CLIENT_ID="22dd1551-db23-481b-acde-d286440388a5"
```

### Integrated mode
This mode allows us to run the i-on Web application using the data provided by i-on Core, as such, both i-on Web and i-on Core need to be running locally. In order to download and run i-on Core please head to the [i-on Core GitHub repository](https://github.com/i-on-project/core).

The environment variables present in the docker compose file should be enough for us to establish a connection to i-on Core, as such, we only need to execute the following command on the __root directory__:
```
docker-compose -f .docker/docker-compose.yml build
```
In similarity to the command previously shown, we can assign values to the enviroment variables, as shown in the following example:
```
docker-compose -f .docker/docker-compose.yml build --build-arg PATH_PREFIX="/i-on-web" --build-arg CORE_READ_TOKEN="l7kowOOkliu21oXxNpuCyM47u2omkysxb8lv3qEhm5U"
```

## Running i-on Web
After executing the build command, in order to run i-on Web locally we can execute the following command on the __root directory__:
Expand Down
Binary file added docs/i-on Web Relatorio Final.pdf
Binary file not shown.
Binary file added docs/i-on Web Relatorio Intercalar.pdf
Binary file not shown.
Binary file added docs/i-on Web Relatório Inicial.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions project/i-on-web-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ async function configurations() {

};

const timeToRetry = 60000;
const retryInterval = 5000;
const timeToRetry = 5 * 60000; // 5 min
const retryInterval = 4 * 5000; // 20s
let timePassed = 0;
const myInterval = setInterval(async () => {
if(timePassed < timeToRetry) {
Expand Down

0 comments on commit ca68878

Please sign in to comment.