An open API service indexing awesome lists of open source software.

https://github.com/involvex/create-electron-app


https://github.com/involvex/create-electron-app

Last synced: 14 days ago
JSON representation

Awesome Lists containing this project

README

          

# create-electron-app

Interactive CLI for scaffolding Electron applications with Bun runtime, TypeScript, and modern tooling.

## Features

- ๐Ÿš€ **Bun Runtime**: 10-100x faster than npm, built-in bundler
- โšก **Hot Reloading**: Instant HMR with electron-vite
- ๐ŸŽจ **Multiple Templates**: Vanilla, React, Vue, React+Tailwind
- ๐ŸŽจ **Styling Options**: Tailwind CSS, Aura UI, Kumo, shadcn/ui, custom CSS
- ๐Ÿช„ **Glass Morphism**: Built-in frosted glass effects
- ๐ŸŽญ **Navigation**: Native Electron MenuBar or custom navbar
- ๐Ÿ“ฑ **Tray Menu**: System notification area support
- ๐ŸŒ— **Themes**: Dark/light mode with multiple presets
- โœจ **Code Quality**: ESLint, Prettier, TypeScript

## Quick Start

### Interactive Usage

```bash
bunx @involvex/create-electron-app
```

The CLI will guide you through:

1. **Project Name**: Enter your project name
2. **Template Selection**: Choose vanilla, React, Vue, or React+Tailwind
3. **Styling Framework**: Tailwind, Kumo, shadcn/ui, Aura UI, or custom CSS
4. **UI Features**: Glass morphism, navbar type, tray menu, theme
5. **Code Quality**: ESLint, Prettier, Git initialization
6. **Backend**: Vite backend, Bun.serve, Express, or none

### Local Development

```bash
# Install dependencies
bun install

# Run CLI locally
bun run src/index.ts
```

## Templates

### 1. Vanilla + Vite (Minimal)

Pure TypeScript + Vite with Bun - lightweight and fast.

### 2. React + Vite

Modern React 19 with fast HMR and Bun dev server.

### 3. React + Vite + Tailwind + Component Library

Full-featured with:

- Tailwind CSS 4
- Optional: Kumo (Cloudflare) or shadcn/ui components
- Glass morphism utilities
- Dark/light theme with CSS variables
- Optional: Aura UI components

### 4. Vue + Vite

Vue 3 Composition API with TypeScript support.

## Styling Options

### Primary Frameworks

- **Tailwind CSS 4**: Industry standard with `@theme` tokens
- **Aura UI**: "Vibrant Depth" design with glass morphism
- **Kumo**: Cloudflare's design system (87K weekly downloads)
- **shadcn/ui**: 50+ customizable components
- **@casoon/tailwindcss-glass**: Dedicated glass morphism system

### Lightweight Alternatives (<35KB)

- **ยตCSS**: ~19KB, CSS-only, semantic HTML
- **Symphony CSS**: ~35KB, semantic-first
- **Graffiti**: ~26KB minimal toolkit
- **Lissom.CSS**: Classless, minimalist
- **Frankenstyle**: No-build utility-first
- **Cutestrap**: 2.7KB progressive enhancement
- **SamphireCSS**: 12KB gzipped, content-first

## UI Features

### Glass Morphism

Three intensity levels:

- **Soft Glass**: 8px blur, subtle transparency
- **Standard Glass**: 16px blur, moderate
- **Strong Glass**: 24px blur, dense

Plus dark glass and gradient variants.

### Navigation

- **Native Electron MenuBar**: Built-in menu system
- **Sticky Navbar**: `position: sticky` with blur effect
- **Fixed Navbar**: `position: fixed` overlay
- **Custom HTML**: Fully customizable

### Tray Menu

System notification area with:

- Show/hide window
- Recent files
- Quick settings
- Exit application

### Themes

- **Default**: Clean, light design
- **Dark Night**: Deep slate tones
- **Glass**: Frosted translucent
- **Gradient**: Colorful gradients

## Project Structure

```
my-electron-app/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ main/ # Main process
โ”‚ โ”‚ โ”œโ”€โ”€ index.ts # Electron entry point
โ”‚ โ”‚ โ””โ”€โ”€ menu.ts # Application menu
โ”‚ โ”œโ”€โ”€ renderer/ # Renderer process
โ”‚ โ”‚ โ”œโ”€โ”€ App.tsx # Main component
โ”‚ โ”‚ โ”œโ”€โ”€ index.css # Global styles
โ”‚ โ”‚ โ””โ”€โ”€ main.tsx # Renderer entry
โ”‚ โ”œโ”€โ”€ preload/ # Preload scripts
โ”‚ โ”‚ โ””โ”€โ”€ index.ts
โ”‚ โ””โ”€โ”€ shared/ # Shared code
โ”‚ โ””โ”€โ”€ types.ts
โ”œโ”€โ”€ vite.main.config.ts # Vite config (main)
โ”œโ”€โ”€ vite.renderer.config.ts# Vite config (renderer)
โ”œโ”€โ”€ electron.vite.config.ts# Combined config
โ”œโ”€โ”€ tailwind.config.js # Tailwind config (if selected)
โ”œโ”€โ”€ eslint.config.js # ESLint config (if selected)
โ”œโ”€โ”€ prettier.config.js # Prettier config (if selected)
โ”œโ”€โ”€ tsconfig.json # TypeScript config
โ”œโ”€โ”€ bunfig.toml # Bun configuration
โ””โ”€โ”€ package.json
```

## Development

### Hot Reloading

**electron-vite** (recommended):

- Instant HMR for renderer process
- Hot reloading for main process
- Automatic process management

**Bun Native**:

```bash
bun --watch src/main/index.ts
```

### Build Output

```json
{
"scripts": {
"dev": "electron-vite dev",
"build": "electron-vite build",
"preview": "electron-vite preview"
}
}
```

## Code Quality

The CLI includes built-in support for code quality tools:

### Formatting (Biome)

```bash
bun run format # Format code with Biome
```

### Linting (Biome)

```bash
bun run lint # Lint code with Biome
```

### Type Checking (TypeScript)

```bash
bun run typecheck # Run TypeScript type checking
```

### Full Check

```bash
bun run check # Run format, lint, and typecheck
```

## Technical Stack

- **Runtime**: Bun 1.3+
- **Bundler**: Vite + electron-vite
- **Language**: TypeScript 5.x (strict mode)
- **Framework**: React 19 / Vue 3 / Vanilla
- **Styling**: Tailwind CSS 4
- **Components**: shadcn/ui / Kumo / Aura UI
- **Linting**: Biome
- **Formatting**: Biome
- **Type Checking**: TypeScript

## Why Bun?

- โšก **10-100x faster** than npm/yarn/pnpm
- ๐ŸŽฏ **Built-in bundler** with native TypeScript support
- ๐Ÿ”ฅ **Watch mode**: `--watch` and `--hot` flags
- ๐Ÿ“ฆ **Zero-config**: Works out of the box
- ๐Ÿš€ **Standalone**: Compile to single executable

## Bun + Electron Integration

- `--watch` mode: Hard restart on file changes
- `--hot` mode: Soft reload (HMR) for main process
- `Bun.build()`: Native bundling with file watching
- `import.meta.hot`: Vite-compatible HMR API
- Standalone compilation via `bun build --compile`

## Installation

### Global Usage

```bash
bunx @involvex/create-electron-app
```

### NPM

```bash
npx create-electron-app
```

### Yarn

```bash
yarn create create-electron-app
```

### PNPM

```bash
pnpm create create-electron-app
```

## Browser Support

- macOS (native menus, tray)
- Windows (native menus, tray)
- Linux (native menus, tray with limitations)

## License

MIT

## Resources

- [PLANNING.md](.kilo/plans/) - Detailed technical planning and architecture
- [electron-vite](https://electron-vite.org) - Build tool documentation
- [Bun](https://bun.sh) - Runtime documentation
- [Tailwind CSS](https://tailwindcss.com) - Styling framework
- [shadcn/ui](https://ui.shadcn.com) - Component library
- [Kumo](https://kumo-ui.com) - Cloudflare design system