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 make
electron-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 thesrc
directory@ui/
- Points to thesrc/ui
directory@electron/
- Points to thesrc/electron
directory
Example:
// Instead of this
import FakeComponent from "../electron/FakeComponent";
// Use this
import FakeComponent from "@electron/FakeComponent";