dabke
Scheduling library powered by constraint programming (CP-SAT). Define your team, shifts, coverage, and rules — dabke turns them into an optimized schedule.Why dabke?
Staff scheduling with constraint programming is dominated by Python (OR-Tools) and Java (Timefold). If you’re building in TypeScript, your options have been: call a Python service and figure out the model yourself, or write scheduling heuristics by hand. dabke gives you a TypeScript-native API for expressing scheduling problems declaratively — employees, shifts, coverage requirements, and rules — and compiles them into a CP-SAT model solved by OR-Tools. You describe what you need, not how to solve it.Key features
- Declarative rules — express constraints like “max 8 hours/day” or “11 hours rest between shifts” as config, not code
- Semantic time — define named periods (“lunch_rush”, “closing”) that vary by day of week
- Soft and hard constraints — some rules are mandatory, others are preferences the solver optimizes for
- Scoped rules — apply constraints globally, per person, per role, per skill, or during specific time periods
- Validation — detailed reporting on coverage gaps and rule violations before and after solving
How it works
- Define employees, shift patterns, coverage requirements, and rules
- Compile with
ModelBuilderinto a constraint model - Solve by sending the model to a CP-SAT solver service
- Parse the solver response into shift assignments