Skip to content

Development Guide

DIIZZYFPS edited this page Mar 5, 2026 · 1 revision

Development Guide

This guide covers how to set up the sAIve repository for local development and how to build the application for production.


1. Prerequisites

  • Node.js (v18+ recommended)
  • Python (v3.10+)
  • Git

2. Backend Setup (FastAPI)

The backend is located in the Server/ directory.

Quick Start

cd Server
python -m venv venv

# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

pip install -r requirements.txt
uvicorn main:app --reload

The API will now be running on http://localhost:8000.


3. Frontend Setup (React/Electron)

The frontend is located in the sAIve/ directory.

Quick Start

cd sAIve
npm install

Running in Development

sAIve offers two ways to develop the frontend, depending on whether you need to test OS-native Electron features.

Option A: Browser Mode (Recommended for UI work) Runs Vite securely in your browser without launching the heavy Electron wrapper.

npm run browser

(Note: Ensure the backend is already running on port 8000)

Option B: Electron Mode Launches the full Electron desktop shell.

npm run electron:start

4. Building for Production

To create a deployable Windows installer (.exe), you must build both the Python backend and the Electron frontend.

Step 1: Package the Backend (PyInstaller)

cd Server
# Assuming your venv is activated:
pip install pyinstaller
pyinstaller sAIve-backend.spec

This compiles main.py and its dependencies into a single standalone .exe inside Server/dist/.

Step 2: Build the Frontend (Electron Builder)

cd sAIve
npm run electron:build

This command runs Vite to compile the React code, then uses electron-builder to package the React bundle, the electron/main.ts script, and the Python executable you just built into a final installer located in sAIve/dist/.