diff --git a/.gitignore b/.gitignore index 5fa467d6..9f55d977 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,6 @@ package-lock.json cert.cnf localhost.crt localhost.key + +# Docker +compose/data/ diff --git a/README.md b/README.md index 5b998084..bfbc7dac 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,69 @@ HyperIoT Front End Angular Application is a project that includes all tools nece This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.13. -Node v16 is required to run this project. +Node v16 and Angular CLI are required to run this project. -## Libraries Build +## Getting Started + +The following instructions provide a step-by-step guide for setting up and developing Hyperiot-app locally. + +### Install dependencies + +use `npm install` to install project dependencies + +### Libraries Build HyperIoT-app relies on `core`, `components` and `widets` libraries. Before running the application it is necessary to build the libraries with the command `ng build ` > Note: Libraries should be build in the following order: core, components, widgets -## Development server +> Note: `npm run build-libs` can be used to build the libraries sequentially + +### Hyperiot Services + +The application requires backend services for most of its functions. For development purposes, it is possible to use Docker to start the services locally by following the procedure below. + +- Install Docker +- Login to acsoftware registry with `docker login https://nexus.acsoftware.it:18079` using the following credentials: +```sh +username: hyperiot-read-user +password: hyperiot-read-user +``` +- Run `docker-compose -f compose/docker-compose-svil-microservices-only.yml up` +- You can now divert the requests of your application to your local hyperiot services using `proxy-local.config.json` file. + +> Note: docker-compose-svil-microservices-only will start zookeeper, postgresql and karaf-microservices only. If additional services need to be launched, it is possible to modify the compose file or create a new one + +> Note: Data streaming will not work with the basic configuration + +### Development server 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. -## Internationalization +### Proxy + +Use the `--proxy-config` option to specify a proxy configuration file (e.g. `ng serve --proxy-config proxy-local.config.json`) +Refer to the [Angular proxy documentation](https://angular.io/guide/build#proxying-to-a-backend-server) for additional info. + +> Note: Use `npm start` (or `ng serve --proxy-config proxy-local.config.json`) to start the application that proxies calls to your local services. + +### Internationalization The project is designed to support multiple locales. Current available locales are english (default) and italian. Use the `--configuration` option to start the application with a specified locale. (e.g. `ng serve --configuration it`). Refer to the [Angular internationalization documentation](https://angular.io/guide/i18n-overview) to add new locales or for additional info. -## Proxy - -Use the `--proxy-config` option to specify a proxy configuration file (e.g. `ng serve --proxy-config proxy.config.json`) -Refer to the [Angular proxy documentation](https://angular.io/guide/build#proxying-to-a-backend-server) for additional info. - -## Code scaffolding +### Code scaffolding 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`. -## Build +### Build Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. -## Further help +### Further help 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). ---- - ## License Apache 2.0 License (click [here](./License.MD) to see license information.) diff --git a/docker-compose-svil-all-except-frontend.yml b/compose/docker-compose-svil-all-except-frontend.yml similarity index 100% rename from docker-compose-svil-all-except-frontend.yml rename to compose/docker-compose-svil-all-except-frontend.yml diff --git a/docker-compose-svil-basic.yml b/compose/docker-compose-svil-basic.yml similarity index 100% rename from docker-compose-svil-basic.yml rename to compose/docker-compose-svil-basic.yml diff --git a/docker-compose-svil-microservices-only.yml b/compose/docker-compose-svil-microservices-only.yml similarity index 100% rename from docker-compose-svil-microservices-only.yml rename to compose/docker-compose-svil-microservices-only.yml diff --git a/data/.gitkeep b/data/.gitkeep deleted file mode 100644 index e69de29b..00000000