software-factory
MAmattpocock/skills336k近 7 天新增 5,004 个 star
Electron desktop development guide — IPC handlers, controllers, preload scripts, window/menu management.
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 rendererBoth processes log to <userData>/logs/{main,renderer}.jsonl in dev and packaged
builds (apps/desktop/src/main/utils/structuredLog/); read them with
pnpm --dir apps/desktop logs list|query|follow (filters: --level, --since,
--operation op_…, --topic tpc_…) instead of tailing files.
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.
Location: packages/electron-client-ipc/src/types/<domain>.ts, re-exported from types/index.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: beside the controller, apps/desktop/src/main/controllers/<Name>Ctr.test.ts (source-layout §2)
See references/ for specific topics:
references/feature-implementation.mdreferences/local-tools.mdreferences/menu-config.mdreferences/window-management.mdMAmattpocock/skills336k近 7 天新增 5,004 个 star
MAmattpocock/skills336k近 7 天新增 5,004 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
AFaffaan-m/ECC314k近 7 天新增 4,125 个 star
DIDietrichGebert/ponytail202k近 7 天新增 4,780 个 star