How rusgoldberg/githubworker works
Project type and purpose
• This is a cross-platform desktop application written in Java with JavaFX.
• Its goal is to automate and schedule GitHub user actions (e.g., spreading commits over time).
• It follows an MVC-style pattern: FXML-based views, controllers, a service layer to call GitHub, and model objects.
File structure
• Top-level build files: build.gradle, settings.gradle → Gradle Java project.
• src/main/java/com/githubclient:
• controllers/…Controller.java → JavaFX controllers (UI logic).
• model/*.java → domain entities: User, Repository, Issue.
• services/GitHubService.java, HttpClient.java → business & HTTP-client layers.
• utils/Config.java → configuration loader (e.g., API tokens, endpoints).
• MainApp.java → JavaFX application entry point.
• src/main/resources/com/githubclient/views → FXML files for login, repo_list, issue_list.
• src/main/resources/.../styles.css → UI styling.
• log4j2.xml → logging configuration.
• test/java mirrors main packages for unit tests.
README
• Confirms automation of GitHub actions.
• Technology stack: Java, JavaFX, HTTP calls to GitHub API.
Components
a. Frontend (JavaFX UI)
• MainApp (JavaFX Application)
• FXML Views (login.fxml, repo_list.fxml, issue_list.fxml)
• Controllers (LoginController, RepoController, IssueController)
• CSS styling
b. Service Layer
• GitHubService: business logic, schedules actions, maps domain objects.
• HttpClient: sends HTTP requests to GitHub.
c. Model Layer
• Domain entities: User, Repository, Issue.
d. Utility/Configuration
• Config: loads API keys, user preferences.
e. External
• GitHub REST API (external service)
• Local file system (optional for persisting settings or logs)
• Logging subsystem (Log4j2)
Relationships and interactions
• User interacts with JavaFX UI.
• Controllers capture user events (e.g., login, fetch repos, schedule actions).
• Controllers call GitHubService APIs.
• GitHubService uses Config to read settings, then invokes HttpClient.
• HttpClient constructs and sends HTTP requests to GitHub API, receives JSON.
• GitHubService transforms HTTP responses into Model objects.
• Controllers update the view with model data.
• Log4j2 captures logs at each layer.
• Tests exercise Controllers, Services, HttpClient, Models.
Architectural patterns and design principles
• MVC (Model-View-Controller) for UI separation.
• Service layer abstracts remote API calls.
• Single responsibility: each package handles one concern.
• Dependency injection (manually wiring components in MainApp).
• Configuration externalized (Config class + log4j2.xml).