https://github.com/mfvanek/salary-calc
Demo app for salary calculation (Spring Boot)
https://github.com/mfvanek/salary-calc
checkstyle hacktoberfest jacoco java java-21 jpa junit5 maven pmd postgresql spotbugs spring-boot spring-boot-3 swagger
Last synced: over 1 year ago
JSON representation
Demo app for salary calculation (Spring Boot)
- Host: GitHub
- URL: https://github.com/mfvanek/salary-calc
- Owner: mfvanek
- License: apache-2.0
- Created: 2020-08-31T11:18:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-05T11:54:59.000Z (over 1 year ago)
- Last Synced: 2025-03-05T12:32:53.683Z (over 1 year ago)
- Topics: checkstyle, hacktoberfest, jacoco, java, java-21, jpa, junit5, maven, pmd, postgresql, spotbugs, spring-boot, spring-boot-3, swagger
- Language: Java
- Homepage:
- Size: 521 KB
- Stars: 7
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# salary-calc
Demo app for salary calculation (Spring Boot)
[](https://github.com/mfvanek/salary-calc/actions/workflows/tests.yml)
[](https://github.com/mfvanek/salary-calc)
[](https://github.com/mfvanek/salary-calc)
[](https://sonarcloud.io/summary/new_code?id=mfvanek_salary-calc)
[](https://sonarcloud.io/summary/new_code?id=mfvanek_salary-calc)
[](https://sonarcloud.io/summary/new_code?id=mfvanek_salary-calc)
[](https://sonarcloud.io/summary/new_code?id=mfvanek_salary-calc)
[](https://sonarcloud.io/summary/new_code?id=mfvanek_salary-calc)
## Requirements
Java 21+
Spring Boot 3.3+
## API
### Actuator
[Swagger UI](http://localhost:8090/actuator/swagger-ui)
[Health](http://localhost:8090/actuator/health)
### Endpoints
```shell
curl http://localhost:8080/api/employee/dcffa631-595a-44e6-8f8c-1c077de895bf
```
```shell
curl -i -X POST -d "{\"firstName\": \"John\",\"lastName\": \"Wick\",\"standardHoursPerDay\": 8,\"salaryPerHour\": 5000}" http://localhost:8080/api/employee -H "Content-Type: application/json"
```
```shell
curl http://localhost:8080/api/employee/all
```
## Run locally
### With database from Testcontainers
```
mvn spring-boot:run -Dspring-boot.run.profiles=local -Dspring-boot.run.jvmArguments="-Duser.timezone=Europe/Moscow"
```
### With external database
```
mvn spring-boot:run -Dspring-boot.run.profiles=extern -Dspring-boot.run.jvmArguments="-Duser.timezone=Europe/Moscow"
```
## Run in Docker
### Build image
```
mvn clean spring-boot:build-image -DskipTests -DskipSpotbugs=true
```
### Build native image
**_Unfortunately, built application doesn't start in container_**
```
mvn clean spring-boot:build-image -DskipTests -DskipSpotbugs=true -Pnative
```
### Docker Compose
#### Start
```shell
docker-compose --project-name="salary-calc" up -d
```
#### Stop
```shell
docker-compose --project-name="salary-calc" down
```