This project was bootstrapped with Create React App and Spring initializr.
For building and running the application you need:
- JDK 11
- Maven 3
- Postgres database
Folder structure options and naming conventions for software projects
.
├── docker # docker-compose file for development mode
├── frontend # React frontend source files
├── src # Backend Source files
├── target # Compliled files
└── README.md
- Run database containers
docker-compose up -d`- Run backend
./mvn spring-boot:run- Run frontend app
npm install
npm startRuns the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
- Edit the file
.env.prodwith the base url. Example
REACT_APP_API_URL=http://poc-add-dev/pocscheduler-0.0.1-SNAPSHOT/- Generate the war package
./mvn clean package -D frontend.env=prod
Run SonarQube with docker
docker run -d --name sonarqube -p 9000:9000 sonarqubeAdd the following plugin to pom.xml file
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.9.1.2184</version>
</plugin>
Run the following command
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=generated-token
If you want to add code coverage to sonarQube
- Add jacoco plugin to the project link
- run test + sonarQube