Installation
via Docker:
- Install Docker (https://docs.docker.com/v17.12/install/) and Docker-Compose (https://docs.docker.com/compose/install/)
- Clone the repo:
git clone https://scm.cms.hu-berlin.de/callidus/mc_frontend.git
- Move to the newly created folder:
cd mc_frontend
- Make sure to assign at least 4GB RAM (Memory) to the Docker engine, otherwise the build will fail.
- Run
docker-compose build
. - Run
docker-compose up -d
and enjoy!
via Command Line:
- Clone the repo:
git clone https://scm.cms.hu-berlin.de/callidus/mc_frontend.git
- Move to the newly created folder:
cd mc_frontend
- Run
npm install
- Run
npm install -g @angular/cli
(you may needsudo
). - Check that the Angular command line interface is installed by running
ng --version
. It should print the version of the Angular CLI. - Run
npm start
. If you already rannpm install
and the CLI still complains about missing dependencies, install them one by one usingnpm install DEPENDENCY_NAME
. - Open http://localhost:8100 in your browser.
Production Build
To build the application for production environments, use: ionic cordova build browser --prod --release --max-old-space-size=4096
and serve the content of the platforms/browser/www
folder, e.g. with Nginx.
Development
To add new pages to the application, use: ionic generate page PAGE_NAME
.
Access to the Docker container
docker-compose down
to stop and remove the currently running containers.
To access a running container directly, get the container ID via docker ps
and connect via docker exec -it CONTAINER_ID bash
. Or, for root access, use: docker exec -u 0 -it CONTAINER_ID bash
To snapshot a running container, use docker commit CONTAINER_ID
. It returns a snapshot ID, which you can access via docker run -it SNAPSHOT_ID
.
Use Configuration
Backend URL
To change the URL for the backend, use the ionic.config.json
file (proxies > proxyUrl). By default, the system assumes that backend and frontend are installed on the same machine.
Frontend URL
Use the --host 0.0.0.0 --disable-host-check
flag for ng serve
if you want to use it in a production environment with an Nginx server using proxy_pass.
Other
For all other kinds of configuration, use src/configMC.ts
.
Testing
To test the application and check the code coverage, run npm run test
.