Giter VIP home page Giter VIP logo

clean-electron-react's Introduction

clean-electron-react is an Electron boilerplate including a fresh setup of React, Typescript Prettier and Webpack in order to provide the cleanest possible setup experience.

Notice: This boilerplate is still in development

Getting Started

Clone the repository or Use this template.

git clone https://github.com/matthiaaas/clean-electron-react.git YOUR-PROJECT-NAME
cd YOUR-PROJECT-NAME
yarn

Development

Start the webpack-dev-server and listen for file changes (supports hot reloading). Then start Electron.

yarn build
yarn watch
yarn dev

You can now start building your app:

app/app.ts (electron entry)

const createWindow = () => {
  const win = new BrowserWindow({
    width: 820,
    height: 532,
    frame: false,
    titleBarStyle: "hiddenInset",
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false
    }
  })

  win.show()
}

app.whenReady().then(createWindow)

app/components/App.tsx

export default function App() {
  return null
}

Packaging

Package your app using electron-builder. Output can be found in /dist

yarn package

Why another boilerplate?

Other Electron React boilerplates come with a ton of additional dependencies and a predefined file structure.
This template is preconfigured from scratch and only includes essential parts and scripts so you can start developing right away.

Minimalistic file structure

├── app
    ├── components
    │   └── App.tsx // rendered component
    ├── app.ts // electron entry file
    ├── index.html
    ├── root.tsx // react renderer
    └── manifest.json
├── build // webpack build output
├── dist // electron-builder output
├── package.json
├── tsconfig.json
└── webpack.config.js

clean-electron-react's People

Contributors

dependabot[bot] avatar matthiaaas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.