Skip to content

Kana00/electron-new-project

Repository files navigation

electron-new-project

License Version

electron-new-project is a basic, solid template for creating a new project by providing an already predefined set of features for the developers.


Installation

You must install yarn to have best performance (not npm).

After that, install Electron-forge and other tools:

> yarn add global electron-forge cross-env gulp

Finally, run the template and enjoy:

> git clone https://github.com/Kana00/electron-new-project.git
> cd electron-new-project
> yarn start

React Redux React Router Jest TypeScript Gulp Lottie Less


Folder tree

  • __tests__: where are the Jest unit tests.
  • assets : where are the images/fonts/animations.
  • components: where are the components of react used in this app.
  • config: files that export javascript objects. they are called in several files. this allows to have a few parameters co-ordinate.
  • i18n: where are all translation, and the function that allow you to use I18n translations.
  • redux: stores the redux store, actions and reduce (a file redux/action/listeAction exist to avoid any collision of actions).
  • routes: react components that are displayed or hidden along the route. For this reason, these special components are in a special folder. We can say that these components are like screens that stores business react components.
  • typings: TypeScript provides you with variable typing. Sometimes, having a lot of typing and their javascript documentation is heavy to read. This folder stores all the variable definitions and modules of our application and imports them dynamically into all the application. Thus, our files remains legible to read.
  • utils: contains useful functions (or class) that are not react components. simply various tools (e.g.: colorTools).
  • start.ts: where Electron start and display our window.
  • app.tsx: where is stored the mount point of our react application.

Make the app in production

As simple as that:

  "electronPackagerConfig": {
    "packageManager": "yarn",
    "icon": "src/assets/images/icons/mac/icon.icns",
    "asar": true
  },

NOTE: If you're on Windows, change mac/icon.icns to win/icon.ico. For Linux users, change mac/icon.icns to png/icon.png.

To remove the warning where electron-compile tries to compile the definition files ".d.ts", remove them temporarily before a production compilations.


Note: the title bar is slightly different on Windows and Linux. You can see the difference below:

windows title bar


License

Code is under the MIT License.

About

A starter project template with electron-forge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published