electron-svelte-vite-template Svelte Themes

Electron Svelte Vite Template

A template for Electron applications using Svelte and Vite

Electron Svelte Template

A modern template for building cross-platform desktop applications using Electron, Svelte, and Vite.

Features

  • ๐Ÿš€ Fast development with Vite
  • โšก๏ธ Reactive UI with Svelte
  • ๐Ÿ–ฅ๏ธ Cross-platform desktop app with Electron
  • ๐Ÿงช BDD-style testing with Vitest
  • ๐ŸŽจ Consistent 3-space tab formatting
  • ๐Ÿ”ง TypeScript support
  • ๐Ÿ“ฆ Modern project structure

Getting Started

Prerequisites

  • Node.js (v16 or newer)
  • npm or pnpm

Installation

# Clone the repository
git clone https://github.com/gsenden/electron-svelte-vite-template.git

# Install dependencies
npm install

Development

# Start the development server
npm run dev

# Run tests
npm test

# Format code
npm run format

# Lint code
npm run lint

Building

# Build the application
npm run build

# Build the Electron app
npm run electron:build

Project Structure

โ”œโ”€โ”€ electron/          # Electron main process
โ”œโ”€โ”€ src/              # Svelte application
โ”‚   โ”œโ”€โ”€ routes/       # SvelteKit routes
โ”‚   โ””โ”€โ”€ lib/          # Shared components and utilities
โ”œโ”€โ”€ .vscode/          # VS Code settings
โ””โ”€โ”€ public/           # Static assets

Features in Detail

Process Management

  • Proper Vite server lifecycle management
  • Clean process termination
  • Development and production modes

Testing

  • BDD-style tests with describe/it blocks
  • Vitest for fast test execution
  • Testing Library for component testing

Code Style

  • 3-space tab width
  • Prettier for consistent formatting
  • ESLint for code quality
  • TypeScript for type safety

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Top categories

Loading Svelte Themes