• Stars
    star
    407
  • Rank 106,183 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Minimal Electron, React, PostCSS and Webpack boilerplate to help you get started with building your next app.



Dependency Status devDependency Status MIT License Current release

Paypal Patreon buymeacoffee

Minimal Electron, React and Webpack boilerplate

Minimal Electron, React, PostCSS and Webpack boilerplate to help you get started with building your next app.

Table of contents

Install

Clone this repo

git clone https://github.com/alexdevero/electron-react-webpack-boilerplate.git

Install dependencies

npm install

or

yarn

Usage

Run the app

npm run start

or

yarn start

Build the app (automatic)

npm run package

or

yarn package

Build the app (manual)

npm run build

or

yarn build

Test the app (after npm run build || yarn run build)

npm run prod
yarn prod

Add Sass

Adding Sass to boilerplate requires updating webpack configs and adding necessary loaders.

  1. To webpack.build.config.js and webpack.dev.config.js add new object to rules:
{
  test: /\.scss$/,
  use: [
    { loader: 'style-loader' },
    { loader: 'css-loader' },
    { loader: 'sass-loader' }],
  include: defaultInclude
}
  1. Install additional loaders for sass, sass-loader and node-sass.

  2. Rename all CSS file to .scss.

Add TailwindCSS

If you don't want to do all these steps, you can clone This Repository and you are good to go.

Adding TainwindCSS to boilerplate requires adding all the dependencies listed on the tailwindcss website for create react app Official Guide. OR follow these steps

  1. install tailwindcss, postcss and autoprefixer.
npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
  1. Install craco.
npm install @craco/craco
  1. Open package.json file, find start and build scripts under scripts.

  2. Add && craco start at the end in start and build scripts. You also have to add build-css script to build the CSS styles using tailwindCSS. "build-css": "npx tailwindcss build -o src/styles/main.css",. You can choose output folder of your own choice. Here are the three scripts after changing/adding.

"start": "cross-env NODE_ENV=development webpack serve --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development && craco start",
    "build": "cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production && craco build",
"build-css": "npx tailwindcss build  -o src/styles/main.css",
  1. Now, create craco.config.js file in your project at root of your project and add the following.
module.exports = {
  style: {
    postcss: {
      plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
      ],
    },
  },
}
  1. Next, generate your tailwind.config.js file:
npx tailwindcss-cli@latest init

This will create a minimal tailwind.config.js file at the root of your project.

  1. (Optional) Configure Tailwind to remove unused styles in production In your tailwind.config.js file, configure the purge option with the paths to all of your components so Tailwind can tree-shake unused styles in production builds:
  // tailwind.config.js
  module.exports = {
   purge: [],
   purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
    darkMode: false, // or 'media' or 'class'
    theme: {
      extend: {},
    },
    variants: {
      extend: {},
    },
    plugins: [],
  }
  1. Add main.css file in app.js. Make sure you choose correct path for CSS file.
import '../styles/main.css' 
  1. You may have to run npm install tailwindcss@latest postcss@latest autoprefixer@latest if you face different version issues.
  2. You can also check JIT Mode In TailwindCSS if you want to use Just In Time Mode.

Change app title

This boilerplate uses HTML Webpack Plugin to generate the HTML file of the app. Changing app title is possible only through webpack configs, webpack.build.config.js and webpack.dev.config.js. App title can be changed by adding objects of options.

In webpack.build.config.js:

plugins: [
  new HtmlWebpackPlugin({title: 'New app title '}),// Add this (line 41)
  new MiniCssExtractPlugin({
    // Options similar to the same options in webpackOptions.output
    // both options are optional
    filename: 'bundle.css',
    chunkFilename: '[id].css'
  }),
  new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('production')
  }),
  new BabiliPlugin()
],

In webpack.dev.config.js:

plugins: [
  new HtmlWebpackPlugin({title: 'New app title '}),// Add this (line 36)
  new webpack.DefinePlugin({
    'process.env.NODE_ENV': JSON.stringify('development')
  })
],

Contact and Support

I want your feedback! Here's a list of different ways to me and request help:

If you feel generous and want to show some extra appreciation:

Buy me a coffee

Code of Conduct

Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

MIT © Alex Devero.

More Repositories

1

instatron

A simple Instagram desktop uploader & client app build with electron.Mobile Instagram on desktop!
JavaScript
96
star
2

react-mobx-react-router-boilerplate

React, React-Router, MobX, MobX-Router and Webpack (heroku-ready) boilerplate with async routes.
JavaScript
51
star
3

bookshelf-react-express-sqlite-app

App for collecting books built with React, Express and SQLite.
TypeScript
50
star
4

react-hooks-todo-list-app-ts

Simple Todo list app built with React hooks and TypeScript.
TypeScript
30
star
5

grease-the-groove-app

Electron app to help you practice Grease the Groove method to achieve your goals and get stronger 💪!
TypeScript
12
star
6

CSS-sliding-multi-level-accordion

CSS sliding multi-level accordion
HTML
12
star
7

edabit-challenges

Solutions for challenges on edabit.com.
JavaScript
12
star
8

zentime-meditation-web-app

Simple meditation timer web app built with React.js and mobX.
JavaScript
10
star
9

React-Image-Gallery-blog-tutorial

Repository for How to Learn React and Create Stunning Image Gallery tutorial
JavaScript
10
star
10

docker-nestjs-react-postgres

Starter app build with Nest.js, React, PostgreSQL and Docker
TypeScript
9
star
11

password-generator-app

Awesome Password generator app, built with Electron and React.
JavaScript
9
star
12

react-postcss-parcel-boilerplate

Minimal React, PostCSS and Parcel Bundler app boilerplate.
HTML
7
star
13

react-express-app

Awesome and super-simple app with React front-end and Express back-end.
JavaScript
7
star
14

front-end-dojo

Library full of useful CSS, JS and Sass functions, mixins and utilities.
SCSS
6
star
15

ai-artist

AI for create paintings from images.
JavaScript
6
star
16

udacity-desktop-app

A simple Udacity desktop app build with electron.
JavaScript
5
star
17

React-Flipping-Card-Tutorial

Learn How to Quickly Create Simple React Flipping Card tutorial on [Alex Devero Blog](http://blog.alexdevero.com/).
CSS
5
star
18

rss-finder-web-app

Web app to help you find URLs for existing RSS feeds from website URLs.
TypeScript
5
star
19

leet-speak-converter

A simple utility to convert text into leet speak.
JavaScript
5
star
20

Masonry-gallery

Source code for Masonry gallery tutorial on blog.alexdevero.com
HTML
5
star
21

lazyload-vanilla-plugin

Lazyload plugin for images written in pure JavaScript that doesn't require jQuery.
JavaScript
4
star
22

ethercss

The only CSS framework you will ever need.
SCSS
4
star
23

franz-instagram-recipe

A Franz recipe for Instagram service.
JavaScript
3
star
24

electron-react-typescript-boilerplate

Simple, minimal and powerful boilerplate app built with Electron, React and TypeScript.
TypeScript
3
star
25

Flipping-form

Flipping form: Form fipping between login and signup states
CSS
3
star
26

x

App built with Electron, React, styled-components and Webpack.
JavaScript
3
star
27

magnet-link-generator

Tool that helps you generate magnet links for torrents from hashes.
JavaScript
3
star
28

electron-react-mobx-boilerplate

A simple boilerplate for building apps with Electron, React, MobX and Webpack
JavaScript
3
star
29

qr-code-generator

A minimal QR code generator app.
CSS
3
star
30

react-meme-generator-ts

Meme generator web app built with React
TypeScript
3
star
31

alex-devero-web-react

Repository for my website alexdevero.com based on react-create-app.
CSS
2
star
32

fullstack-nextjs-graphql-prisma-app

Full-stack app built with Next.js, GraphQL and Prisma
TypeScript
2
star
33

nestjs-api-demo

Demo of API built with Nest.js framework
TypeScript
2
star
34

franz-producthunt-recipe

Franz recipe for Product Hunt service.
JavaScript
2
star
35

django-react-tic-tac-toe

Tic Tac Toe game built with React and Django framework.
JavaScript
2
star
36

electron-react-typescript-webpack-boilerplate

Minimal Electron, React, TypeScript and Webpack boilerplate to help you get started with building your next awesome app.
JavaScript
2
star
37

budget-app-ts

Minimal budget app built with React & TypeScript.
TypeScript
2
star
38

express-api-starter

A simple Express API starter template for medium-to-large sized Express apps.
JavaScript
2
star
39

hiit-timer-app

A minimal HIIT timer app.
TypeScript
1
star
40

trainerlog-web-app

💪 The only app you need to keep track of you training progress and statistics.
TypeScript
1
star
41

css-prefixer-app

Small desktop app to help you prefix your CSS.
TypeScript
1
star
42

js-website-crawler

Website crawler written in JavaScript.
JavaScript
1
star
43

linked-list-in-js-ts

Simple implementation of linked list structure in JavaScript (TypeScript).
TypeScript
1
star
44

ai-evolving-fish-intelligence

AI experiment with evolving fish intelligence.
HTML
1
star
45

numeronym-converter

A simple tool for generating numeronyms.
JavaScript
1
star
46

tabata-timer

Tabata timer app built with electron.
TypeScript
1
star
47

rep-max-calculator

Simple tool to calculate your Rep Max for given weight and number of reps.
TypeScript
1
star
48

vercel-serverless-edge-middleware-demo

Demo of Vercel serverless middleware functions
TypeScript
1
star
49

quotist

Get a random quote right inside your CLI.
JavaScript
1
star
50

poc-az-quotes-crawler-api

POC: AZ Quotes crawler api
TypeScript
1
star
51

Apple-TV-Parallax-Effect

Apple TV Parallax Effect
CSS
1
star
52

Card-design-with-Bootstrap-4

Code for card design with Bootstrap 4 tutorial
HTML
1
star
53

file-transformers

Simple tools for transforming files and their content.
TypeScript
1
star
54

devero-studio-website

Repository for DEVERO Studio website.
TypeScript
1
star
55

react-typescript-styled-components-boilerplate

Ultra-light React + TypeScript + styled-components boilerplate to help you get started 🚀!
HTML
1
star
56

linked-list-with-swapping-in-js-ts

Simple implementation of linked list structure with swapping in JavaScript (TypeScript).
TypeScript
1
star
57

react-firebase-web-app

Web app built with React and Firebase API.
TypeScript
1
star
58

digitoo-fullstack-task

Repository for fullstack task for Digitoo.
TypeScript
1
star
59

react-usetransition-demo

Simple React useTransition hook demo
TypeScript
1
star
60

templates-documentation

Default documentation for my templates and themes on creativemarket.
HTML
1
star
61

Universal-responsive-JavaScript-slider-tutorial

Universal responsive JavaScript slider tutorial
JavaScript
1
star
62

electron-text-to-speech-reader

A minimal electron text-to-speech reader app.
CSS
1
star
63

awesome-colors

Awesome colors from around the web for your inspiration.
1
star
64

alex-devero-website

Repo for my website on www.alexdevero.com
Handlebars
1
star
65

tweeterize-web-app

Web app for formatting long texts into tweet-sized messages you can share.
TypeScript
1
star
66

nextjs-express-app

Starting template built with React, Next.js and express.
JavaScript
1
star
67

express-firebase-app

Simple Express + Firebase rest API built just for fun
TypeScript
1
star
68

devero-io

Repository for DEVERO Corporation website.
TypeScript
1
star
69

franz-reddit-recipe

A Franz recipe for Reddit service.
JavaScript
1
star
70

dummy-website-generator-with-server

Dummy website generator with simple Node.js server
TypeScript
1
star
71

vercel-serverless-user-agent-based-rendering

This is a demo of Vercel serverless user-agent-based rendering.
TypeScript
1
star
72

.github

1
star
73

khan-academy-desktop-app

A simple Khan Academy desktop app build with electron.
JavaScript
1
star
74

doubly-linked-list-in-js-ts

Simple implementation of doubly linked list structure in JavaScript (TypeScript).
TypeScript
1
star
75

docker-react-example

Starter React app in Docker
TypeScript
1
star
76

mental-models-pwa

Learn about all mental models and have them always with you 🧠.
TypeScript
1
star
77

express-react-webapp-boilerplate

Minimal Express, React and Webpack webapp boilerplate.
JavaScript
1
star
78

nestjs-graphql-playground-movies

Backend playground built with Nest.js and GraphQL.
TypeScript
1
star
79

react-tetris-ts

Tetris game built with React and Typescript 🕹.
TypeScript
1
star
80

mvp-landing-page-template-react

Awesome landing page template to help you test your MVP.
TypeScript
1
star
81

react-native-expo-starter

Awesome starter template to help you build mobile app with React native and Expo. 📱
JavaScript
1
star