Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3529562
Add build scripts for minimal Synapse CLI and interactive commands
BryanFauble Jul 31, 2025
2a79688
Build a simple GUI application and add to the build process to publis…
BryanFauble Aug 11, 2025
c1895e4
Fix package installation command in build scripts for consistency
BryanFauble Aug 11, 2025
24f45f7
Refactor build scripts to improve Windows compatibility and remove ex…
BryanFauble Aug 11, 2025
72b3f8e
Remove uv command from build scripts and clean up Windows installatio…
BryanFauble Aug 11, 2025
f4acc79
Refactor build scripts to streamline dependency installation and impr…
BryanFauble Aug 11, 2025
6a24763
Move build to top level
BryanFauble Aug 11, 2025
b4adef4
Set UV_SYSTEM_PYTHON environment variable for desktop client build
BryanFauble Aug 11, 2025
6518746
Remove UV_SYSTEM_PYTHON environment variable and enable environment a…
BryanFauble Aug 11, 2025
7abe4ce
Refactor Windows dependency uninstallation commands to remove redunda…
BryanFauble Aug 11, 2025
673305b
Splitting logic into a MVC
BryanFauble Aug 13, 2025
9bfa9d9
Detailed progress tracking
BryanFauble Aug 13, 2025
ade9d93
Test out bulk download/upload and icon branding
BryanFauble Aug 13, 2025
c598b48
Correction to logging and build processes
BryanFauble Aug 13, 2025
19f89e6
Run precommit
BryanFauble Aug 13, 2025
f22936d
Change ico to icns for apple
BryanFauble Aug 13, 2025
0e36433
Add missing tkinter imports for build process
BryanFauble Aug 13, 2025
22e4b08
Cleaning up and simplifying code
BryanFauble Aug 14, 2025
3f4e91f
Add user agent to Synapse client initialization
BryanFauble Aug 14, 2025
7defa0d
pre-commit
BryanFauble Aug 14, 2025
fd32666
Re-enable all testing suite
BryanFauble Aug 14, 2025
a8e2f7f
Refactor UI update calls to use a minimal delay for thread-safe opera…
BryanFauble Aug 15, 2025
d4232ac
Update UI update calls to use zero delay for improved responsiveness
BryanFauble Aug 15, 2025
04cfbe3
pre-commit
BryanFauble Aug 15, 2025
a6a9693
Migrate the UI and application to use ElectronJS
BryanFauble Aug 21, 2025
8e0faa4
pre-commit all files
BryanFauble Aug 21, 2025
2cfe72f
Update artifact upload paths for Electron builds to include all packa…
BryanFauble Aug 21, 2025
0230ee4
Enhance Electron compatibility by setting up environment variables an…
BryanFauble Aug 22, 2025
aae27b0
pre-commit
BryanFauble Aug 22, 2025
d723472
Refactor build scripts to remove suffix handling for backend executab…
BryanFauble Aug 22, 2025
ec85ba1
Remove previous TKInter GUI
BryanFauble Aug 22, 2025
dffef12
Remove unused favicon files and update installation instructions for …
BryanFauble Aug 22, 2025
292e605
Add utility modules for Synapse Desktop Client backend
BryanFauble Aug 22, 2025
d446e5a
run pre-commit
BryanFauble Aug 22, 2025
c3223a1
Potential fix for code scanning alert no. 26: Information exposure th…
BryanFauble Aug 22, 2025
e79d592
Remove debug logging for completion messages in WebSocket utilities
BryanFauble Aug 22, 2025
eb975f4
Update README with advanced development instructions and improve debu…
BryanFauble Aug 25, 2025
dccf763
Upsize icon and pre-commit
BryanFauble Aug 25, 2025
e8d6bdd
Refactor config and synapse services for improved type hinting and do…
BryanFauble Aug 26, 2025
9eee46a
pre-commit
BryanFauble Aug 26, 2025
f5ddfb7
Enhance security configurations in SynapseElectronApp with CORS and g…
BryanFauble Aug 26, 2025
f16c36a
Merge branch 'develop' into synpy-1636-move-to-electron
BryanFauble Aug 26, 2025
4410a14
Enhance build scripts for Synapse Desktop Client to support architect…
BryanFauble Aug 26, 2025
4235378
Revert "Enhance build scripts for Synapse Desktop Client to support a…
BryanFauble Aug 26, 2025
61d68d5
Refactor build configuration for Synapse Desktop Client to streamline…
BryanFauble Aug 26, 2025
696de4b
Refactor upload file handling to improve folder structure and enhance…
BryanFauble Aug 27, 2025
dca8111
re-enable github tests
BryanFauble Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 100 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ jobs:

runs-on: ubuntu-22.04

if: github.event_name == 'release'
if: github.event_name == 'release' && !startsWith(github.event.release.tag_name, 'synapsedesktopclient')

outputs:
sdist-package-name: ${{ steps.build-package.outputs.sdist-package-name }}
Expand Down Expand Up @@ -343,6 +343,105 @@ jobs:
# asset_content_type: application/zip


# build standalone desktop client artifacts for Windows and macOS on release
build-electron-desktop-clients:
needs: [test, pre-commit]
if: github.event_name == 'release' && startsWith(github.event.release.tag_name, 'synapsedesktopclient')

strategy:
matrix:
include:
# Windows builds
- os: windows-2022
platform: windows
python-version: '3.11'
artifact-name: synapse-desktop-client-windows-x64

# macOS builds
- os: macos-14
platform: macos
python-version: '3.11'
artifact-name: synapse-desktop-client-macos

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v6
with:
activate-environment: true
python-version: 3.13

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: synapse-electron/package-lock.json

- name: Install Python dependencies
shell: bash
run: |
uv pip install "pyinstaller>=6.14.0" "pyinstaller-hooks-contrib>=2024.0"
uv pip install -e ".[electron]"

# ensure that numpy c extensions are installed on windows
# https://stackoverflow.com/a/59346525
if [ "${{startsWith(runner.os, 'Windows')}}" == "true" ]; then
uv pip uninstall numpy
uv pip uninstall setuptools
uv pip install setuptools
uv pip install numpy
fi

- name: Install Node.js dependencies
shell: bash
run: |
cd synapse-electron
npm install

- name: Build using build scripts (Windows)
if: matrix.platform == 'windows'
shell: bash
run: |
# Set environment variable to skip dependency installation in build script
export SKIP_DEPENDENCY_INSTALL=1

# Use cmd to run the batch file with proper Windows syntax
cmd //c "build_electron_app.bat"

- name: Build using build scripts (macOS)
if: matrix.platform == 'macos'
shell: bash
run: |
# Set environment variable to skip dependency installation in build script
export SKIP_DEPENDENCY_INSTALL=1

chmod +x build_electron_app.sh
./build_electron_app.sh macos

- name: List built files
shell: bash
run: |
echo "Built files in synapse-electron/dist:"
if [ -d "synapse-electron/dist" ]; then
ls -la synapse-electron/dist/
else
echo "No dist directory found"
fi

- name: Upload to GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.event.release.tag_name }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
synapse-electron/dist/*.exe
synapse-electron/dist/*.dmg

# re-download the built package to the appropriate pypi server.
# we upload prereleases to test.pypi.org and releases to pypi.org.
deploy:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ coverage.xml
.ipynb_checkpoints
*.ipynb
.env
*.spec

synapse-electron/node_modules
synapse-electron/backend/build
155 changes: 155 additions & 0 deletions build_electron_app.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
@echo off
REM Build script for Synapse Desktop Client (Electron + Python Backend)
REM This script creates a complete packaged application with both frontend and backend
REM Usage: build_electron_app.bat

echo Building Synapse Desktop Client (Electron + Python Backend)...

REM Ensure we're in the project root
cd /d "%~dp0"

REM Activate virtual environment if it exists
if exist ".venv\Scripts\activate.bat" (
echo Activating virtual environment...
call .venv\Scripts\activate.bat
) else (
echo Warning: Virtual environment not found at .venv\Scripts\activate.bat
echo Continuing with system Python...
)

REM Check required tools
echo Checking required tools...
where node >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Node.js is not installed or not in PATH
echo Please install Node.js from https://nodejs.org/
exit /b 1
)

where python >nul 2>nul
if %ERRORLEVEL% NEQ 0 (
echo ERROR: Python is not installed or not in PATH
echo Please install Python from https://python.org/
exit /b 1
)

REM Install Python dependencies with electron extras
if "%SKIP_DEPENDENCY_INSTALL%"=="1" (
echo Skipping Python dependency installation (CI mode)
) else (
echo Installing Python dependencies...
where uv >nul 2>nul
if %ERRORLEVEL% EQU 0 (
echo Using uv package manager...
uv pip install "pyinstaller>=6.14.0" "pyinstaller-hooks-contrib>=2024.0"
uv pip install -e .[electron]
) else (
echo Using pip package manager...
python -m pip install "pyinstaller>=6.14.0" "pyinstaller-hooks-contrib>=2024.0"
python -m pip install -e .[electron]
)
if errorlevel 1 (
echo ERROR: Failed to install Python dependencies
exit /b 1
)
)

@REM REM Verify PyInstaller version
@REM echo Verifying PyInstaller installation...
@REM python -c "import pyinstaller; print('PyInstaller version:', pyinstaller.__version__)"
@REM if errorlevel 1 (
@REM echo ERROR: PyInstaller not properly installed
@REM exit /b 1
@REM )

REM Build Python backend with PyInstaller
echo Building Python backend...
cd synapse-electron\backend

REM Clean previous builds
if exist dist rmdir /s /q dist
if exist build rmdir /s /q build
if exist *.spec del *.spec

REM Build using the same pattern as the working build
pyinstaller ^
--onefile ^
--name "synapse-backend" ^
--collect-all=synapseclient ^
--collect-all=fastapi ^
--collect-all=uvicorn ^
--collect-all=starlette ^
--collect-all=pydantic ^
--collect-all=websockets ^
--paths "..\.." ^
--paths "..\..\synapseclient" ^
--console ^
server.py

echo Checking if executable was created...
if not exist "dist\synapse-backend.exe" (
echo ERROR: PyInstaller failed to create executable
echo Check the output above for errors
exit /b 1
)

if errorlevel 1 (
echo ERROR: Python backend build failed
exit /b 1
)

echo Python backend built successfully

REM Go back to electron directory
cd ..

@REM REM Install Node.js dependencies
@REM echo.
@REM echo ========================================
@REM echo Installing Node.js dependencies...
@REM echo ========================================
@REM echo DEBUG: About to run npm install
@REM npm install --verbose
@REM echo DEBUG: npm install command completed
@REM set NPM_INSTALL_EXIT=%ERRORLEVEL%
@REM echo DEBUG: npm install exit code: %NPM_INSTALL_EXIT%
@REM REM Check if node_modules exists to verify successful install
@REM if not exist "node_modules" (
@REM echo ERROR: Failed to install Node.js dependencies - node_modules directory not found
@REM exit /b 1
@REM )
@REM echo DEBUG: Node.js dependencies installed successfully
@REM echo DEBUG: Continuing to Electron build step...

REM Build Electron application
echo.
echo ========================================
echo Building Electron application...
echo ========================================
echo DEBUG: About to run npm run dist
echo Running: npm run dist
npm run dist --verbose
if errorlevel 1 (
echo ERROR: Electron build failed
echo Check the output above for details
exit /b 1
)

echo.
echo Build complete!
echo.
echo Electron application packages are in: synapse-electron\dist\
echo Python backend executable is in: synapse-electron\backend\dist\

REM Show built files
echo Built files:
if exist dist (
dir /b dist\*.exe 2>nul
dir /b dist\*.dmg 2>nul
dir /b dist\*.AppImage 2>nul
)

echo.
echo SUCCESS: Synapse Desktop Client built!

pause
Loading
Loading