Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Web application for solving Employee Rostering using OptaPlanner

Notifications You must be signed in to change notification settings

opengovsg/ctrl-shift

 
 

Repository files navigation

Employee Rostering Optimization as a Service

Build Status Ask question on Stack Overflow Join Zulip Chat

Quality Gate Status Reliability Rating Security Rating Maintainability Rating Lines of Code Coverage

ctrl-shift

An automated rostering service powered by OptaPlanner

Quick Start

Install Docker and run the following on the command line:

docker build -t ctrl-shift-standalone .
docker run -p 8080:8080 --rm -it -e SPRING_PROFILES_ACTIVE=dev ctrl-shift-standalone

This takes a few minutes on the first time. The application will be automatically populated with test data.

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/optaweb-employee-rostering-standalone-*-exec.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 spring-boot:run in optaweb-employee-rostering-backend to start the backend in another terminal.

Use a different port

To run on an another port use --server.port=…​:

java -jar optaweb-employee-rostering-standalone/target/optaweb-employee-rostering-standalone-*-exec.jar --server.port=18080

Benchmark Application

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

java -jar optaweb-employee-rostering-benchmark/target/optaweb-employee-rostering-benchmark-*.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.

Development

Set up OpenJDK Java 8

$ brew tap AdoptOpenJDK/openjdk
$ brew cask install adoptopenjdk8
$ java -version
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.232-b09, mixed mode)
$ which java
/usr/bin/java

Add the following line to ~/.bash_profile

export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home"

Code formatter

Both IntelliJ and Eclipse formatters are available here: https://github.com/kiegroup/droolsjbpm-build-bootstrap/tree/master/ide-configuration

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.

Email server

You will need a local SMTP server to receive emails containing the one-time password.

# Start
$ sudo postfix start

# Stop
$ sudo postfix stop

# Status
$ sudo postfix status

Inserting an Agency

Run the following SQL statement to insert a new agency for logging in.

insert into agency ( email_domain , name ) values ('open.gov.sg', 'Open Government Products');

About

Web application for solving Employee Rostering using OptaPlanner

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 54.0%
  • Java 44.6%
  • CSS 0.6%
  • JavaScript 0.5%
  • Dockerfile 0.2%
  • HTML 0.1%