All Projects → SzybkiSasza → gdg-react-workshop

SzybkiSasza / gdg-react-workshop

Licence: MIT license
React + Electron + Typescript workshop for GDG DevFest Warsaw 👩‍💻👨‍💻🤖💻

Programming Languages

typescript
32286 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gdg-react-workshop

dotdoodl-kid-classes
Teaching materials for an intro to CSS animations for kids series.
Stars: ✭ 26 (+62.5%)
Mutual labels:  workshop
dat-workshop
How to build web apps using Dat. A workshop by GEUT.
Stars: ✭ 50 (+212.5%)
Mutual labels:  workshop
boss-lite
Boss Lite - React Redux Material Admin Template
Stars: ✭ 148 (+825%)
Mutual labels:  material-ui
react-redux-starter-kit
Get started with React, Redux, Webpack and eslint
Stars: ✭ 29 (+81.25%)
Mutual labels:  material-ui
how-to-build-htmlwidgets
Material - How to build htmlwidgets workshop
Stars: ✭ 35 (+118.75%)
Mutual labels:  workshop
recode-converter
A modern & simple audio converter for video files
Stars: ✭ 22 (+37.5%)
Mutual labels:  material-ui
uno-game
🎴 An UNO Game made in Javascript
Stars: ✭ 93 (+481.25%)
Mutual labels:  material-ui
aura-admin
Aura Admin is the Web App that helps you to mange the Tech Communities like GDGs, DSCs or any other tech communities with Aura
Stars: ✭ 58 (+262.5%)
Mutual labels:  gdg
BestPracticesWorkshop
Repository for the workshop "Best practices on development"
Stars: ✭ 14 (-12.5%)
Mutual labels:  workshop
bubbly
Full stack chat application created w/ Next.js, Socket.IO, Express, React and TypeScript
Stars: ✭ 24 (+50%)
Mutual labels:  material-ui
intro-to-nextjs
💈Workshop for those getting started with Next.js
Stars: ✭ 21 (+31.25%)
Mutual labels:  workshop
material-ui-responsive-drawer
Material-UI responsive Drawer is a React-Redux component that uses Material-UI to create a responsive Drawer.
Stars: ✭ 44 (+175%)
Mutual labels:  material-ui
Modern-Web-App
React PWA with SSR and Code splitting
Stars: ✭ 45 (+181.25%)
Mutual labels:  material-ui
elixir-fire-brigade-workshop
Workshop "Join the Elixir Fire Brigade - Level-up Your Elixir Debugging Skills" (ElixirConf US 2017)
Stars: ✭ 14 (-12.5%)
Mutual labels:  workshop
workshop intro to sql
Reader for the Intro to SQL workshop series.
Stars: ✭ 22 (+37.5%)
Mutual labels:  workshop
podstawy-dl-2019
Materiały z warsztatów z podstaw Deep Learningu dla początkujących. Wiosna 2019.
Stars: ✭ 14 (-12.5%)
Mutual labels:  workshop
File-Explorer
A File Manager with stunning design & astonishing develops, beautifully written in PHP, everything fused in a single file.
Stars: ✭ 31 (+93.75%)
Mutual labels:  material-ui
universal-json-schema
📜 Universal JSON Schema Form - Currently Support for React - Material UI components for building Web forms from JSON Schema.
Stars: ✭ 102 (+537.5%)
Mutual labels:  material-ui
carto-workshop
CARTO training materials
Stars: ✭ 81 (+406.25%)
Mutual labels:  workshop
bounded-disturbances
A k6/.NET red/green load testing workshop
Stars: ✭ 39 (+143.75%)
Mutual labels:  workshop

GDG-React-Workshop

React + Electron + Typescript workshop for GDG DevFest Warsaw 👩‍💻👨‍💻🤖💻

Getting started

In order to work with this repository, you must install:

$ git clone https://github.com/SzybkiSasza/GDG-React-Workshop.git
$ cd GDG-React-Workshop
$ yarn

Toolset

We'll use following tools to build our core app:

  • NodeJS + Yarn
  • React + Jest
  • Material UI
  • Typescript

These tools will be used to build advanced features:

  • Electron
  • Electron-builder
  • Electron-packager
  • Foreman
  • Cross-Env

Goals

  1. Learn the toolset
  2. Understand principles behind basic React App
  3. Understand Create React App behaviour and tradeoffs
  4. Successfully use Typescript with React
  5. Wrap our app in Electron and display as native desktop app (optional - based on available time)
  6. DO NOT eject Create React App in order to have it working with Electron

How does it work?

The configuration is rather complex. It can be split into a few separate parts:

  • Running only React part as a browser app
  • Running desktop in DEV mode/locally
  • Bundling a final desktop app as a standalone installer

Running React app as a standalone browser app

In order to just run a React part of the workshop, you can use yarn start-react script that will use React Scripts (that are part of Create React App) to run the app - it's so simple!

Running React App from Electron with reload capabilities

If you want to see CRA with Electron in action, just run yarn start script. There are a few key events that happen when you run that script (it's handled by the Foreman that reads from Procfile - check out this file!):

  • React Scripts start building app in watch mode (front end part of the app)
  • TypeScript compiler is ran in watch mode in order to prepare main.js file
  • Another TypeScript file is ran in order to bootstrap Electron itself, based on built main.js file

All of these in conjunction allow one to develop desktop app using React almost simultaneously. It allows full hot reloading with one caveat: whenever you change Electron part of the app, the window has to be re-generated (it will re-open once TypeScript compiler prepares new main.js file).

As Electron is essentially just a NodeJS wrapper that renders any arbitrary HTML content in headless browser windows, the ony thing you have to do to render any HTML app in Electron is to provide a correct URL - you can find the code that takes care of it in src/electron/main.ts.

For more details, check out src/electron folder, especially connect-electron.ts file that prepares initial Electron launch based on React app state.

Bundling React App with Electron without ejecting

In order to bundle the React App in Electron, you can run yarn dist script. It performs three steps:

  1. Builds standard React app
  2. Builds Electron part of the code and puts it in build/electron directory
  3. Bundles Electron with built React app as a standalone installer

If the script is ran successfully, it'll create a set of files in dist directory, including app installer - just double-click it in order to have it installed and ran on your system.

Side note on building the app

Currently, the build pipeline supports only Windows. It should be possible to simply modify the build script in order to have it working for Mac/*Nix systems.

Resources

  1. React

  2. Jest

  3. Material UI

  4. Electron

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].