-
Notifications
You must be signed in to change notification settings - Fork 0
Powerboard setup guide
Devonfw-IDE is a tool to automate setup and update of development environment.
To build application on local execute below commands:
1. To setup the devonfw-IDE visit the download and install sections of this page
Once IDE setup is done. Clone Powerboard application in workspace:
- To clone the Powerboard web app visit Powerboard Web app
git clone -b develop-0.0.1 https://github.com/devonfw-forge/powerboard-webapp.git
-
To clone Powerboard business API visit Poweboard business API
git clone -b develop-0.0.1 https://github.com/devonfw-forge/powerboard-business-api.git
-
To clone Powerboard data aggregation service visit Data aggregation service
git clone -b develop-0.0.1 https://github.com/devonfw-forge/powerboard-data-aggregation-service.git
2. Database setup
To setup the database we need to perform the following steps:
- Install PostgreSQL
- Search for PgAdmin and open it, on opening we see the below screen
- Expand the left menu servers -> PostgreSQL13 -> Databases
- Right click on databases -> create -> Database as shown below
- Create database by entering database name and click on save
3. Build Powerboard backend
- Go to the My-Projects folder(created at install step) and open vscode-main.bat as shown below
-
Go to file and open the backend cloned project into the vs code
-
Create .env file inside the src folder
-
Add DB configuration in the .env file The following details should be present in the .env file
DB_PASSWORD= "enter your DB password"
DB_HOST="localhost"
DB_DATABASE="enter your database name"
DB_PORT=5432
DB_USERNAME="postgres" -
Execute the following commands to install all modules and build the application
npm install
yarn build -
To run the nest application execute the below command
yarn start:dev
After executing the above steps we se the below screen
- To run test cases execute the below command
yarn test:dev
4. Build data aggregation service
- Go to the My-Projects folder(created at install step) and open vscode-main.bat as shown below
-
Go to file and open the data aggregation cloned project into the vs code
-
Create .env file inside the src folder
-
Add DB configuration in the .env file The following details should be present in the .env file
TYPEORM_USERNAME = postgres
TYPEORM_PASSWORD = your password here
TYPEORM_DATABASE = database name
TYPEORM_PORT = 5432 -
Execute the following commands to install all modules and build the application
npm install
yarn build -
To run the nest application execute the below command
yarn start:dev -
To run test cases execute the below command
yarn test:dev
5. Build Powerboard frontend
- Go to the My-Projects folder(created at install step) and open vscode-main.bat as shown below
- Go to file and open the Powerboard web-app cloned project into the vs code
- Execute the below commands to build and run the application
- npm install
- ng serve
- On successfully executing the above commands we see the below screen
-
To run test cases execute the below command
ng test -
Localhost:4200 is default port where angular application starts in case the port is changed, change it in respective property as well.
-
To check sonar reports follow the following steps:
- Install SonarQube
- Extract sonarQube zip file in a folder
- Get into sonarqube -> bin -> windows-x86 -> click on StartSonar.bat
once sonar is up you can see the below screen
-
Create a new file at the root level named "sonar-project.properties.ts"
-
Add the following properties to the file:
sonar.host.url=http://localhost:9000
sonar.login= enter username
sonar.password= enter password
sonar.projectKey=test-app
sonar.projectName=test-app
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.exclusions=/node_modules/
sonar.exclusions=/src/config/model/
sonar.tests=src
sonar.test.inclusions=**/*.spec.ts
sonar.typescript.lcov.reportPaths=coverage/lcov.info -
Execute the below command to run sonar
-
npm install sonar-scanner --save-dev
-
npm run sonar
we see the below terminal once the above command runs successfully
-
npm install sonar-scanner --save-dev