Skip to content

Get ready for development

Jan Stamer edited this page Jun 26, 2020 · 7 revisions

Setting up your IDE

Frontend:

todo

Backend:

Use whatever IDE you like, but please make sure you ..

  1. use the right file-encoding : UTF-8
  2. use our code formatter

Setting up the application

  • make sure git is installed :-)
  • clone the repository (it contain both: frontend and backend application)

Frontend:

Prerequesits:

  1. npm installed on your local machine (https://www.npmjs.com/get-npm)

Starting the application:

  1. go to the /frontend directory
  2. npm install
  3. ng serve

The application starts a webserver. Open localhost:4200 in your browser to see the application and expects the api top be available at localhost:8080.

Backend:

  1. java jdk 11 installed
  2. lombok installed and setup in your IDE (https://projectlombok.org/)
  3. maven installed
  4. go to the /backend directory
  5. mvn spring-boot:run -P inmemory => this maven profile starts the application with a h2 inmemory DB, filled with testdata

The project does also contain a docker file for a postgres DB, which you can use alternatively to the h2 DB.

Here are the steps to start the application with the postgres DB with docker:

  1. make sure docker is installed correctly (https://www.docker.com/products/docker-desktop)
  2. open command shell an go to the project's /backend directory
  3. run docker-compose up
  4. open another command shell
  5. get your container ID: docker ps
  6. start the container: docker exec -it <CONTAINER-ID> bash
  7. Execute Postgres as root: su - postgres
  8. create a user for your DB: createuser --interactive --pwprompt -s quarano-app
  9. define a password: quarano
  10. create databse: createdb -O quarano-app quarano
  11. create a local property file called "application-local.properties" in /backend/src/main/resources/
  12. File content:

spring.datasource.url=jdbc:postgresql://<IP-of-your-postgres-DB>:5432/quarano spring.datasource.username=quarano-app spring.datasource.password=quarano `spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect``

  1. in you shell go to /backend directory
  2. run mvn spring-boot:run