Developer Getting Started โ
๐ ๏ธ Development Setup โ
Command Line Options โ
--reset-settingsor--wipe-settings: Reset all settings to defaults (useful for testing)Usage:
bash# In development npm run build:electron && electron . --reset-settings # Or after building electron . --reset-settingsThis will delete the settings file at
~/.torrify/settings.jsonand restart with default settings.
Run the application in development mode: โ
npm run electron:devThis will:
- Start the Vite dev server on
http://localhost:5173 - Launch Electron with the application
- Enable hot module replacement
- Open DevTools automatically
Run only the Vite dev server (for browser testing): โ
npm run dev๐๏ธ Building โ
Build the application for production:
# Build the application
npm run build
# Package into distributable (creates installer/executable)
npm run package
# Or build for specific platform (must be on that OS)
npm run package:win # Windows NSIS installer (Windows only)
npm run package:mac # macOS DMG (macOS only)
npm run package:linux # Linux AppImage (Linux only)Platform-Specific Build Requirements โ
Windows:
- Requires Developer Mode enabled (Settings โ Privacy & Security โ For developers)
- Or run PowerShell as Administrator
- Reason: electron-builder needs to create symbolic links
macOS:
- Must build on macOS (cannot cross-compile)
- Uses native Apple tools
Linux:
- Must build on Linux (or WSL on Windows)
- Cannot build AppImages on Windows/macOS directly
- Uses Linux-specific tools (mksquashfs)
Cross-Platform Building โ
To build for all platforms without having access to each OS:
- Use GitHub Actions CI/CD (see
.github/workflows/build-installers.yml) - Push to
mainbranch triggers automatic builds for Windows, macOS, and Linux - Download artifacts from GitHub Actions or Releases
Build Output โ
The built files will be in:
dist/- Renderer process (React app)dist-electron/- Main process and preload scriptdist-installer/- Packaged installers
For detailed build instructions, see DEV_README.md.
๐งช Testing โ
The project uses Vitest and React Testing Library for unit and integration tests across the renderer (components, hooks, services) and electron (validation, CAD services). CI runs the full suite with coverage and uploads to Codecov.
Running Tests โ
# Run all tests once
npm test
# Run tests in watch mode (recommended for development)
npm run test:watch
# Generate coverage report (terminal summary + coverage/ HTML)
npm run test:coverageTest Structure โ
Tests live under electron/__tests__/, src/**/__tests__/, and root src/App.test.tsx. Key areas:
- electron: pathValidator, projectValidation, validation schemas, OpenSCADService, Build123dService, cadFactory
- src/components: ChatPanel, EditorPanel, PreviewPanel, SettingsModal, StlViewer, WelcomeModal, HelpBot, DemoDialog, ErrorBoundary, ConfirmDialog, FileToolbar, ProjectToolbar
- src/components/settings: GeneralSettings, AISettings, KnowledgeSettings
- src/hooks: useFileOperations, useRecentFiles, useDemo, useMenuHandlers
- src/services/cad: cad adapter, backend-connectivity
- src/services/llm: GatewayService, GeminiService, OpenRouterService, OllamaService, utils, prompts, index, code-generation
For the full tree and coverage details, see TESTING.md.
What's Tested โ
- โ Component rendering and user interactions (clicks, input)
- โ Hooks (file operations, recent files, demo, menu handlers)
- โ Settings panels (General, AI, Knowledge Base)
- โ LLM services (mocked providers; prompt/build coverage)
- โ Code-generation regression suite
- โ Electron validation (paths, project save/load, schemas) and CAD services (mocked spawn/fs)
- โ Error handling (ErrorBoundary, preview panel)