Module | Description | Application Version |
---|---|---|
aggregated-test-report | creates aggregated test report (using jacoco) | 1.0.0 |
auth | responsible for authentication | 1.0.0 |
data-feed | allow to import / export data to the system using csv format | 1.0.0 |
defense-schedule | responsible for defense schedule process | 1.0.0 |
domain | the database model containing db history (liquibase) | 1.0.0 |
notification-management | responsible for sending notifications to users | 1.0.0 |
permission-management | management of user's permissions | 1.0.0 |
persistence | the layer with database operations) | 1.0.0 |
pri-application | module containing the main class | 1.0.0 |
project-management | creating and updating the project | 1.0.0 |
user-management | responsible for user management | 1.0.0 |
Name | Used Technology |
---|---|
language | java 17 |
building tool | maven |
framework | Spring Boot |
database | PostgreSQL |
database change management | Liquibase |
database for tests | H2 |
authentication | LDAP, jwt token |
mapping | MapStruct |
logging | SLF4j |
unit testing | maven surefire plugin |
integration testing | maven failsafe plugin, RestAssured, MockMvc |
code coverage | jacoco |
others | lombok, springdoc-openapi, FreeMarker, OpenCSV, Jackson |
System is build based on the modular layered architecture.
- Model Layer - all entities are defined withing the module
domain
- Data Access Layer - all repositories are placed in the module
persistence
- Service and Controller layers are defined withing each functional module (respectively:
service
andcontroller
packages within the module) - Shared modules (like
permission-management
andnotification-management
) contains only service layer
List of feature flags:
Feature Flag | Bahaviour |
---|---|
FF_EMAIL_TO_UNIVERSITY_DOMAIN_ENABLED |
false - e-mails which contains the domain defined in the variable EMAIL_UNIVERSITY_DOMAIN are not senttrue - emails are sent to users always |
FF_LDAP_AUTHENTICATION_ENABLED |
false - mock authaticantion is usedtrue - real ldap is used for authentication |
To enable scheduled jobs, the variable SCHEDULED_JOBS_ENABLED
has to be set to true
List of scheduled jobs:
Scheduled job | Behaviour |
---|---|
EvaluationCardFreezeScheduledJob |
job freezes the semester evaluation card in the defense day (and creates the evaluation card in phase defense) After freezing process, user with STUDENT role does not see the grades till the grades are published |
- installation of: maven, java 17
- creation of Postgres database
- substitution of all environment variables (see config.env.example file)
Secrets must be defined as java
command arguments (see Starting the application)
or provided to the IDE as e.g. ENV variables - depending on the run method.
To use mocked ldap authentication:
- the variable
ldap.authentication.enabled
has to be set tofalse
- mocked ldap data are in the file
ldap-mock-data.ldif
Coordinator user has to be added manually to the database, to the USER_DATA
table, and has to have the
COORDINATOR role assigned (table USER_ROLES
)
The coordinator user index number corresponds to the LDAP username.
To autogenerate an xml file with changes (e.g. when new entities were added), first navigate to the domain
module (cd domain
), and then execute:
mvn liquibase:diff
(Be sure, that the database connection data are set in the liquibase.properties
file.)
This command will generate a changes in the file: liquibase-diffChangeLog.xml
. Then the content should be reviewed and
pasted in the target file in resources.config.liquibase
. Finally, the new file should be added to 'changeLog.xml'
file.
Run application with the profile local
To run the application use an IDE build in option (e.g. in IntelliJ) or execute in command line:
mvn clean package
java -jar -Dspring.profiles.active=local <environment variables> pri-application/target/pri-application-1.0-SNAPSHOT.jar
// before execution check the name of the jar file
// as <environment variables> put all variables from config.env.example file (e.g. -DPOSTGRES_URL=${POSTGRES_URL} -DPOSTGRES_DB=${POSTGRES_DB})
Check out deploy repository.
Minimum required code coverage for each module (except the excluded ones): 40%
Modules excluded from code coverage:
- aggregated-test-report
- domain
- persistence
- pri-application
model
and exception
packages are not counted into the code coverage.
To run the unit tests, run the command:
mvn clean package
To run all tests (unit tests and integration tests) with code coverage, run the command:
mvn clean verify
The aggregated test report is created in aggregated-test-report module (path: target/site/jacoco-aggregate/index.html
)