Convert Figma logo to code with AI

SimulatedGREG logoelectron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.

15,467
1,543
15,467
282

Top Related Projects

6,405

:electron: A complete tool for building and publishing Electron applications

A Foundation for Scalable Cross-Platform Apps

Easily Build Your Vue.js App For Desktop With Electron

Clone to try a simple Electron app

🥳 Really simple Electron + Vite + Vue boilerplate.

Secure boilerplate for Electron app based on Vite. TypeScript + Vue/React/Angular/Svelte/Vanilla

Quick Overview

Electron-vue is a boilerplate project that combines the Electron framework with Vue.js, allowing developers to build cross-platform desktop applications using web technologies. It provides a structured template and build setup to streamline the development process for Electron apps with Vue.js as the frontend framework.

Pros

  • Seamless integration of Electron and Vue.js, leveraging the strengths of both technologies
  • Well-organized project structure with clear separation of concerns
  • Includes hot-reloading for efficient development workflow
  • Comes with pre-configured build scripts for easy packaging and distribution

Cons

  • May have a steeper learning curve for developers new to either Electron or Vue.js
  • The boilerplate structure might be overly complex for simple applications
  • Requires regular maintenance to keep up with updates to both Electron and Vue.js
  • Limited flexibility in terms of project structure customization

Code Examples

  1. Creating a new window:
import { BrowserWindow } from 'electron'

function createWindow () {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
      contextIsolation: !process.env.ELECTRON_NODE_INTEGRATION
    }
  })

  win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
}
  1. Using Vue.js components:
<template>
  <div>
    <h1>{{ title }}</h1>
    <button @click="incrementCounter">Count: {{ counter }}</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      title: 'Electron-Vue App',
      counter: 0
    }
  },
  methods: {
    incrementCounter() {
      this.counter++
    }
  }
}
</script>
  1. Accessing Electron APIs from Vue components:
import { ipcRenderer } from 'electron'

export default {
  methods: {
    openDialog() {
      ipcRenderer.send('open-file-dialog')
    }
  },
  mounted() {
    ipcRenderer.on('selected-file', (event, path) => {
      console.log('Selected file:', path)
    })
  }
}

Getting Started

  1. Clone the repository:

    git clone https://github.com/SimulatedGREG/electron-vue.git
    
  2. Install dependencies:

    cd electron-vue
    yarn # or npm install
    
  3. Run the development server:

    yarn run dev # or npm run dev
    
  4. Build for production:

    yarn run build # or npm run build
    

This will create a packaged application in the build directory, ready for distribution.

Competitor Comparisons

6,405

:electron: A complete tool for building and publishing Electron applications

Pros of Electron Forge

  • More actively maintained with frequent updates
  • Broader ecosystem support and integration with other tools
  • Extensive documentation and community resources

Cons of Electron Forge

  • Steeper learning curve for beginners
  • Less opinionated structure, requiring more setup decisions

Code Comparison

electron-vue:

import Vue from 'vue'
import App from './App'

new Vue({
  components: { App },
  template: '<App/>'
}).$mount('#app')

Electron Forge:

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));

Key Differences

  • electron-vue is specifically tailored for Vue.js, while Electron Forge is framework-agnostic
  • Electron Forge offers more flexibility in project structure and build configurations
  • electron-vue provides a more opinionated setup, which can be beneficial for quick starts

Use Cases

  • Choose electron-vue for rapid Vue.js-based Electron app development
  • Opt for Electron Forge when you need more control over the build process or want to use other frameworks

Community and Support

  • Electron Forge has a larger community and more third-party resources
  • electron-vue has a dedicated but smaller user base focused on Vue.js integration

A Foundation for Scalable Cross-Platform Apps

Pros of electron-react-boilerplate

  • More active development and frequent updates
  • Extensive documentation and well-maintained wiki
  • Larger community and more contributors

Cons of electron-react-boilerplate

  • Steeper learning curve for beginners
  • More complex project structure
  • Heavier initial setup with more dependencies

Code Comparison

electron-react-boilerplate:

import { MemoryRouter as Router, Routes, Route } from 'react-router-dom';
import './App.css';

export default function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Hello />} />
      </Routes>
    </Router>
  );
}

electron-vue:

<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'app'
}
</script>

The code comparison shows that electron-react-boilerplate uses React Router for navigation, while electron-vue uses Vue Router. The React version has a more explicit routing setup, while the Vue version is more concise.

electron-react-boilerplate offers a more robust and actively maintained solution with better documentation and community support. However, it may be more complex for beginners and requires a deeper understanding of React ecosystem. electron-vue provides a simpler structure and may be easier for Vue developers to adopt, but it has less frequent updates and a smaller community.

Easily Build Your Vue.js App For Desktop With Electron

Pros of vue-cli-plugin-electron-builder

  • Seamless integration with Vue CLI, allowing easy setup and configuration
  • Regular updates and active maintenance, ensuring compatibility with latest Vue and Electron versions
  • Built-in TypeScript support and modern JavaScript features

Cons of vue-cli-plugin-electron-builder

  • Less opinionated structure compared to electron-vue's boilerplate
  • May require more initial setup for complex Electron features
  • Steeper learning curve for developers new to Vue CLI ecosystem

Code Comparison

electron-vue:

import Vue from 'vue'
import App from './App'

new Vue({
  components: { App },
  render: h => h(App)
}).$mount('#app')

vue-cli-plugin-electron-builder:

import Vue from 'vue'
import App from './App.vue'

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
}).$mount('#app')

The code structures are similar, with vue-cli-plugin-electron-builder using a more modern Vue setup. Both approaches allow for easy integration of Electron features, but vue-cli-plugin-electron-builder benefits from Vue CLI's ecosystem and tooling.

Overall, vue-cli-plugin-electron-builder offers a more flexible and up-to-date solution for building Electron apps with Vue, while electron-vue provides a more structured boilerplate that may be easier for beginners to get started with.

Clone to try a simple Electron app

Pros of electron-quick-start

  • Simpler setup, ideal for beginners or small projects
  • Minimal boilerplate code, allowing for quick prototyping
  • Official Electron project, ensuring compatibility and up-to-date practices

Cons of electron-quick-start

  • Lacks built-in Vue.js integration, requiring manual setup for Vue projects
  • No pre-configured build system or development tools
  • Limited project structure, potentially challenging for larger applications

Code Comparison

electron-quick-start:

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({ width: 800, height: 600 })
  win.loadFile('index.html')
}

app.whenReady().then(createWindow)

electron-vue:

import Vue from 'vue'
import App from './App'

new Vue({
  components: { App },
  template: '<App/>'
}).$mount('#app')

// In main process
import { app, BrowserWindow } from 'electron'

Summary

electron-quick-start provides a minimal Electron setup, suitable for simple projects or learning purposes. It offers flexibility but requires more manual configuration for complex applications.

electron-vue integrates Vue.js with Electron, providing a more structured approach for building larger applications. It includes additional development tools and a pre-configured build system, making it more suitable for Vue.js developers working on substantial Electron projects.

🥳 Really simple Electron + Vite + Vue boilerplate.

Pros of electron-vite-vue

  • Uses Vite, offering faster build times and improved development experience
  • More recent and actively maintained, with better support for modern Vue 3 features
  • Includes TypeScript support out of the box

Cons of electron-vite-vue

  • Less mature ecosystem compared to electron-vue
  • May require more manual configuration for complex projects
  • Smaller community and fewer resources available online

Code Comparison

electron-vue (webpack-based):

import Vue from 'vue'
import App from './App'

new Vue({
  components: { App },
  render: h => h(App)
}).$mount('#app')

electron-vite-vue:

import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')

The code comparison shows the difference in initializing a Vue application. electron-vite-vue uses the more modern Vue 3 composition API, while electron-vue uses the older Vue 2 options API.

Both projects aim to simplify Electron and Vue integration, but electron-vite-vue leverages newer technologies and practices. The choice between them depends on project requirements, familiarity with tools, and desired features.

Secure boilerplate for Electron app based on Vite. TypeScript + Vue/React/Angular/Svelte/Vanilla

Pros of vite-electron-builder

  • Uses Vite for faster build times and improved development experience
  • More recent and actively maintained project
  • Includes TypeScript support out of the box

Cons of vite-electron-builder

  • Less mature and potentially less stable than electron-vue
  • Smaller community and fewer resources available
  • May require more configuration for complex projects

Code Comparison

electron-vue:

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    // ...
  ]
})

vite-electron-builder:

import { createRouter, createWebHashHistory } from 'vue-router'

export default createRouter({
  history: createWebHashHistory(),
  routes: [
    // ...
  ]
})

The code comparison shows the difference in router setup between the two projects. vite-electron-builder uses the newer Vue Router 4 syntax with TypeScript, while electron-vue uses the older Vue Router 3 syntax with JavaScript.

vite-electron-builder leverages modern tooling and practices, offering potentially faster development and build times. However, electron-vue has a larger community and more established ecosystem, which may be beneficial for some projects. The choice between the two depends on specific project requirements and developer preferences.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README


electron-vue

The boilerplate for making electron applications built with vue (pretty much what it sounds like).

forthebadge forthebadge forthebadge

js-standard-style

Build Status

Overview

The aim of this project is to remove the need of manually setting up electron apps using vue. electron-vue takes advantage of vue-cli for scaffolding, webpack with vue-loader, electron-packager or electron-builder, and some of the most used plugins like vue-router, vuex, and so much more.

Check out the detailed documentation here.

Things you'll find in this boilerplate...

*Customizable during vue-cli scaffolding

Getting Started

This boilerplate was built as a template for vue-cli and includes options to customize your final scaffolded app. The use of node@^7 or higher required. electron-vue also officially recommends the yarn package manager as it handles dependencies much better and can help reduce final build size with yarn clean.

# Install vue-cli and scaffold boilerplate
npm install -g vue-cli
vue init simulatedgreg/electron-vue my-project

# Install dependencies and run your app
cd my-project
yarn # or npm install
yarn run dev # or npm run dev
Are you a Windows User?

Make sure to check out A Note for Windows Users to make sure you have all the necessary build tools needed for electron and other dependencies.

Wanting to use Vue 1?

Just point to the 1.0 branch. Please note that electron-vue has officially deprecated the usage of vue@^1, so project structure, features, and documentation will reflect those changes (legacy documentation).

vue init simulatedgreg/electron-vue#1.0 my-project

Next Steps

Make sure to take a look at the documentation. Here you will find useful information about configuration, project structure, and building your app. There's also a handy FAQs section.

Made with electron-vue

Take a look at some of the amazing projects built with electron-vue. Want to have your own project listed? Feel free add your project to the bottom of the list below then submit a pull request.

  • Surfbird: A Twitter client built on Electron and Vue
  • Lulumi-browser: Lulumi-browser is a light weight browser coded with Vue.js 2 and Electron
  • Space-Snake: A Desktop game built with Electron and Vue.js.
  • Forrest: An npm scripts desktop client
  • miikun: A Simple Markdown Editor
  • Dakika: A minute taking application that makes writing minutes a breeze
  • Dynamoc: Dynamoc is a GUI client for dynamodb-local, dynalite and AWS dynamodb
  • Dockeron: A dockeron project, built on Electron + Vue.js for Docker
  • Easysubs: Download subtitles in a very fast and simple way
  • adminScheduler: An application leveraging electron for cross platform compatibility, Vue.js for lightning fast UI and full-calendar.io to deliver a premium calendar interface.
  • Backlog: Simple app for storing TODOs, ideas or backlog items. You can organize them with boards. Sleek flow. Built with Electron + Vue.js + iView
  • Opshell: Ops tool to make life easier working with AWS instances.
  • GitHoard: Hoard git repositories with ease.
  • Data-curator: Share usable open data.
  • Bookmark: Desktop app to manage bookmarked links using Atom Electron and Vue.js
  • Uber Run: Simple automation desktop app to download and organize your tax invoices from Uber.
  • Apollo: Convert YouTube videos (and more) to .mp3 files
  • Netsix: Share videos with your friends in a real peer-to-peer manner using WebRTC.
  • code-notes: A simple code snippet manager for developers built with Electron & Vue.js.
  • Pomotroid: A simple and visually-pleasing Pomodoro timer
  • MarkText: Mark Text is a realtime Markdown Editor.
  • vue-design: the best website visualization builder with Vue and Electron
  • ImapSync Client: It's only an Internet Message Access Protocol Synchronization Client
  • Hve: A static blog client tool you may like.
  • MarkdownFox: A simple Markdown viewer with auto update and PDF export.
  • Smart DOCSE: A generic app which ability to display news, contact etc.
  • Cleaver: Cleaver helps you provision servers ready for deploying your web apps with zero downtime - for free!
  • XPanel: XAMPP control panel alternative built with Electron & Vue.js
  • Hexo-Client: A hexo client powered by electron-vue.
  • YT.Downloader: Youtube Video Downloader&Converter and Play Music, built with Electron & Vue.js.
  • BMFont-JS: BMFont-js is a bitmap font generator, built with Electron & Vue.js.
  • YouGet: YouGet - YouTube Video/Playlist Downloader/Cutter - MP3 Converter
  • Asar UI: UI for Asar Pack, built with Electron & Vue.js.
  • Leeze: A Receipt Record App, built with Electron & Vue.js.
  • IntelTracker: An intel item tracker for players/speedrunners of NOLF.
  • Metube: A program to manage your simple YouTube music player and enjoy your music
  • it-tools: A programing helper for developers built with Electron & Vue.js.
  • GifsWorld: Gifs finder built with Vue and Electron

NPM DownloadsLast 30 Days