Professional desktop application with multiple real-time synchronized windows
GitHub Repository
- About the Project
- Key Features
- Architecture
- Technologies Used
- Prerequisites
- Installation & Usage
- Project Structure
- Available Scripts
- Development Workflow
- Contributing
- Demos
- License
- Author
This is a modern, production-ready Electron application that demonstrates advanced multi-window management with real-time synchronization. Built with React, TypeScript, and Vite, this project showcases best practices in desktop application development, including:
- Clean Architecture: Separation of concerns with services, hooks, and components
- Type Safety: Full TypeScript implementation across main and renderer processes
- Modern Tooling: Vite for lightning-fast builds and HMR (Hot Module Replacement)
- Professional Workflows: Git hooks, linting, and commit conventions
Perfect for developers looking to build sophisticated desktop applications that go beyond single-window limitations.
- Multi-Window Architecture: Open and manage multiple synchronized child windows from the main window
- Real-Time Synchronization: Instant bidirectional communication between all windows via IPC (Inter-Process Communication)
- Window State Tracking: Robust index management ensures data integrity across window lifecycle events
- Edit Mode: Edit messages in dedicated child windows with live synchronization back to the main window
- Intuitive Interface: Clean, responsive UI built with React
- Message Management: Create, edit, and delete messages with UUID-based identification
- Window Controls: Open, focus, and close child windows programmatically
- Editing State Indication: Visual feedback when messages are being edited in child windows
- Context Isolation: Secure IPC communication with proper preload scripts
- Custom Hooks: Reusable React hooks for window and message management
- Service Layer: Clean abstraction over Electron APIs
- Handler Pattern: Organized IPC handlers for maintainable code
The application follows a layered architecture pattern:
main.ts: Application entry point, window lifecycle managementhandlers/windowHandlers.ts: IPC communication handlers for window operationspreload.ts: Secure bridge between main and renderer processes
windowService.ts: Abstraction layer for window-related IPC operations- Provides type-safe interfaces for all window operations
- Handles validation and error checking
useWindowManagement.ts: React hook for managing window state and operationsuseMessageManagement.ts: React hook for message CRUD operations- Encapsulates business logic and state management
MessageItem/: Reusable message display component- Modular, testable UI components
App.tsx: Main window application logicnewWindow.tsx: Child window application logic
Main Window (App.tsx)
β (User Action)
useWindowManagement Hook
β (Business Logic)
windowService
β (IPC Call)
electronAPI (preload.ts)
β (IPC Channel)
windowHandlers.ts (main process)
β (Window Management)
Child Window (newWindow.tsx)
β (Sync Back)
[Bidirectional Communication Loop]
- Electron ^39.2.3 - Cross-platform desktop application framework
- React ^19.2.0 - UI library for building component-based interfaces
- TypeScript ^5.9.3 - Type-safe JavaScript superset
- Vite ^7.2.4 - Next-generation frontend build tool
- vite-plugin-electron - Electron integration for Vite
- electron-builder ^26.0.12 - Build and distribution tool
- ESLint ^9.39.1 - Code linting and quality enforcement
- Husky ^9.1.7 - Git hooks for pre-commit validation
- Commitlint ^20.1.0 - Enforce conventional commit messages
- Bun - Fast JavaScript runtime (optional, alternative to npm)
- UUID ^13.0.0 - Unique identifier generation
You need one of the following:
# Clone the repository
git clone https://github.com/Tatiwel/electron-multi-window.git
# Navigate to the project directory
cd electron-multi-window
# Install dependencies
bun install
# Start development mode with hot reload
bun run dev# Clone the repository
git clone https://github.com/Tatiwel/electron-multi-window.git
# Navigate to the project directory
cd electron-multi-window
# Install dependencies
npm install
# Start development mode with hot reload
npm run dev# Build the application for distribution
npm run build
# or
bun run buildThis will:
- Compile TypeScript
- Build the Vite project
- Package the Electron application with electron-builder
Built applications will be available in the dist/ directory.
electron-multi-window/
βββ .github/ # GitHub configuration
β βββ ISSUE_TEMPLATE/ # Issue templates
β βββ CODE_OF_CONDUCT.md # Code of conduct
β βββ CONTRIBUTING.md # Contribution guidelines
β βββ PULL_REQUEST_TEMPLATE.md
β βββ SECURITY.md # Security policy
βββ .husky/ # Git hooks configuration
βββ demo/ # Demo GIFs and screenshots
βββ electron/ # Electron main process
β βββ handlers/ # IPC handlers
β β βββ windowHandlers.ts # Window management IPC logic
β βββ main.ts # Main process entry point
β βββ preload.ts # Preload script for secure IPC
β βββ electron-env.d.ts # TypeScript definitions
βββ html/ # HTML entry points
β βββ index.html # Main window HTML
β βββ newWindow.html # Child window HTML
βββ public/ # Static assets
β βββ electron-vite.svg
β βββ react.svg
β βββ vite.svg
βββ src/ # Renderer process (React app)
β βββ assets/ # Styles and images
β βββ components/ # Reusable React components
β β βββ MessageItem/ # Message item component
β βββ hooks/ # Custom React hooks
β β βββ useMessageManagement.ts
β β βββ useWindowManagement.ts
β β βββ index.ts
β βββ pages/ # Page components
β β βββ App.tsx # Main window page
β β βββ newWindow.tsx # Child window page
β βββ services/ # Service layer
β β βββ windowService.ts # Window operations service
β β βββ index.ts
β βββ main.tsx # React entry point (main window)
β βββ vite-env.d.ts # Vite TypeScript definitions
βββ .commitlintrc.cjs # Commitlint configuration
βββ .eslintrc.cjs # ESLint configuration
βββ .gitignore # Git ignore rules
βββ electron-builder.json5 # Electron builder config
βββ package.json # Project metadata and scripts
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.node.json # TypeScript config for Node
βββ vite.config.ts # Vite configuration
βββ README.md # This file
| Command | Description |
|---|---|
npm run dev / bun run dev |
Start the application in development mode with hot reload |
npm run build / bun run build |
Build the application for production |
npm run lint / bun run lint |
Run ESLint to check code quality |
npm run preview / bun run preview |
Preview the built application |
This project enforces code quality through automated tools:
npm run lint- ESLint checks TypeScript and React code
- Configured with React hooks rules and TypeScript-specific rules
- Maximum 0 warnings policy
Commits must follow the Conventional Commits specification:
feat:- New featuresfix:- Bug fixeschore:- Maintenance tasksrefactor:- Code refactoringdocs:- Documentation updatesstyle:- Code style changes (formatting)test:- Adding or updating testsperf:- Performance improvements
Example: feat: add message editing in child windows
Commitlint automatically validates commit messages via Husky pre-commit hooks.
We welcome contributions! Please follow these guidelines:
master: Production-ready code- For urgent fixes, create branches with
fix/prefix
- For urgent fixes, create branches with
development: Active development branch- For new features, use
feature/prefix - For refactoring, use
refactor/prefix - For maintenance, use
chore/prefix
- For new features, use
- Fork the repository
- Create a feature branch from
development:git checkout development git checkout -b feature/your-feature-name
- Make your changes following the code style
- Run linting:
npm run lint - Commit with conventional commit messages
- Push to your fork and create a Pull Request to
development
For detailed guidelines, see CONTRIBUTING.md
Git hooks are automatically installed when you run:
npm install
# or
bun installThis sets up:
- Pre-commit: Runs linting checks
- Commit-msg: Validates commit message format
What's happening here:
- Messages created in the main window are instantly available
- Opening a child window to edit a message shows real-time updates
- Changes in the child window sync back to the main window immediately
- Multiple child windows can be opened simultaneously, all staying in sync
Technical Highlights:
- Each window has a unique UUID identifier
- Window state is tracked in both main and renderer processes
- Proper cleanup when windows are closed
- Prevents race conditions and data corruption
- Safe handling of window lifecycle events
This project is licensed under the ISC License. See the LICENSE file for details.
Daniel (Tatiwel)
- GitHub: @Tatiwel
- Project: electron-multi-window
Interested in a framework-free implementation? Check out the pure Electron branch:
π pure-electron branch
This branch demonstrates the same synchronization logic using:
- Pure JavaScript (no TypeScript)
- No React or frontend frameworks
- Minimal dependencies
- Core Electron APIs only
Perfect for those who prefer a lightweight, framework-free approach or want to understand the underlying IPC mechanics without abstractions.
If you find this project helpful, please consider giving it a βοΈ
Made with β€οΈ by Tatiwel

