• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 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

Create React + Redux app structure with build configurations โœจ

Create React Redux App Structure Twitter URL

MIT Licence codecov Build Status npm version

Create React + Redux app structure with build configurations.

What can I find here?

  • Express, Cors
  • React + Redux, ES6, async/await
  • Web Components (Custom Elements) integration
  • React Router
  • Internationalization
  • SASS
  • PostCSS (autoprefixer), so you do not need -webkit, -moz or other prefixes
  • Build script configuration Development, Staging, Production with CDN, cache-busting support
  • Build script to bundle JS, CSS, with sourcemaps
  • Unit tests Jest, Enzyme
  • E2E Cypress tests
  • ESLint
  • Ghooks (pre-commit with unit tests and eslint validation)
  • Code Coverage (https://codecov.io)
  • Travis CI runs Unit and E2E tests and report to codecov

Quick Start

Create React + Redux app structure works on macOS, Windows, and Linux. If something doesnโ€™t work, please file an issue.

npm

npm i -g create-react-redux-app-structure

yarn

yarn add global create-react-redux-app-structure

create-react-redux-app-structure my-app
cd my-app/
npm run fast-start

http://localhost:8080/ will be opened automatically.

When you are ready to deploy to staging/production please see Build Scripts section.

Getting Started

You will need to have Node >= 6 on your local development machine and Yarn installed.

Install it once globally:

npm

npm i -g create-react-redux-app-structure

yarn

yarn add global create-react-redux-app-structure

Patience, please. It takes time, most of it is spent installing npm packages.

Creating an App

To create a new app, run:

create-react-redux-app-structure my-app
cd my-app/

It will create a directory called my-app inside the current folder.

Prepare config.json for build configurations

For running builds you need to have config.json in app/ folder. So you can create new one or rename app/config.json.example.

Inside that file:

  • PATHS is used in Grunt and Gulp tasks
  • assetHost CDN path for each build
  • serverHost is used for running e2e Cypress tests

Installation

npm install or yarn install

You can run npm run fast-start script, it will install all npm packages, run dev build, server and open http://localhost:8080/

Run build script

Have a look at Build Scripts section

Run server

node index.js or npm run server

Then open http://localhost:8080/ to see test weather app :)

Build scripts

Development - npm run dev or yarn run dev

Production - npm run prod or yarn run prod

Staging - npm run staging or yarn run staging

Tests

Unit - npm run test or yarn run test

Unit with watch - npm run test:watch or yarn run test:watch

E2E - npm run e2e or yarn run e2e

Coverage is here - app/tests/tests/coverage/Icon-report/index.html

Automation tests

Let's imagine that for automation tests we need to get access to the Redux store. We can do that by adding to the window object property with reference to the store. For e.g. in app.jsx file. Automation tests run only in staging, so for production build we remove them out by Grunt task strip_code

/* staging-code */
window.store = store;
/* end-staging-code */

Tips

Kill all node processes:

  • MacOS sudo killall -9 node
  • Windows (cmd) taskkill /f /im node.exe

Detailed description about features and approaches

Contributing

I would love to have your help.

If you have an idea how to improve or found an issue please read the Contributions Guidelines before submitting a PR. Thanks!

License

MIT ยฉ Vasyl Stokolosa

More Repositories

1

csv-file-validator

๐Ÿ”ง๐Ÿ”ฆ Validation of CSV file against user defined schema (returns back object with data and invalid messages)
JavaScript
91
star
2

file-upload-component

React 16.0/Angular 1.6/Angular 5.0 components for file upload with multiple file selection, preview images, download, file thumbnail
JavaScript
36
star
3

no-internet

๐Ÿ“ก Checking if the internet is accessible in the browser (not local connection only)
JavaScript
35
star
4

SetIntervalJS

โฐ start and clear interval without setting a variable, clear interval anywhere you want
JavaScript
33
star
5

bind-dom

Synchronization between two DOM elements (One-Time, One-Way & Two-Way binding)
JavaScript
24
star
6

publish-subscribe-js

Publish/Subscribe UMD package
JavaScript
21
star
7

custom-event-js

Event dispatcher based on the CustomEvent interface (works on browser)
JavaScript
17
star
8

notification-service-js

๐ŸšฆNotification Service based on Custom Elements
JavaScript
17
star
9

search-bookmarklet

๐Ÿ” Search Bookmarklet
HTML
12
star
10

famulus

JavaScript library that provides useful functional programming helpers. Add your own ๐Ÿ‘
JavaScript
10
star
11

sticky-footer

Sticky Footer CSS and jQuery
HTML
5
star
12

command-pattern-in-web-components

Here you may find Custom Elements with GitHub Jobs API (express and cors)
JavaScript
4
star
13

Gitter_bot

UA WEB CHALLENGE
JavaScript
4
star
14

tetris-game

๐ŸŽฎ Tetris Canvas JavaScript
JavaScript
4
star
15

snake-game

๐Ÿ Snake JavaScript Canvas
JavaScript
4
star
16

shell-sort-algorithm-visualization

๐Ÿ“Š Shell Sorting Algorithm Animations
JavaScript
3
star
17

form-validation

Form Validation
JavaScript
3
star
18

cors-node-server

Public node server with CORS
JavaScript
3
star
19

marlinspike-slot

๐ŸŽฎ Full stack JavaScript application. The game which can display a random outcome generated on the server.
JavaScript
3
star
20

webcomponents-material

Library of reusable Custom elements
2
star
21

Angular-demo-app

AngularJS app
JavaScript
2
star
22

backToTop-button-plugin

BackToTop button
JavaScript
2
star
23

safe-money

Lightweight implementation of Martin Fowlers Money pattern
JavaScript
1
star
24

react-native-android-currency-formatter

React Native Android Currency Formatter. Native Module for a currency format with specified FORMAT locale.
Java
1
star
25

Cossacks-Flutter-App

The app where you can find information about Ukrainian Cossacks and Cities
Dart
1
star