Township Scheduler – A Constraint-Based Scheduling Solver Visualized with Vaadin

Hi, Vaadin community! I’ve been following Vaadin since version 7, but I’ve never actually published or shared anything I’ve built. When I discovered the “I Build This” section, I was genuinely excited to finally share a project I’ve been working on for the past two years. I hope you’ll find it interesting — and I’d love to hear your feedback!

Short Description

A personal project inspired by the mobile game Township . Given a set of orders, it derives the full production dependency chain and uses Timefold to compute an optimal schedule — then renders the entire result as an interactive timeline in a Vaadin UI.

Why This Is Interesting (Vaadin Perspective)

This project is essentially a Vaadin-first application : the solver runs in the background, but everything the user sees and interacts with lives in Vaadin. Here’s what I got to explore:

Vaadin Feature How I Used It
Vaadin Signals Reactive UI state — solver progress, schedule updates, and UI reactivity without manual polling or push configuration boilerplate.
Custom Vaadin Components Built reusable components for the scheduling view, order management, and timeline breakdown.
Lit-based Web Components Created custom elements with Lit and integrated them into the Vaadin component tree.
vis-timeline integration Embedded the vis-timeline library to render a Gantt-chart-style view of the solved schedule (timeline → factory → task).
Vaadin + Spring Boot Standard Vaadin Platform setup with Spring Boot backend and H2 in-memory DB.

What the App Does

  1. Data ingestion – On first run, scrapes product/factory/BOM data from the public Township Fandom Wiki (or parses an offline .mhtml ), then stores it via JPA.
  2. Order management – Create, delete, and query orders (the input for scheduling).
  3. Scheduling – Run the Timefold solver to assign each production task a date/time slot and a factory, respecting hard and soft constraints.
  4. Visualization – Display the solved schedule as a timeline → factory → task breakdown, with a Gantt chart powered by vis-timeline .

Tech Stack

Spring Boot · Vaadin Platform · Timefold · H2 · Maven

Links

Screenshots



3 Likes