• Stars
    star
    271
  • Rank 151,717 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💅 A fast and ready-to-go with a well-thought-out structure Electron app boilerplate with ReactJS, TypeScript, CSS / SASS modules, Electron Vite, Eslint, Prettier, GitHub Action releases and more.

Electron App

💅 A fast and ready-to-go with a well-thought-out structure Electron app boilerplate with ReactJS, TypeScript, CSS / SASS modules, Electron Vite, Eslint, Prettier, GitHub Action releases and more.

patreon url releases url license url

preview

Features

  • Stands out
    • 🔥 Fast and Ready-to-go with a well-thought-out structure
    • 🚀 Auto reload for main and Fast Refresh for renderer process
    • 🎉 Window and Screen routing included
    • 😎 Preload (context bridge) already configured
    • 🙀 IPC communication example included
    • 🔮 GitHub Action releases with Windows, Mac and Linux binaries
    • 🔒 Source Code Protection support
    • 🍪 Absolute paths support
  • Technologies:
    • 🔋 Electron
    • 🔥 ReactJS
    • 🌎 React Router DOM and Electron Router DOM
    • 🧐 React Developer Tools
    • 💙 TypeScript
    • 📦 Electron Vite
    •  CSS / SASS modules
    • 💫 Eslint / Prettier / EditorConfig / Husky / lint-staged / Commitlint
    • 📦 Electron Builder
    • 🔮 action-electron-builder

⚠️ If Windows 7 and 8 support is important for your project, you should know that Electron in a version greater than 22x no longer supports it. You can read more about it here. Therefore, you must downgrade Electron to the version cited in this context!

Usage

First, install the dependencies by running on the terminal:

yarn

That done, just run the project with the following command:

yarn dev

Now, look at the package.json file in the root directory, you should update some of that settings with your project branding.

Distribution

For all platforms

Note: Check Electron Builder docs for more knowledge

yarn build

For a specific one

yarn build --mac
# OR
yarn build --win
# OR
yarn build --linux

The builded apps will be available on the dist folder.

Releasing

Note: to be able to perform auto-updates you will need a code signed app, for this purpose you will need to configure it by yourself, so check the electron-builder and action-electron-builder docs please to get know how to do this.

To release your app on a GitHub release with Windows, Mac and Linux binaries, you can perform the following commands:

git pull
yarn make:release

Then, enter the new version of your app, so it will produce the following binaries in a draft release from the action:

  • Windowszip (portable), .exe
  • Mac.zip (app), .dmg
  • LinuxAppImage, freebsd, pacman, rpm, deb

In this process, the action will be triggered and the previous command will open the releases and actions page in your browser. When the action is finished, you can click in the releases page and refresh it to see the draft release with the binaries, so you can edit it and release it for your users.

demo.mp4

Source Code Protection

This process is done via v8 bytecode compilation, to get more knowledge about it, please, check the Electron Vite docs.

Use the bytecodePlugin from electron-vite to enable it in the electron.vite.config.ts:

import { defineConfig, bytecodePlugin } from 'electron-vite'

export default defineConfig({
  main: {
    plugins: [tsconfigPaths, bytecodePlugin()]
  },

  preload: {
    // Note: you will get the following warning using bytecodePlugin in the preload script in production build: "The vm module of Node.js is deprecated in the renderer process and will be removed", is up to you to keep bytecodePlugin here. Also, keep following the Electron Vite docs for more updates about this plugin!
    plugins: [tsconfigPaths, bytecodePlugin()]
  },

  renderer: {
    // ...
  }
})

Also, sandbox should be false in webPreferences for the windows you are using a preload script like:

const window = createWindow({
  id: 'main',

  webPreferences: {
    preload: join(__dirname, '../preload/index.js'),
    sandbox: false,
  },
})

Documents



Creating Windows



Routing



Structure Overview



FAQ - Frequently Asked Questions

Contributing

Note: contributions are always welcome, but always ask first, — please — before work on a PR.

That said, there's a bunch of ways you can contribute to this project, like by:

  • 🪲 Reporting a bug
  • 📄 Improving this documentation
  • 🚨 Sharing this project and recommending it to your friends
  • 💵 Supporting this project on GitHub Sponsors or Patreon
  • 🌟 Giving a star on this repository

License

MIT © Dalton Menezes

More Repositories

1

aura-theme

✨ A beautiful dark theme for your favorite apps.
TypeScript
3,190
star
2

electron-screen-recorder

📼 A Desktop screen recorder app built using web technologies for Mac, Linux and Windows.
JavaScript
291
star
3

electron-router-dom

🌎 A react-router-dom adapter for Electron apps
JavaScript
122
star
4

interprocess

💬 A scalable and type-safe Electron IPC management tool with enhanced DX
TypeScript
95
star
5

use-exit-intent

🐠 A React Hook to handle exit intent strategies
TypeScript
81
star
6

hyper-init

⚡ The ultimate and most complete extension to initialize commands before and after Hyper terminal starts.
JavaScript
75
star
7

netflix-list-exporter

💫‎‎‎‏‏‎ An Extension to export your lists from Netflix to Clipboard area and share it with your friends.
JavaScript
74
star
8

aircnc

☕ Airbnb like (Air Coffee & Code) to booking spots for developers using ReactJS, React Native, Node.js and more.
JavaScript
53
star
9

opendocs

🎉 Next.js beautifully designed template that you can use for your projects for free with site, blog and docs support. Accessible. Customizable. Open Source with i18n support.
TypeScript
47
star
10

cra-template-good-start

💅 A Create React App good starting point template to init a configured app with typescript, sass, eslint, prettier and more
TypeScript
35
star
11

stylish-hub

🍹 A browser extension that brings new GitHub features and experience.
JavaScript
18
star
12

discord-malicious-domains

🤖 A list of malicious domains on Discord using the Discord Guardian Action.
15
star
13

daltonmenezes.github.io

🚀 My personal website.
TypeScript
13
star
14

orb

🌐 Your friendly JavaScript languages handler. ORB turns fastly and easily your website/project to multilingual.
JavaScript
13
star
15

pepper-the-chicken

A free and open source simple game that looks like Flappy Bird written in HTML5 and JavaScript.
JavaScript
11
star
16

be-the-hero

🌟 App to help NGOs built with ReactJS, React Native, Node.js and more.
JavaScript
10
star
17

what-type-is

❔ A simple type checking library for Node.js
JavaScript
7
star
18

discord-guardian-action

🤖 An action that fetches the list of malicious domains on Discord in different providers and creates/updates a JSON file with them from time to time.
TypeScript
7
star
19

slimp

A dead simple way to build elegant websites
4
star
20

assets

Repo to store some of my public project assets
4
star
21

omelete-tabs

🍳 Extensão que traz as últimas notícias do omelete.com.br nas abas do navegador.
JavaScript
2
star
22

minimal-husky-commitlint

⚡ A minimal template project to get started with husky and commitlint
Shell
2
star
23

eventScheduler

A simple event scheduler application for PHP projects.
PHP
2
star
24

ubuntu-wallpaper-fix

🐚 A shell script trick for wallpaper bug when Ubuntu is started with two (or more) connected monitors with different display interfaces.
Shell
2
star
25

linketheme

🎨 An eye-catching cleaner theme extension for LinkedIn
CSS
2
star
26

daltonmenezes

1
star
27

code-replicator

🍰 A piece of cake way to backup or restore settings, snippets and extensions from Visual Studio Code
1
star
28

awesome-html5-game-dev

An awesome list about game development using HTML5 technologies.
1
star
29

colors-convert-issue-examples

https://github.com/ilariaventurini/colors-convert/issues/15
TypeScript
1
star
30

researches

🔬 Stuff about my researches in software development
C
1
star