HearthNet / docs /guides /BUILD_GUIDE.md
GitHub Actions
fix: llm.chat IndexError (lazy Ollama warm + safe _resolve_backend fallback) + chat self-send returns direct
66a1a95
|
Raw
History Blame Contribute Delete
8.96 kB

A newer version of the Gradio SDK is available: 6.22.0

Upgrade

πŸ—οΈ HearthNet Multi-Platform Build Guide

Latest Update: June 11, 2026
Script: build/quickstart.py (Auto-builds EXE, AppImage, DMG, Docker)
Status: βœ… Production Ready


πŸ“‹ Quick Start

Build for Your Platform Only

python build/quickstart.py

Build Specific Target

# Windows EXE
python build/quickstart.py windows

# Linux AppImage
python build/quickstart.py linux

# macOS .app Bundle
python build/quickstart.py macos

# Docker Image
python build/quickstart.py docker

# All (for current platform + Docker)
python build/quickstart.py all

πŸ–₯️ Windows Build (EXE)

Output

dist/HearthNet.exe (~80 MB)

Requirements

  • Python 3.10+ (already installed)
  • PyInstaller (auto-installed by script)
  • 200 MB disk space

Build

python build/quickstart.py windows

Run Standalone EXE

cd dist
HearthNet.exe

Then open: http://localhost:7860


🐧 Linux Build (AppImage)

Output

dist/HearthNet-*-x86_64.AppImage (~120 MB)

Requirements

  • Python 3.10+
  • linuxdeploy tool
  • 300 MB disk space

Build

python build/quickstart.py linux

Run AppImage

./dist/HearthNet-*.AppImage

Then open: http://localhost:7860

Install to Applications Menu

chmod +x dist/HearthNet-*.AppImage
sudo cp dist/HearthNet-*.AppImage /opt/HearthNet
sudo ln -s /opt/HearthNet /usr/bin/hearthnet

🍎 macOS Build (.app Bundle)

Output

dist/HearthNet.app/ (app bundle)

Requirements

  • macOS 10.13+
  • Python 3.10+
  • PyInstaller (auto-installed by script)
  • 300 MB disk space

Build

python build/quickstart.py macos

Run App Bundle

# Method 1: Double-click from Finder
dist/HearthNet.app

# Method 2: Terminal
open -a dist/HearthNet.app

# Method 3: Launch directly
./dist/HearthNet.app/Contents/MacOS/HearthNet

Then open: http://localhost:7860

Install to Applications

cp -r dist/HearthNet.app /Applications/
open /Applications/HearthNet.app

🐳 Docker Build

Output

docker image: hearthnet:0.1.0 (also tagged as hearthnet:latest)

Requirements

  • Docker installed and running
  • 2 GB disk space

Build

python build/quickstart.py docker

Run Docker Image

docker run -p 7860:7860 hearthnet:latest

Then open: http://localhost:7860

Deploy to Server

# Push to Docker registry
docker tag hearthnet:0.1.0 your-registry/hearthnet:0.1.0
docker push your-registry/hearthnet:0.1.0

# Pull on server
docker pull your-registry/hearthnet:0.1.0
docker run -d -p 7860:7860 your-registry/hearthnet:0.1.0

πŸ“± Android PWA (Instant - Recommended!)

No Build Needed! πŸŽ‰

Fastest way to deploy to Android:

  1. On your computer:

    python app.py
    
  2. On Android device:

    • Open Chrome/Firefox
    • Go to http://YOUR_COMPUTER_IP:7860
    • Tap menu β†’ "Install app"
    • App appears on home screen!

Advantages:

  • ⚑ 5-minute setup
  • πŸ”„ Instant updates (no rebuild)
  • πŸ“¦ ~5 MB only
  • 🌐 Works offline (Service Worker caching)

πŸ“¦ Build Output Directory

After building, find artifacts in dist/:

dist/
β”œβ”€β”€ HearthNet.exe              # Windows executable
β”œβ”€β”€ HearthNet-*.AppImage       # Linux executable
β”œβ”€β”€ HearthNet.app/             # macOS bundle
└── build/                     # Temporary build files (safe to delete)

Clean Up Build Artifacts

rm -rf dist/build/            # Linux/macOS
rmdir /s dist\build           # Windows

πŸ”§ Advanced Build Options

Custom Python Path

/path/to/python3 build/quickstart.py windows

Verbose Build Output

python build/quickstart.py windows 2>&1 | less

Parallel Multi-Platform Build (macOS/Linux only)

# On macOS: build Docker + app simultaneously
python build/quickstart.py docker &
python build/quickstart.py macos

πŸ› Troubleshooting

Python Version Error

[ERR] Python 3.10+ required

Fix: Ensure Python 3.10 or newer is in PATH

python --version
which python3.10  # or python3.11, 3.12, 3.13

PyInstaller Not Found

[ERR] No module named 'PyInstaller'

Fix: Run installation step first

python -m pip install pyinstaller --upgrade

Docker Not Running

[SKIP] Docker not available

Fix: Start Docker daemon

# Windows: Start Docker Desktop
# Linux: sudo systemctl start docker
# macOS: open /Applications/Docker.app

Out of Disk Space

[ERR] No space left on device

Fix: Clean up and retry

python build/quickstart.py     # Will skip building automatically
du -sh dist/                   # Check size
rm -rf dist/build/             # Remove temp files

Module Import Errors (on first run)

ModuleNotFoundError: No module named 'fastapi'

Fix: Install main dependencies first

pip install -r requirements.txt

πŸ“Š Platform Comparison

Feature Windows EXE Linux AppImage macOS .app Docker PWA
Size ~80 MB ~120 MB ~200 MB 2 GB image ~5 MB
Setup Time 15 min 20 min 20 min 30 min 5 min ⭐
Installation Copy & run Make executable Drag to Applications docker run Click link
Offline Support Full Full Full Full Full (Service Worker)
Cross-Platform Windows only Linux only macOS only Any (Docker) Any (Browser)
Desktop Integration Native Native Native Container Web app
Automatic Updates ❌ ❌ ❌ ❌ (manual rebuild) βœ… (live updates)
Play Store Ready ❌ ❌ ❌ ❌ ❌ (needs signing)
Development βœ… Easy βœ… Easy βœ… Easy βœ… Easy βœ… Easy

πŸš€ Distribution Paths

Desktop Users (Recommended)

  1. Quick Demo: β†’ PWA (5 min)
  2. Native App: β†’ EXE / AppImage / .app (20 min build)
  3. Server Deployment: β†’ Docker (30 min first-time)

Mobile Users (Android)

  1. Quick Start: β†’ PWA (5 min, no build!)
  2. Offline App: β†’ Build APK in build/android/
  3. Play Store: β†’ Sign + upload (requires keystore)

Enterprise Deployment

  1. Self-Hosted: β†’ Docker compose or Kubernetes
  2. Cloud: β†’ Docker image to AWS/GCP/Azure
  3. CI/CD: β†’ GitHub Actions + automated builds

πŸ“ Build Script Internals

What build/quickstart.py Does

  1. Checks Environment

    • Verifies Python 3.10+
    • Detects OS type
    • Confirms HearthNet source present
  2. Installs Dependencies

    • PyInstaller (all platforms)
    • linuxdeploy (Linux only)
    • Platform-specific build tools
  3. Creates Package

    • Single executable (Windows: --onefile)
    • AppImage bundle (Linux: --onedir + linuxdeploy)
    • macOS app bundle (macOS: --onedir + code signing)
    • Docker image (all platforms)
  4. Bundles Assets

    • UI files (hearthnet/ui/)
    • Documentation (docs/)
    • Hidden imports for dependencies
  5. Reports Success

    • Lists output locations
    • Shows installation instructions
    • Provides next steps

πŸ” Code Signing (Optional)

Windows Code Signing

# Generate self-signed certificate (for testing)
# Production: Use Authenticode certificate from trusted CA

# Then rebuild with signing in PyInstaller

macOS Code Signing

# Automatically attempted during build
# Requires Apple Developer account for distribution

# Check signature
codesign -v dist/HearthNet.app

Linux AppImage Signing

# Sign with GPG
gpg --detach-sign dist/HearthNet-*.AppImage
gpg --verify dist/HearthNet-*.AppImage.sig

πŸ“š Related Documentation


🀝 Contributing

To improve the build system:

  1. Test locally on your platform
  2. Report issues with: python build/quickstart.py [target] 2>&1 | tee build.log
  3. Submit improvements to build scripts
  4. Document platform-specific issues

πŸ“ž Support

Build failed? Check:

  1. βœ… Python version: python --version
  2. βœ… Disk space: df -h (need 200+ MB)
  3. βœ… Dependencies: pip list | grep -i pyinstaller
  4. βœ… Logs: Output from script shows exact error

Have suggestions? Open an issue with:

  • Platform (Windows/Linux/macOS)
  • Python version
  • Error message
  • Output of: python build/quickstart.py [target] 2>&1

Status: βœ… All platforms supported
Last Tested: June 11, 2026
Maintainer: HearthNet Build System
License: Apache 2.0