npx skills add https://github.com/lobehub/lobehub --skill desktopLobeHub 桌面端基于 Electron 构建,采用主进程-渲染进程架构:
apps/desktop/src/main): 应用生命周期、系统 API、窗口管理src/ 中的 Web 代码apps/desktop/src/preload): 安全地将主进程 API 暴露给渲染进程位置: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 };
}
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
在 apps/desktop/src/main/controllers/registry.ts 中注册。
位置:packages/electron-client-ipc/src/types.ts
export interface SomeParams {
/* ... */
}
export interface SomeResult {
success: boolean;
error?: string;
}
位置:src/services/electron/
import { ensureElectronIpc } from '@/utils/electron/ipc';
const ipc = ensureElectronIpc();
export const newFeatureService = async (params: SomeParams) => {
return ipc.newFeature.doSomething(params);
};
位置:src/store/
位置:apps/desktop/src/main/controllers/__tests__/
查看 references/ 目录下的具体主题:
references/feature-implementation.mdreferences/local-tools.mdreferences/menu-config.mdreferences/window-management.md每周安装量
410
代码仓库
GitHub 星标数
74.3K
首次出现
2026 年 1 月 27 日
安全审计
安装于
codex367
opencode364
gemini-cli363
github-copilot345
cursor317
claude-code309
LobeHub desktop is built on Electron with main-renderer architecture:
apps/desktop/src/main): App lifecycle, system APIs, window managementsrc/apps/desktop/src/preload): Securely expose main process to rendererLocation: 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.
Location: packages/electron-client-ipc/src/types.ts
export interface SomeParams {
/* ... */
}
export interface SomeResult {
success: boolean;
error?: string;
}
Location: src/services/electron/
import { ensureElectronIpc } from '@/utils/electron/ipc';
const ipc = ensureElectronIpc();
export const newFeatureService = async (params: SomeParams) => {
return ipc.newFeature.doSomething(params);
};
Location: src/store/
Location: apps/desktop/src/main/controllers/__tests__/
See references/ for specific topics:
references/feature-implementation.mdreferences/local-tools.mdreferences/menu-config.mdreferences/window-management.mdWeekly Installs
410
Repository
GitHub Stars
74.3K
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex367
opencode364
gemini-cli363
github-copilot345
cursor317
claude-code309
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
105,000 周安装