How rocketchat/rocket.chat.electron works
Project type and purpose
• This is an Electron-based desktop client for the Rocket.Chat chat platform.
File structure
• Top-level:
• build, dist and configuration files for packaging (electron-builder.json, rollup.config.mjs, build/, workspaces/).
• src/ contains all application code, organized by feature and by Electron layer.
• src/main.ts, src/rootWindow.ts, src/preload.ts are the three Rollup entry points:
• main.ts runs in the Electron Main process and orchestrates windows, IPC, native APIs, auto-update, store.
• rootWindow.ts powers the Renderer (React) UI of the main window.
• preload.ts is injected into webviews to expose a safe subset of Node/Electron APIs to Rocket.Chat’s web client.
• src/app holds Redux-style “actions”, “reducers”, “selectors”, and persistence logic driving application state in the main process.
• Feature modules: deepLinks, documentViewer, downloads, i18n, jitsi, navigation, notifications, outlookCalendar, screenSharing, servers, spellChecking, updates, userPresence, videoCallWindow. Each module typically has:
• main.ts (in Main process),
• preload.ts or preload/ (exposed APIs),
• renderer.tsx or ipc.ts (Renderer or WebView code),
• actions.ts, common.ts, reducers.ts or specs.
README for additional insights
• Confirms the three-entry build pipeline (main, rootWindow, preload).
• Emphasizes TypeScript, Rollup bundler, Jest for tests, electron-builder for packaging.
• Mentions how configuration (servers.json, overridden-settings.json) is loaded at runtime.
Elements
• Gray clouds for external services