Skip to content

Latest commit

 

History

History
132 lines (102 loc) · 2.78 KB

File metadata and controls

132 lines (102 loc) · 2.78 KB

School Timetabling (Kotlin, Quarkus, Maven)

Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.

quarkus school timetabling screenshot legacy

Run the application

  1. Git clone the timefold-quickstarts repo and navigate to this directory:

    $ git clone https://github.com/TimefoldAI/timefold-quickstarts.git
    ...
    $ cd timefold-quickstarts/technology/kotlin-quarkus
  2. Start the application with Maven:

    $ mvn quarkus:dev
  3. Visit http://localhost:8080 in your browser.

  4. Click on the Solve button.

Then try live coding:

  1. Make some changes in the source code.

  2. Refresh your browser (F5).

Notice that those changes are immediately in effect.

Run the packaged application

When you’re done iterating in quarkus:dev mode, package the application to run as a conventional jar file.

  1. Compile it with Maven:

    $ mvn package
  2. Run it:

    $ java -jar ./target/quarkus-app/quarkus-run.jar
    Note

    Even though it’s written in Kotlin, it can run with the java command.

    Note

    To run it on port 8081 instead, add -Dquarkus.http.port=8081.

  3. Visit http://localhost:8080 in your browser.

  4. Click on the Solve button.

Run the application in a container

  1. Build a container image:

    $ mvn package -Dcontainer

    The container image name

  2. Run a container:

    $ docker run -p 8080:8080 timefold-solver-kotlin-quarkus-school-timetabling-quickstart:1.0-SNAPSHOT

Run it native

To increase startup performance for serverless deployments, build the application as a native executable:

  1. Install GraalVM and gu install the native-image tool

  2. Compile it natively. This takes a few minutes:

    $ mvn package -Dnative -DskipTests
  3. Run a database. By default, application.properties is configured for H2:

    1. Download the H2 database (Platform-independent zip) and unzip it.

    2. Start the H2 server with the option -ifNotExists (not recommended in production):

      $ cd h2/bin
      $ java -cp h2*.jar org.h2.tools.Server -ifNotExists
  4. Run the native executable:

    $ ./target/*-runner
  5. Visit http://localhost:8080 in your browser.

  6. Click on the Solve button.

More information

Visit timefold.ai.