Skip to content

Commit 294c149

Browse files
committed
Add new images and icons; improve UI component documentation; settings dialog; new UI design; new service support; themes
1 parent 0bb0b8d commit 294c149

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2100
-905
lines changed

README.md

Lines changed: 195 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,236 @@
1-
# HarmoBot Build Instructions
1+
# Harmobot
22

3-
This is a quick how-to for building the HarmoBot project using PyInstaller.
3+
Harmobot is a desktop GUI application designed for generating optimal work schedules based on participants’ availability. Built using Python and the OR-Tools CP-SAT solver, Harmobot offers an intuitive interface and a robust scheduling algorithm that adapts to real-world constraints.
44

5-
## Requirements
5+
---
66

7-
Install dependencies:
7+
## Overview
88

9-
```bash
10-
pip install -r requirements.txt
11-
```
9+
Harmobot leverages the services provided by **Schej** and **Cabbagemeet** to retrieve participant availability data. The application builds upon their open-source infrastructure to deliver a powerful scheduling solution.
10+
11+
Gathering people's availability is simple - choosing a single meeting time that suits everyone is straightforward. However, planning a detailed schedule for a group based on individual time availability can be challenging. The scheduling algorithm, when processing extensive input data (e.g., numerous days and a large number of participants with diverse availabilities), requires significant computational power. Without resource and time limits, finding the optimal solution can be very time-consuming. This challenge was the primary motivation for implementing Harmobot as a desktop application, ensuring heavy computations run locally. While a future web version is not ruled out, the current design maximizes performance for complex scheduling scenarios.
12+
13+
Harmobot is distributed as a standalone desktop application and can be built into an executable using PyInstaller.
14+
15+
<img src="images/initial_dialog.png" width="700">
16+
17+
---
18+
19+
## Key Features
20+
21+
- **Intelligent Scheduling:**
22+
Utilizes a cost-function based algorithm to assign shifts optimally, taking into account minimum and maximum availability, continuity rewards, gap penalties, and daily coverage bonuses.
23+
24+
- **Dual Integration Support:**
25+
Seamlessly works with the open-source infrastructures provided by Schej and Cabbagemeet. Users can run their own servers with these projects to legally harness full API functionality for collecting availability data.
26+
27+
- **User-Friendly GUI with Drag and Drop:**
28+
Enjoy an interactive interface that supports drag-and-drop editing. You can double-click any cell to edit occupant names or move “chips” (participants) from one cell to another simply by dragging them. Adjust the generated schedule easily in case of any errors or discrepancies.
29+
30+
- **Real-Time Availability Preview:**
31+
Click on a participant's name in the summary panel to highlight that participant’s availability across the schedule. This makes it simple to see who is available in each time slot.
32+
33+
- **Manual Editing and Error Correction:**
34+
The schedule highlights cells where designated working hours are exceeded and allows you to manually add participants - even those not originally in the list - to any cell.
35+
36+
- **Color-Coded Participant Chips:**
37+
Quickly identify participants with a consistent chip color assigned to each person. This feature is especially useful for rapid recognition and tracking across the schedule.
38+
39+
- **Data Export Options:**
40+
Export schedules in multiple formats including CSV, HTML, and PNG for ease of sharing and record keeping.
1241

13-
## Windows
42+
- **Parameters:**
43+
A parameter panel lets you configure the desired and minimum number of participants per slot, as well as maximum hours per person or per day.
1444

15-
First build (no .spec):
45+
- **Customizable Settings:**
46+
A dedicated Settings dialog allows you to pick from multiple UI themes (Light, Dark, Dracula, High Contrast, Firemode, etc.), adjust solver time limits, specify the number of CPU threads to use, and set time-zone offsets for events.
47+
48+
- **Version Check:**
49+
On startup, Harmobot automatically checks whether the local version is up-to-date with the latest release (via Cloudflare Workers), ensuring you are always running the most current version.
50+
51+
<br>
52+
<img src="images/main_window.png" width="900">
53+
54+
---
55+
56+
## System Requirements
57+
58+
- **Python:** Version 3.9 or higher
59+
- **Dependencies:**
60+
• PyQt6
61+
• OR-Tools
62+
• Requests
63+
• python-dateutil
64+
• (Additional dependencies as listed in the requirements file)
65+
66+
---
67+
68+
## Installation
69+
70+
1. **Clone the Repository:**
1671

1772
```bash
18-
pyinstaller --name HarmoBot --onefile --windowed --icon=assets\harmobot_logo.ico --add-data "assets;assets" main.py
73+
git clone https://github.com/m-walas/Harmobot.git
74+
cd harmobot
1975
```
2076

21-
Subsequent builds (when .spec is unchanged):
77+
2. **Install Dependencies:**
2278

2379
```bash
24-
pyinstaller HarmoBot.spec
80+
pip install -r requirements.txt
2581
```
2682

27-
## Linux
28-
29-
First build (no .spec):
83+
3. **Run the Application:**
3084

3185
```bash
32-
pyinstaller --name HarmoBot --onefile --windowed --icon=assets/harmobot_logo.ico --add-data "assets:assets" main.py
86+
python main.py
3387
```
3488

35-
Subsequent builds (when .spec is unchanged):
89+
> [!NOTE]
90+
> For users preferring a standalone executable, Harmobot can be bundled into a binary using PyInstaller. Instructions are provided below.
91+
92+
---
93+
94+
## Usage
95+
96+
Upon launching Harmobot, you will be greeted with a user-friendly window where you can:
97+
98+
- **Import Data:**
99+
Input a Schej or Cabbagemeet URL to fetch participant availability.
100+
101+
- **Configure Scheduling Parameters:**
102+
Set the number of required participants, minimum requirements, and working hour limits.
103+
104+
- **Generate Schedules:**
105+
Run the scheduling algorithm to produce an optimal work schedule. A dedicated Settings dialog lets you tune the solver’s time limit or CPU thread usage.
106+
107+
- **Adjust and Edit the Schedule:**
108+
Utilize drag and drop functionality to manually adjust assignments in case of any errors. The application also provides a real-time availability preview - click on a participant's name to view when they are available - and highlights cells that exceed set working hour limits. You can even add participants manually to any cell by double-clicking if necessary.
109+
110+
- **Export Results:**
111+
Save the generated schedule as CSV, HTML, or PNG.
112+
113+
---
114+
115+
## Backend & Algorithm Details
116+
117+
Harmobot’s scheduling engine is powered by a constraint programming model using OR-Tools. Key components include:
118+
119+
1. **Decision Variables:**
120+
Binary variables represent whether a participant is assigned to a specific time slot.
121+
122+
2. **Constraints:**
123+
- **Shift Coverage:** Ensures that each slot is staffed by at least a minimum and at most a maximum number of participants.
124+
- **Availability Matching:** Considers both standard availability and "ifNeeded" slots for each participant.
125+
- **Time Limits:** Enforces daily and overall working-hour restrictions specified via the parameter panel.
126+
127+
3. **Objective Function:**
128+
The algorithm maximizes overall scheduling efficiency by:
129+
- Rewarding continuous shift assignments.
130+
- Penalizing unnecessary gaps between shifts.
131+
- Awarding bonus points for full-day coverage.
132+
- Deducting points for assignments made on an “ifNeeded” basis.
133+
134+
While the algorithm strives to produce an optimal schedule based on the provided constraints, it may not always assign shifts perfectly. That is why Harmobot includes features such as drag and drop editing, real-time availability preview, and manual adjustment options - empowering you to fine-tune the schedule as needed.
135+
136+
---
137+
138+
## Integration
139+
140+
Harmobot is designed to work seamlessly with the open-source infrastructures provided by **Schej** and **Cabbagemeet**. Both projects are available on GitHub:
141+
142+
- [Schej](https://github.com/schej-it/schej.it)
143+
- [Cabbagemeet](https://github.com/maxerenberg/cabbagemeet)
144+
145+
These services allow you to set up your own server with the full functionality of collecting and processing availability data. Harmobot integrates with this architecture, offering an enhanced, local scheduling tool without requiring reliance on external APIs.
146+
147+
> [!CAUTION]
148+
> We do not support or assume responsibility for the use of Schej or Cabbagemeet infrastructures. Harmobot is built on top of these open-source solutions solely as an additional tool to facilitate manual scheduling. Users are encouraged to deploy their own servers if they wish to leverage the full capabilities of these services.
149+
150+
---
151+
152+
## License
153+
154+
Harmobot is released under the **AGPL-3.0** license. See the LICENSE file for more details.
155+
156+
## Disclaimer 🚩
157+
158+
> [!CAUTION]
159+
> This program should only be used on environments that you own or have explicit permission to do so. Neither the author, nor other parties involved in the project, will be held liable for any illegal use of this program.
160+
161+
---
162+
163+
## Contribute
164+
165+
Did you enjoy the project? Feel free to give it a star on GitHub ⭐. Got an interesting idea for further development? Don't hesitate to reach out and share your thoughts!
166+
167+
<details>
168+
<summary><strong>How to Build</strong></summary>
169+
170+
### Windows
171+
172+
- **First Build (No .spec):**
36173

37174
```bash
38-
pyinstaller HarmoBot.spec
175+
pyinstaller --name Harmobot --onefile --windowed --icon=assets\harmobot_logo.ico --add-data "assets;assets" main.py
39176
```
40177

41-
## macOS
178+
### Linux
42179

43-
First build (no .spec):
180+
- **First Build (No .spec):**
44181

45182
```bash
46-
pyinstaller --name HarmoBot --onefile --windowed --icon=assets/icon.icns --add-data "assets:assets" main.py
183+
pyinstaller --name Harmobot --onefile --windowed --icon=assets/harmobot_logo.ico --add-data "assets:assets" main.py
47184
```
48185

49-
Subsequent builds (when .spec is unchanged):
186+
### macOS
187+
188+
- **First Build (No .spec):**
50189

51190
```bash
52-
pyinstaller HarmoBot.spec
191+
pyinstaller --name Harmobot --onefile --windowed --icon=assets/icon.icns --add-data "assets:assets" main.py
53192
```
54193

55-
---
194+
**Additional Info:**
56195

57-
<details>
58-
<summary>Additional Info</summary>
59-
If you haven't modified files that affect the GUI (such as icons, images, or other assets), you can simply rebuild using the existing spec file with:
196+
Ensure that your assets folder is structured as follows to guarantee proper display of all images, icons, and other resources:
60197

61198
```bash
62-
pyinstaller HarmoBot.spec
199+
assets/
200+
├── icons/
201+
│ ├── dark/
202+
│ │ └── *.png
203+
│ ├── light/
204+
│ │ └── *.png
205+
│ └── *.png
206+
├── *.png
207+
├── *.gif
208+
├── harmobot_logo.ico (for Windows/Linux)
209+
└── harmobot_logo.icns (for macOS)
63210
```
64211

65-
Ensure that your assets folder is structured as follows:
212+
> [!TIP]
213+
> When building with PyInstaller, including the entire `assets` folder in the .spec file is crucial for proper loading of all icons and images. For example, your .spec file should include a datas section similar to the following:
214+
>
215+
>```python
216+
> import os
217+
>
218+
> datas = [
219+
> (os.path.join("assets", "icons", "dark"), os.path.join("assets", "icons", "dark")),
220+
> (os.path.join("assets", "icons", "light"), os.path.join("assets", "icons", "light")),
221+
> (os.path.join("styles"), os.path.join("styles")),
222+
> ("assets/icons/update.png", "assets/icons"),
223+
> ("assets/harmobot_logo_dark.png", "assets"),
224+
> ("assets/harmobot_logo_light.png", "assets"),
225+
> ("assets/harmobot_fire.gif", "assets"),
226+
> ("assets/harmobot_logo.ico", "assets"),
227+
> ]
228+
>```
229+
230+
If you haven't modified files that affect the GUI (such as icons, images, or other assets), you can simply rebuild using the existing spec file:
66231
67232
```bash
68-
assets/
69-
*.png
70-
*.gif
71-
harmobot_logo.ico (for Windows/Linux)
72-
harmobot_logo.icns (for macOS)
233+
pyinstaller Harmobot.spec
73234
```
74235
75236
</details>

0 commit comments

Comments
 (0)