A modern desktop application template using Electron Forge with React, Vite, and TypeScript.
- ⚡️ Vite - Fast development and building
- 🔋 Electron Forge - Easy packaging and distribution
- ⚛️ React - Component-based UI
- 📝 TypeScript - Type safety
- 📁 Path Aliases - Clean imports using
@/,@ui/, and@electron/
- Node.js (v14+)
- npm or yarn
# Clone the repository
git clone [this-repo]
cd electron-forge-react-vite-typescript
# Install dependencies
npm install# Start the development server
npm start# Package the app
npm run package
# Make distributable
npm run makeelectron-forge-react-vite-typescript/
├── src/
│ ├── electron/ # Electron main process code
│ └── ui/ # React frontend code
├── 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
This project uses path aliases for cleaner imports:
@/- Points to thesrcdirectory@ui/- Points to thesrc/uidirectory@electron/- Points to thesrc/electrondirectory
Example:
// Instead of this
import FakeComponent from "../electron/FakeComponent";
// Use this
import FakeComponent from "@electron/FakeComponent";