This document provides a technical overview of the Git Automation Dashboard application, including its architecture, build process, and development guidelines.
- Framework: Electron (for creating the cross-platform desktop application).
- UI Library: React.js with TypeScript.
- Styling: Tailwind CSS (via a CDN for simplicity in this version).
- Bundler: esbuild (for fast and efficient bundling of main, renderer, and preload scripts).
- Packager: electron-builder (for creating distributable installers and packages).
- Libraries:
jszipfor handling settings import/export.
The application is split into three main processes, which is standard for Electron apps:
The application uses a custom frameless window to achieve a modern, VSCode-like appearance.
electron/main.ts: Configures theBrowserWindowwithframe: falseandtitleBarStyle: 'hidden'to remove the default OS window chrome. It also contains IPC handlers (window-minimize,window-maximize,window-close) to provide functionality for the custom controls.components/Header.tsx: This component serves as the application's Title Bar. It displays the app title, renders the primary dashboard actions, and provides a draggable region (-webkit-app-region: drag).components/titlebar/WindowControls.tsx: A dedicated component that renders the custom minimize, maximize/restore, and close buttons. It communicates with the main process via IPC to execute window actions.components/CommandPalette.tsx: This component is a modal dialog that is opened via a keyboard shortcut (Ctrl/Cmd+K). It provides a search-driven interface for users to quickly find and execute commands, such as running tasks or navigating to different views.
- Entry Point:
electron/main.ts - Responsibilities:
- Manages the application lifecycle (
appevents). - Creates and manages
BrowserWindowinstances (the application's windows). - Logging: The main process contains a structured
mainLoggerthat replaces allconsolecalls. This logger sends messages to the renderer process for display in the debug UI and also writes directly to the debug log file (git-automation-dashboard-log-[...].log) if file logging is enabled by the user. - Reads user settings on startup to configure features like the auto-updater's pre-release channel.
- Handles native OS interactions (dialogs, file system access).
- Listens for and responds to IPC (Inter-Process Communication) events. This includes:
- Project Intelligence: Handles
get-project-infoandget-project-suggestionsby analyzing the file system of a repository to detect technologies like Node.js, Python, Go, Rust, Java/Maven, .NET, Delphi, and Lazarus. - Task Execution: Executes shell commands for task steps. The
run-task-stephandler now contains logic to interpret and execute the new, ecosystem-specific step types (e.g.,PYTHON_INSTALL_DEPS). It also handles setting environment variables for tasks and tracks each spawned child process in therunningProcessesmap so thecancel-taskIPC requests from the renderer can terminate long-running work safely. - Task Log Archiving: Upon starting a task, it creates a timestamped log file in the user-configured directory. It then streams all
stdoutandstderrfrom the task's execution to this file, in addition to the live view in the UI. - VCS Commands: Executes real Git/SVN commands for advanced features like checking status, fetching commit history (now for SVN as well), and managing branches.
- Workflow Template Explorer: Powers the CI tab by exposing IPC handlers such as
get-workflow-templates,list-workflow-files,read-workflow-file,write-workflow-file,create-workflow-from-template, andcommit-workflow-files, plus an event-drivenvalidate-workflowrunner that shells out toyamllint(oract) while streaming structured log output back to the renderer. - Executable Path Management: Handles IPC calls for file pickers, auto-detection, and testing of user-configured executable paths.
- External Links: Handles requests from the renderer to open web links in the user-specified browser.
- Project Intelligence: Handles
- GitHub API: Fetches release information for a repository using a user-provided Personal Access Token.
- Auto-Update Fallbacks: Installs a GitHub provider patch that retries via the REST API with authenticated headers when the legacy HTML endpoint returns HTTP 406 responses, and emits structured diagnostics for release engineering.
- Settings I/O: Manages the import and export of settings files using the
jsziplibrary.
- Manages the application lifecycle (
- Entry Point:
index.tsx->App.tsx - Responsibilities:
- Renders the entire user interface using React.
- Holds the majority of the application's client-side business logic.
- Security: The renderer cannot directly access Node.js APIs. All such operations must be requested from the Main process via the Preload script.
- Entry Point:
electron/preload.ts - Responsibilities:
- Acts as a secure bridge between the Renderer and Main processes.
- Uses
contextBridgeto expose a safe, limited API (window.electronAPI) to the renderer. This includes functions likegetProjectInfo,getCommitHistory,getDelphiVersions, etc.
- Primary State: The root
App.tsxcomponent manages the entire application state, including the list of repositories, global settings, dashboard categories, the active view, and the state of modals and panels. - VCS State:
App.tsxalso holds state fordetailedStatusesandbranchListswhich are fetched periodically and after tasks complete to keep the UI in sync with the file system. - Parallel Task Execution: To support running multiple tasks concurrently, a unique
executionIdis generated for each task run. This ID is passed between the renderer and main processes, allowing log output (task-log) and completion events (task-step-end) to be correctly routed to the appropriate repository and UI components without conflict. - Component Architecture: The
RepoFormModalcomponent has been significantly enhanced with the Project Intelligence UI, which conditionally renders task-generation buttons based on data fetched from theget-project-infoIPC handler. The task editor now renders different configuration options based on theTaskStepTypeenum.
All application data, including repositories, categories, and global settings, is persisted to a single settings.json file.
- Location: The file is stored in the standard application user data directory for your operating system (e.g.,
%APPDATA%on Windows,~/Library/Application Supporton macOS). This ensures that user settings are preserved across application updates. - Management: A
SettingsProvidercontext handles loading this data on startup and saving it whenever it changes. - Migration: A one-time migration process runs on startup to move
settings.jsonfor users updating from versions prior to0.2.2, where the file was incorrectly stored next to the application executable.
- Installation: Run
npm installto install all dependencies. - Run in Dev Mode:
npm start- This command uses
concurrentlyto runesbuildin watch mode and launch the Electron app.
- This command uses
- Command:
npm run pack - Process:
- The script first runs
npm run build, which bundles and minifies all source code into thedist/directory. electron-builderthen packages the application based on the configuration inpackage.json.- The final output is placed in the
release/directory.
- The script first runs
Use this process when shipping a new minor update or bugfix:
- Increment the Version: Update the
versioninpackage.jsonand verify the README, manuals, and any in-app references reflect the new number where applicable. - Refresh Documentation: Re-read
README.md,FUNCTIONAL_MANUAL.md,TECHNICAL_MANUAL.md, andCHANGELOG.mdto ensure screenshots, feature descriptions, and workflows match the current UI. Note any documentation-only edits in the changelog, and if no changes are required, explicitly record that the review confirmed the docs remain accurate so the audit trail is preserved. - Update Release Notes: Add a new entry to
CHANGELOG.mdsummarizing the changes, calling out documentation adjustments alongside any fixes or features. Plan to reuse this text verbatim in the GitHub release body. - Run Automated Checks: Execute
npm test(or the broader QA suite defined for the project) and confirm a passing result before packaging binaries. - Build Installers: Run
npm run pack. The command produces platform installers in therelease/directory. Perform a quick smoke test of the generated artifacts before distribution. - Validate Update Metadata: From the project root, execute
node electron/scripts/normalize-win32-artifacts.mjsand confirm therelease/directory containslatest.yml(x64),latest-win32.yml(ia32), and matching installer names. This verification prevents shipping a release without the updater manifests that GitHub users rely on. - Publish on GitHub: Draft a new release on GitHub, attach the installers from the
release/folder, verify the tag/version details, and explicitly set the Release Type selector to match your intent (Full Release for GA builds or Draft/Pre-release when staging). Paste the current changelog entry into the notes so the GitHub release matches the repository history, then publish.
- Documented the workflow template explorer IPC surface, renderer tooling, and CI validation path introduced in version
0.27.0.
The application is configured to automatically check for updates on startup using the electron-updater library.
- Update Source: It checks for new releases published on the project's GitHub Releases page. The behavior is controlled by the "Check for Pre-Releases" setting.
- Process:
- On startup, the Main Process (
electron/main.ts) reads the user's settings to determine whether to allow pre-releases and prepares authenticated GitHub API headers when a PAT is available. - The application now patches
electron-updater's GitHub provider so the initial lookup runs against the REST API. If that request fails to return a tag, the legacy HTML scraping path is attempted, and any 406 responses automatically trigger a REST retry with structured telemetry. - The
autoUpdateris configured accordingly and checks for updates while also caching the list of assets published for each version. - As downloads complete, the main process validates the installer filename against the GitHub release assets (including platform-specific suffixes like
ia32vs.x64). Failed validations are logged with structured context and prevent installation. - Throughout the lifecycle it emits
update-status-changeIPC messages so the renderer can surface toast notifications and the condensed update icon in the header. Error toasts now summarize long GitHub responses and nudge engineers toward the debug log for full context. - When the
update-downloadedevent is received, the Renderer Process (App.tsx) sets a state variable to display theUpdateBannercomponent. - When the user clicks the "Restart & Install" button on the banner, the Renderer calls
window.electronAPI.restartAndInstallUpdate(). - This triggers an IPC event (
restart-and-install-update) which causes the Main Process to callautoUpdater.quitAndInstall(), which handles the update process reliably.
- On startup, the Main Process (
- Publishing a New Version: To publish a new release, a developer with repository access must:
- Ensure the
versioninpackage.jsonis incremented. - Create a
GH_TOKEN(GitHub Personal Access Token) withreposcopes and make it available as an environment variable. - Run the command
npm run publish. This will build the application, create installers (limited to theia32andx64Windows.exefiles, plus the existing macOS/Linux targets), and upload them to a new draft release on GitHub alongside the bundled documentation directory expected by the auto-updater. - Navigate to the GitHub release, add release notes, confirm the asset list matches the validated filenames, and publish it.
- Ensure the