Awesome Open Source
Awesome Open Source

:projectKey: optaweb-employee-rostering :sonarBadge: image:{projectKey} :sonarLink: link="{projectKey}"

= Employee Rostering Optimization as a Service

image:[ "Build Status", link=""] image:[ "Ask question on Stack Overflow", link=""] image:[ "Join Zulip Chat", link=""]

{sonarBadge}&metric=alert_status["Quality Gate Status", {sonarLink}] {sonarBadge}&metric=reliability_rating["Reliability Rating", {sonarLink}] {sonarBadge}&metric=security_rating["Security Rating", {sonarLink}] {sonarBadge}&metric=sqale_rating["Maintainability Rating", {sonarLink}] {sonarBadge}&metric=ncloc["Lines of Code", {sonarLink}] {sonarBadge}&metric=coverage["Coverage", {sonarLink}]

An end-to-end[OptaPlanner] web application ready to deploy on[OpenShift 4].

See[the video demo].

== Building

Build the project with maven in the project's root directory:


mvn clean install -DskipTests -DskipITs

== Running

After building the project, run the application with:


java -jar optaweb-employee-rostering-standalone/target/quarkus-app/quarkus-run.jar

Then open http://localhost:8080/ to see the web application.

Alternatively, run npm start in optaweb-employee-rostering-frontend to start the frontend in one terminal, and run mvn quarkus:dev in optaweb-employee-rostering-backend to start the backend in another terminal.

=== Use a different port

To run on an another port use -Dquarkus.http.port=...:


java -Dquarkus.http.port=18080 -jar optaweb-employee-rostering-standalone/target/quarkus-app/quarkus-run.jar

== Benchmark Application

After building the project above, run the benchmark application with:


java -jar optaweb-employee-rostering-benchmark/target/quarkus-app/quarkus-run.jar

Note: make sure to run the project application and benchmark application on different ports if they are run simultaneously.

After benchmarking is complete, a benchmark report will be generated in the local/benchmarkReport directory. Open the index.html file in your browser to view the benchmark results.

=== Configure the benchmarker

To configure the benchmarker, modify the employeeRosteringBenchmarkConfig.xml file found in the optaweb-employee-rostering-benchmark/src/main/resources directory. Make sure to rebuild the project after modifying the config file for the benchmarker changes to be applied.

Refer to the[OptaPlanner Docs] for more information on benchmark tweaking.

== Running on a local OpenShift cluster

Use[Red Hat CodeReady Containers] to easily set up a single-node OpenShift 4 cluster on your local computer.

.Prerequisites You have successfully built the project with Maven.


  1. To install CRC, follow the[Getting Started Guide].

  2. When the cluster has started,

a. add oc command-line interface to your $PATH: + [source,shell]

eval $(crc oc-env)

b. log in as "developer".

  1. Create a new project


oc new-project project_name

  1. Run the script:



=== Updating the deployed application with local changes

==== Backend

Change the source code and build the backend module with Maven. Then start OpenShift build:


cd optaweb-employee-rostering-backend oc start-build backend --from-dir=. --follow

==== Frontend

Change the source code and build the frontend module with npm. Then start OpenShift build:


cd optaweb-employee-rostering-frontend oc start-build frontend --from-dir=docker --follow

== Development

=== Code formatter

Both IntelliJ and Eclipse formatters are available here:

=== Backend

Configure your IDE to run the main class, which is in org.optaweb.employeerostering.OptaWebEmployeeRosteringApplication in optaweb-employee-rostering-backend repository.

=== Frontend

Run npm install and then npm start in the optaweb-employee-rostering-frontend directory.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (31,724
typescript (11,988
reactjs (1,129
openshift (104
scheduling (66