desktop▌
lobehub/lobehub · updated Apr 8, 2026
Electron desktop development guide for LobeHub's main-renderer architecture.
- ›Covers controller creation, IPC type definitions, renderer services, and store actions for adding new desktop features
- ›Includes security best practices: input validation, limited API exposure, and preload script patterns for safe main-renderer communication
- ›Provides structured references for feature implementation, local tools workflow, menu configuration, and window management
- ›Emphasizes async methods, b
Desktop Development Guide
Architecture Overview
LobeHub desktop is built on Electron with main-renderer architecture:
- Main Process (
apps/desktop/src/main): App lifecycle, system APIs, window management - Renderer Process: Reuses web code from
src/ - Preload Scripts (
apps/desktop/src/preload): Securely expose main process to renderer
Adding New Desktop Features
1. Create Controller
Location: apps/desktop/src/main/controllers/
import { ControllerModule, IpcMethod } from '@/controllers';
export default class NewFeatureCtr extends ControllerModule {
static override readonly groupName = 'newFeature';
@IpcMethod()
async doSomething(params: SomeParams): Promise<SomeResult> {
// Implementation
return { success: true };
}
}
Register in apps/desktop/src/main/controllers/registry.ts.
2. Define IPC Types
Location: packages/electron-client-ipc/src/types.ts
export interface SomeParams {
/* ... */
}
export interface SomeResult {
success: boolean;
error?: string;
}
3. Create Renderer Service
Location: src/services/electron/
import { ensureElectronIpc } from '@/utils/electron/ipc';
const ipc = ensureElectronIpc();
export const newFeatureService = async (params: SomeParams) => {
return ipc.newFeature.doSomething(params);
};
4. Implement Store Action
Location: src/store/
5. Add Tests
Location: apps/desktop/src/main/controllers/__tests__/
Detailed Guides
See references/ for specific topics:
- Feature implementation:
references/feature-implementation.md - Local tools workflow:
references/local-tools.md - Menu configuration:
references/menu-config.md - Window management:
references/window-management.md
Best Practices
- Security: Validate inputs, limit exposed APIs
- Performance: Use async methods, batch data transfers
- UX: Add progress indicators, provide error feedback
- Code organization: Follow existing patterns, add documentation
Ratings
4.7★★★★★75 reviews- ★★★★★Pratham Ware· Dec 28, 2024
We added desktop from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Camila Sethi· Dec 28, 2024
desktop reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Hana Malhotra· Dec 24, 2024
Registry listing for desktop matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Henry Malhotra· Dec 16, 2024
Keeps context tight: desktop is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Diego Tandon· Dec 16, 2024
desktop has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Camila Singh· Dec 12, 2024
Useful defaults in desktop — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Camila Brown· Dec 12, 2024
desktop fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Arjun Martin· Dec 8, 2024
I recommend desktop for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Naina Rao· Nov 27, 2024
Useful defaults in desktop — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Soo Harris· Nov 27, 2024
Keeps context tight: desktop is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 75