# {{displayName}} Cross-platform desktop application built with Electron and React for the Vibes monorepo. ## Getting Started ### Prerequisites - Node.js (version 18 or higher) - pnpm ### Installation Install dependencies: ```bash pnpm install ``` ### Development Start the development environment: ```bash pnpm start ``` This will compile and launch the Electron app with hot reloading enabled. ### Building Create distributable packages: ```bash pnpm make ``` This will create platform-specific packages in the `out` directory. ## Project Structure ``` {{appName}}/ ├── src/ │ ├── main/ # Main process (Electron) │ │ ├── index.ts # Main entry point │ │ ├── preload.ts # Preload script │ │ ├── window.ts # Window management {{#if includeMenuBar}} │ │ ├── menu.ts # Application menu {{/if}} {{#if includeSystemTray}} │ │ ├── tray.ts # System tray {{/if}} {{#if includeAutoUpdater}} │ │ ├── updater.ts # Auto-updater {{/if}} {{#if includeIpc}} │ │ └── ipc.ts # IPC handlers {{/if}} │ ├── renderer/ # Renderer process (React) │ │ ├── index.tsx # React entry point │ │ ├── App.tsx # Main app component │ │ ├── components/ # React components │ │ └── hooks/ # Custom React hooks │ ├── shared/ # Shared code │ │ ├── types.ts # TypeScript types │ │ └── constants.ts # Constants │ └── index.html # HTML template ├── assets/ # Application assets ├── webpack.*.ts # Webpack configuration ├── forge.config.ts # Electron Forge config ├── tsconfig.json # TypeScript config └── package.json # Dependencies ``` ## Features {{#if includeAutoUpdater}} - 🔄 Auto-updater for seamless updates {{/if}} {{#if includeSystemTray}} - 🔔 System tray support {{/if}} {{#if includeMenuBar}} - 📋 Custom application menu {{/if}} {{#if includeIpc}} - 📡 IPC communication between main and renderer {{/if}} {{#if includeDarkMode}} - 🌓 Dark mode support {{/if}} - ⚡ Hot reloading in development - 🔒 Context isolation and security best practices - 📦 Ready for distribution on Windows, macOS, and Linux ## Scripts - `pnpm start` - Start development mode - `pnpm package` - Package the app without distributing - `pnpm make` - Create distributable packages - `pnpm publish` - Publish the app (requires configuration) - `pnpm lint` - Run ESLint - `pnpm typecheck` - Run TypeScript type checking - `pnpm test` - Run tests ## IPC Communication {{#if includeIpc}} The app includes examples of secure IPC communication between the main and renderer processes: ### Main Process (src/main/ipc.ts) Handles system operations and responds to renderer requests. ### Renderer Process Uses the exposed API through the preload script to communicate with the main process. Example: ```typescript // In renderer const result = await window.api.invoke('my-channel', data); // In main ipcMain.handle('my-channel', (event, data) => { // Handle the request return result; }); ``` {{else}} IPC communication can be added by enabling the IPC option during app creation. {{/if}} ## Dark Mode {{#if includeDarkMode}} The app includes dark mode support that syncs with the system preference: ```typescript // Use the custom hook const { isDarkMode, toggleDarkMode } = useDarkMode(); ``` {{else}} Dark mode support can be added by enabling the dark mode option during app creation. {{/if}} ## Building for Production ### Windows ```bash pnpm make --platform=win32 ``` ### macOS ```bash pnpm make --platform=darwin ``` ### Linux ```bash pnpm make --platform=linux ``` ## Distribution The app is configured to create the following distributable formats: - Windows: Squirrel installer (.exe) - macOS: DMG and ZIP - Linux: DEB and RPM packages ## Security This app follows Electron security best practices: - Context isolation enabled - Node integration disabled in renderer - Preload scripts for secure IPC - Content Security Policy - Remote module disabled ## Contributing Contributions are welcome! Please feel free to submit a Pull Request. ## License This project is licensed under the MIT License.