A modern boilerplate for building Electron applications with React and Fluent UI, featuring user settings and theme management
- Clone the repository.
- Install dependencies:
bun install - Start the development server:
bun start
- Complete the "Getting Started" steps.
- Build for your platform:
- Windows:
bun run build - Multi-platform support via
electron-builderconfiguration
- Windows:
- Find the built application in the
release/directory.
├── renderer/ # React application source code
│ ├── components/ # UI components
│ │ ├── breadcrumb/ # Breadcrumb navigation
│ │ ├── dialog/ # Modal dialog components
│ │ ├── error/ # Error boundary components
│ │ ├── footer/ # Footer component
│ │ ├── navbar/ # Top navigation bar
│ │ ├── report/ # Report components
│ │ └── sidebar/ # Sidebar component
│ ├── context/ # React Context providers
│ │ ├── grid/ # Grid state management
│ │ ├── location/ # Location state
│ │ └── tabs/ # Tab management
│ ├── hooks/ # Custom React hooks
│ ├── layout/ # Layout components
│ ├── pages/ # Page components
│ │ ├── help/ # Help page
│ │ └── home/ # Home page
│ ├── routes/ # React Router configuration
│ └── types/ # React-specific TypeScript types
├── electron/ # Electron main process code
│ ├── main.ts # Main Electron process
│ ├── preload.ts # Preload script
│ └── types/ # Electron-specific types
├── types/ # Centralized TypeScript definitions
│ ├── vite-env.d.ts # Vite client types
│ ├── electron-env.d.ts # Electron & Node.js types
│ └── index.d.ts # Main type entry point
├── dist-electron/ # Compiled Electron files
└── release/ # Packaged application output
bun start/bun dev: Start development serverbun run preview: Preview the built application
bun run build: Complete build pipeline (renderer → electron → package)bun run build:renderer: Build React app only (dist/)bun run build:electron: Compile Electron TypeScript (dist-electron/)bun run package: Package with electron-builder (release/)
bun run lint: Code analysis with Biome (renderer + electron)bun run format: Code formatting with Biomebun run check: Comprehensive check with Biome
bun run check:type: TypeScript check for rendererbun run type-check:electron: TypeScript check for Electron
bun run clean: Remove build artifacts (dist,dist-electron,release)
package.json: Project metadata and dependencieselectron-builder.json5: Build configuration for platformsvite.config.ts: Vite configuration (React + Electron)biome.json: Biome linter and formatter configurationtsconfig.json: TypeScript configuration (renderer)tsconfig-electron.json: TypeScript configuration (electron)tsconfig.node.json: Node.js TypeScript configuration
- Electron: Desktop application framework
- React 19: UI library (latest version)
- TypeScript: Type-safe JavaScript
- Vite: Fast build tool and dev server
- FluentUI: Microsoft's modern UI component library
- Biome: Fast linter and formatter (ESLint + Prettier alternative)
- Electron Builder: Application packaging and distribution
- Sass: CSS preprocessor
- React Router DOM: Client-side routing
@fluentui/react-components: FluentUI components@fluentui/react-icons: FluentUI iconsreact-router-dom: Routing management
- Modern UI: Windows 11-style interface with FluentUI components
- Error Handling: Comprehensive error boundaries for stability
- TypeScript: Full type safety
- Hot Reload: Instant reloading during development
- Context API: Global state management (Grid, Location, Tabs)
- Custom Hooks: Reusable React hooks
- Responsive Layout: Adaptive sidebar and navbar
- Routing: Page navigation with React Router
- Code Quality: Automatic code formatting and linting with Biome
- FluentUI components are compatible with Microsoft's design system
- Electron's
nativeThemeAPI can be utilized for system theme detection - Very fast development experience thanks to Vite
- Biome offers a much faster alternative to ESLint and Prettier
- Error boundaries provide robust error handling in React components
- Single SCSS file: All styles in
renderer/styles.scssfor simplicity - CSS Variables: Theme-based color variables for light/dark modes
- FluentUI Integration: Leverages FluentUI's design tokens
- LocationProvider (outermost): Router location context
- GridProvider (middle): Grid state management
- TabProvider (innermost): Tab state, changes most frequently
- Centralized types: Global types in
/typesdirectory - Module types: Component-specific types in respective
/typesfolders - Environment types: Electron and Vite environment extensions
The following environment variables can be configured in the .env file:
ENABLE_DEVTOOLS: Enable development tools (true/false) (default: true)LOG_LEVEL: Log level (error,warn,info) (default: error)NODE_ENV: Environment (development,production)
This project is open source and available under the MIT License
Created by Burak Ünal with ❤️
