Local File System Access
The desktop app provides full access to your local file system with secure path validation.File Operations
All file operations are exposed through a secure IPC bridge (electron/preload/index.ts:4):
File Watching
Monitor directories for changes using the built-in file watcher:electron/main/ipc/file-system.ts:173
Security & Path Safety
All file operations validate paths to prevent access to sensitive system directories:- Safe Paths
- Forbidden Paths
✅ Allowed:
- User home directory
- Documents folder
- Desktop
- Custom project directories
- Removable drives
realpath to resolve symlinks and prevent directory traversal attacks (electron/main/ipc/file-system.ts:15).
Native Dialogs
Access system file picker dialogs for a native user experience:Open File Dialog
Save File Dialog
electron/main/ipc/dialog.ts
Window Management
Control the application window programmatically:electron/main/ipc/window.ts
Window Configuration
The main window is created with these settings (electron/main/window-manager.ts:18):
System Notifications
Send native system notifications:electron/main/ipc/notification.ts
Auto-Update System
The desktop app includes automatic update functionality powered byelectron-updater.
Update Flow
Check for Updates
App checks for updates on startup (after 3 seconds) and periodically in the background.
Update Configuration
Auto-updater settings (electron/main/auto-updater.ts:6):
electron-builder.yml:55):
External URL Handling
Open URLs in the system’s default browser:- Opening documentation links
- OAuth authentication flows
- GitHub repository links
- External resources
electron/main/ipc/external-url.ts
OAuth Integration
The window manager handles OAuth flows by opening provider URLs in the system browser (electron/main/window-manager.ts:59):
Menu Integration
The app provides a native menu bar with common actions:Menu Structure
Menu Events
Listen for menu actions in your app:electron/main/menu.ts
Server Management
The desktop app runs a standalone Next.js server for the IDE interface.Development Mode
In development, connects to the Next.js dev server:Production Mode
In production, spawns a standalone Next.js server:electron/main/server-manager.ts:16
Health Checks
The server manager verifies the server is ready before opening windows:Single Instance Lock
Only one instance of the app can run at a time. When a second instance is launched, it focuses the existing window:electron/main/index.ts:50
Logging
The desktop app useselectron-log for comprehensive logging:
- Windows:
%USERPROFILE%\AppData\Roaming\Polaris IDE\logs\main.log - macOS:
~/Library/Logs/Polaris IDE/main.log - Linux:
~/.config/Polaris IDE/logs/main.log
Offline Capabilities
While most features require internet connectivity, some operations work offline:✅ Works Offline
✅ Works Offline
- Code editing
- File system operations
- Syntax highlighting
- Local file search
- Editor preferences
❌ Requires Online
❌ Requires Online
- AI features (suggestions, chat, quick edit)
- Project synchronization with Convex
- GitHub import/export
- Authentication
- Auto-updates
Performance Optimizations
The desktop app includes several performance enhancements:- Standalone Next.js server reduces overhead compared to full Next.js dev server
- Direct file system access eliminates WebContainer overhead
- Native rendering via Chromium provides excellent performance
- Process isolation keeps main process responsive during heavy operations
- Lazy loading defers IPC handler registration until needed
TypeScript Types
The Electron API is fully typed for TypeScript projects:electron/preload/types.ts
Next Steps
GitHub Integration
Import and export projects to GitHub
Stack Auth
Learn about desktop authentication