-
Notifications
You must be signed in to change notification settings - Fork 13
Distribution and Packaging
AutoApply is distributed as a desktop application using electron-builder. The build system produces native installers for all three major platforms:
| Platform | Format | File |
|---|---|---|
| Windows | NSIS installer | AutoApply-Setup-x.y.z.exe |
| macOS | DMG disk image | AutoApply-x.y.z.dmg |
| Linux | AppImage | AutoApply-x.y.z.AppImage |
Each installer bundles:
- The Electron shell
- The complete Python backend (embedded Python + all dependencies)
- Playwright Chromium browser
- All static assets, templates, and locale files
The build pipeline uses three custom Node.js scripts in the electron/ directory:
Generates application icons programmatically from a 1024x1024 PNG source:
cd electron
npm run icons:generateInput: Programmatic 1024x1024 PNG (no external image file needed). Output:
-
build/icon.ico-- Windows (multi-resolution ICO) -
build/icon.icns-- macOS (Apple ICNS bundle) -
build/icon.png-- Linux (1024x1024 PNG)
Synchronizes the version number from pyproject.toml to electron/package.json:
cd electron
npm run sync-versionThis ensures the Python backend and Electron frontend always report the same version. The script:
- Reads the
versionfield frompyproject.toml. - Updates the
versionfield inelectron/package.json. - Writes the file (no commit).
Bundles a standalone Python environment with all dependencies:
cd electron
npm run bundle-pythonThis script handles platform-specific Python bundling:
| Platform | Python Distribution | Method |
|---|---|---|
| Windows | Python embeddable package | Downloads official Windows embeddable zip from python.org |
| macOS | python-build-standalone | Downloads prebuilt standalone Python from indygreg/python-build-standalone |
| Linux | python-build-standalone | Downloads prebuilt standalone Python from indygreg/python-build-standalone |
The bundling process:
- Downloads the appropriate Python distribution for the target platform.
- Extracts to
electron/python-dist/. - Installs all Python dependencies from
pyproject.tomlinto the bundled environment. - Installs Playwright and downloads Chromium into the bundle.
- Verifies the installation by running a test import.
The icon is generated programmatically (no external design tool needed):
cd electron
npm run icons:generateThe script creates a modern, clean application icon with:
- "AA" monogram text
- Gradient background
- Rounded corners
- Multiple resolutions for each platform
Generated files are placed in electron/build/ and referenced by electron-builder configuration.
The authoritative version lives in pyproject.toml:
[project]
name = "autoapply"
version = "1.9.0"Before building, sync to Electron:
cd electron
npm run sync-versionThis updates electron/package.json:
{
"name": "autoapply",
"version": "1.9.0"
}The health endpoint (GET /api/health) reads the version from the Python package metadata, and the Electron About dialog reads it from package.json. Both must agree.
On Windows, the build uses Python's official embeddable package:
- Downloads
python-3.11.x-embed-amd64.zipfrom python.org. - Extracts to
electron/python-dist/. - Enables
pipby uncommenting theimport siteline inpython311._pth. - Installs
pipviaget-pip.py. - Installs project dependencies:
python-dist/python.exe -m pip install -r requirements.txt. - Installs Playwright Chromium:
python-dist/python.exe -m playwright install chromium.
On macOS and Linux, the build uses python-build-standalone:
- Downloads the appropriate build for the architecture (x86_64 or arm64).
- Extracts to
electron/python-dist/. - Installs dependencies using the bundled pip.
- Installs Playwright Chromium.
At runtime, electron/python-backend.js locates Python in this order:
-
Bundled Python:
<app-resources>/python-dist/python.exe(Windows) orpython-dist/bin/python3(macOS/Linux). -
Local venv:
venv/Scripts/python.exe(Windows) orvenv/bin/python3(for development). -
System Python: Falls back to
python3on PATH (unlikely to have correct dependencies).
- Node.js 18+
- npm 9+
- Python 3.11+ (for the bundle script)
- Platform-specific build tools:
- Windows: Visual Studio Build Tools (for native modules)
- macOS: Xcode Command Line Tools
-
Linux:
dpkg-dev,fakeroot
cd electron
# Generate icons
npm run icons:generate
# Sync version from pyproject.toml
npm run sync-version
# Bundle Python environment
npm run bundle-python
# Build installer for current platform
npm run dist:win # Windows .exe
npm run dist:mac # macOS .dmg
npm run dist:linux # Linux .AppImageOutput is placed in electron/dist/.
The electron-builder configuration in electron/package.json:
{
"build": {
"appId": "com.autoapply.app",
"productName": "AutoApply",
"directories": {
"output": "dist"
},
"extraResources": [
"../bot/**/*",
"../config/**/*",
"../core/**/*",
"../db/**/*",
"../routes/**/*",
"../static/**/*",
"../templates/**/*",
"../app.py",
"../app_state.py",
"../run.py",
"../pyproject.toml"
],
"win": {
"target": "nsis",
"icon": "build/icon.ico"
},
"mac": {
"target": "dmg",
"icon": "build/icon.icns"
},
"linux": {
"target": "AppImage",
"icon": "build/icon.png"
}
}
}Automated releases are triggered by pushing a version tag:
git tag v1.9.0
git push origin v1.9.0The GitHub Actions workflow (.github/workflows/release.yml):
-
Trigger:
pushon tags matchingv*. -
Matrix build: Runs on
ubuntu-latest,macos-latest, andwindows-latest. -
Steps per platform:
- Checkout code.
- Set up Node.js 18 and Python 3.11.
- Install dependencies (
npm install,pip install -e ".[dev]"). - Generate icons (
npm run icons:generate). - Sync version (
npm run sync-version). - Bundle Python (
npm run bundle-python). - Build installer (
npm run dist:win/dist:mac/dist:linux). - Upload artifacts.
-
Create GitHub Release: Collects all platform artifacts and creates a release with:
- Release notes (from CHANGELOG.md).
- Windows
.exeinstaller. - macOS
.dmgdisk image. - Linux
.AppImage.
The extraResources configuration specifies which Python source files and assets are included in the packaged application:
| Resource | Purpose |
|---|---|
bot/**/* |
Bot core, search engines, appliers |
config/**/* |
Settings models |
core/**/* |
AI engine, filter, scheduler, renderer, i18n |
db/**/* |
Database operations |
routes/**/* |
Flask blueprints |
static/**/* |
CSS, JavaScript modules, locale files |
templates/**/* |
Jinja2 HTML template |
app.py |
Flask app factory |
app_state.py |
Shared state singleton |
run.py |
Server entry point |
pyproject.toml |
Package metadata (version, dependencies) |
Files not bundled:
-
tests/-- Not needed at runtime. -
electron/-- Electron files are bundled by electron-builder itself. -
.claude/,.github/-- Development/CI only. -
venv/-- Replaced by bundled Python inpython-dist/.
The installers are currently unsigned, which triggers platform security warnings:
| Platform | Warning | Workaround |
|---|---|---|
| Windows | SmartScreen "unrecognized app" dialog | Click "More info" > "Run anyway" |
| macOS | Gatekeeper "cannot be opened" dialog | Right-click > "Open", or: xattr -cr /Applications/AutoApply.app
|
| Linux | No warning | AppImage is executable by default |
Code signing and notarization are tracked in the Roadmap as a future enhancement.
electron-builder does not reliably support cross-compilation for all platforms. Each platform's installer should be built on that platform (or via CI with the appropriate runner). The CI matrix build handles this automatically.
The complete installer is approximately:
- Windows: ~250 MB (includes Python + Chromium)
- macOS: ~280 MB
- Linux: ~260 MB
Most of the size comes from the bundled Chromium browser (~150 MB) and the Python environment (~60 MB).
AutoApply Wiki
User Guide
Technical
Build & Deploy
Project