desktop

Desktop Development Guide

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "desktop" with this command: npx skills add lobehub/lobehub/lobehub-lobehub-desktop

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 .

  1. Define IPC Types

Location: packages/electron-client-ipc/src/types.ts

export interface SomeParams { /* ... */ } export interface SomeResult { success: boolean; error?: string; }

  1. 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); };

  1. Implement Store Action

Location: src/store/

  1. 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

typescript

No summary provided by upstream source.

Repository SourceNeeds Review
General

react

No summary provided by upstream source.

Repository SourceNeeds Review
1.3K-lobehub
General

zustand

No summary provided by upstream source.

Repository SourceNeeds Review
General

project-overview

No summary provided by upstream source.

Repository SourceNeeds Review