A robust, modern starter template for building cross-platform desktop applications with Electron, TypeScript, and Vite.
=18-blue.svg title="Node" loading="lazy" />
# Clone the repository
git clone https://github.com/rmncldyo/electron-app-starter.git
cd electron-app-starter
# Install dependencies
npm install
# Start the development server
npm start
electron-app-starter/
āāā src/ # Source code
ā āāā main.ts # Main process entry point
ā āāā preload.ts # Preload script for secure IPC
ā āāā renderer.ts # Renderer process logic
ā āāā index.css # Basic styling
āāā index.html # Main HTML template
āāā forge.config.ts # Electron Forge configuration
āāā vite.main.config.ts # Vite config for main process
āāā vite.preload.config.ts # Vite config for preload scripts
āāā vite.renderer.config.ts # Vite config for renderer process
āāā tsconfig.json # TypeScript configuration
āāā package.json # Project dependencies and scripts
This application follows Electron's recommended architecture with three main components:
Main Process (src/main.ts
)
Renderer Process (src/renderer.ts
, index.html
)
Preload Scripts (src/preload.ts
)
npm start
- Start the application in development modenpm run package
- Package the app without creating installersnpm run make
- Create platform-specific distributables (installers, etc.)npm run publish
- Publish the applicationnpm run lint
- Lint the codebase using ESLintThe application can be packaged for:
npm run lint
to check for code issuesnpm run make
# Create packages for current platform
npm run make
# For specific platforms (if supported by your OS)
npm run make -- --platform=win32 (windowsOS)
npm run make -- --platform=darwin (macOS)
npm run make -- --platform=linux (linuxOS)
Edit package.json
to update:
Modify forge.config.ts
to change:
The starter is ready to integrate with popular UI frameworks:
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
This project was bootstrapped using Electron Forge's vite-typescript
template:
npx create-electron-app@latest electron-app-starter --template=vite-typescript
Special thanks to: