Electron.js Apps Structure
A scalable and maintainable folder structure for Electron.js applications
File Structure
- src
- main.js
- renderer.js
- preload.js
- index.html
- package.json
- README.md
Directory Structure Explanation
src/
Contains all source code for the Electron application including main and renderer processes.
src/main.js
Main process entry point that creates and manages application windows and handles system events.
src/renderer.js
Renderer process script that handles UI logic and user interactions in the browser window.
src/preload.js
Preload script that runs before the renderer process and provides secure communication between main and renderer.
index.html
Main HTML file that serves as the user interface for the Electron application.