• Stars
    star
    9,751
  • Rank 3,624 (Top 0.08 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 1 year ago

Reviews

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

Repository Details

React + Redux starter kit / boilerplate with Babel, hot reloading, testing, linting and a working example app built in


Build status: Linux Build status: Windows Dependency Status Coverage Status

A comprehensive starter kit for rapid application development using React.

Why Slingshot?

  1. One command to get started - Type npm start to start development in your default browser.
  2. Rapid feedback - Each time you hit save, changes hot reload and linting and automated tests run.
  3. One command line to check - All feedback is displayed on a single command line.
  4. No more JavaScript fatigue - Slingshot uses the most popular and powerful libraries for working with React.
  5. Working example app - The included example app shows how this all works together.
  6. Automated production build - Type npm run build to do all this:

React Slingshot Production Build

Get Started

  1. Initial Machine Setup

    First time running the starter kit? Then complete the Initial Machine Setup.

  2. Click "Use this template"

    Click the green "Use this template" button at the top of this page and enter a name and description for your repo.

  3. Run the setup script

    npm run setup

  4. Run the example app

    npm start -s

    This will run the automated build process, start up a webserver, and open the application in your default browser. When doing development with this kit, this command will continue watching all your files. Every time you hit save the code is rebuilt, linting runs, and tests run automatically. Note: The -s flag is optional. It enables silent mode which suppresses unnecessary messages during the build.

  5. Review the example app.

    This starter kit includes a working example app that calculates fuel savings. Note how all source code is placed under /src. Tests are placed alongside the file under test. The final built app is placed under /dist. These are the files you run in production.

  6. Delete the example app files.

    Once you're comfortable with how the example app works, you can delete those files and begin creating your own app.

  7. Having issues? See Having Issues?.

Initial Machine Setup

  1. Install Node 8.0.0 or greater

    Need to run multiple versions of Node? Use nvm.

  2. Install Git.

  3. Disable safe write in your editor to assure hot reloading works properly.

  4. Complete the steps below for your operating system:

    macOS

    • Install watchman via brew install watchman or fswatch via brew install fswatch to avoid this issue which occurs if your macOS has no appropriate file watching service installed.

    Linux

    • Run this to increase the limit on the number of files Linux will watch. Here's why.

      echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p.

    Windows

    • Install Python 2.7. Some node modules may rely on node-gyp, which requires Python on Windows.

    • Install C++ Compiler. Browser-sync requires a C++ compiler on Windows.

      Visual Studio Express comes bundled with a free C++ compiler.

      If you already have Visual Studio installed: Open Visual Studio and go to File -> New -> Project -> Visual C++ -> Install Visual C++ Tools for Windows Desktop. The C++ compiler is used to compile browser-sync (and perhaps other Node modules).


Having Issues? Try these things first

  1. Make sure you ran all steps in Get started including the initial machine setup.

  2. Run npm install - If you forget to do this, you'll see this: babel-node: command not found.

  3. Install the latest version of Node.

  4. Make sure files with names that begin with a dot (.editorconfig, .gitignore, .npmrc) are copied to the project directory root. This is easy to overlook if you copy this repository manually.

  5. Don't run the project from a symbolic link. It may cause issues with file watches.

  6. Delete any .eslintrc that you're storing in your user directory. Also, disable any ESLint plugin / custom rules that you've enabled within your editor. These will conflict with the ESLint rules defined in this project.

  7. Make sure you don't have NODE_ENV set to production on your machine. If you do then the development dependencies won't be installed. Here's how to check.

  8. Install watchman with brew install watchman if you are having the following error after an initial npm start -s:

    2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    2017-09-05 00:44 node[68587] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
    events.js:160
          throw er; // Unhandled 'error' event
          ^
    
    Error: Error watching file for changes: EMFILE
        at exports._errnoException (util.js:1022:11)
        at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)
  9. Tip: Things to check if you get an npm run lint error or build error:

    • If ESW found an error or warning in your project (e.g. console statement or a missing semi-colon), the lint thread will exit with Exit status 1. To fix:

      1. Change the npm run lint script to "esw webpack.config.* src tools; exit 0"
      2. Change the npm run lint:watch script to "esw webpack.config.* src tools --watch; exit 0"

      Note: Adding exit 0 will allow the npm scripts to ignore the status 1 and allow ESW to print all warnings and errors.

    • Ensure the eslint/esw globally installed version matches the version used in the project. This will ensure the esw keyword is resolved.

  10. Rebuild node-sass with npm rebuild node-sass if you are having and error like Node Sass does not yet support your current environment on macOS XXX after an initial npm start -s.


Technologies

Slingshot offers a rich development experience using the following technologies:

Tech Description Learn More
React Fast, composable client-side components. Pluralsight Course
Redux Enforces unidirectional data flows and immutable, hot reloadable store. Supports time-travel debugging. Lean alternative to Facebook's Flux. Getting Started with Redux, Building React Applications with Idiomatic Redux, Pluralsight Course
React Router A complete routing library for React Pluralsight Course
Babel Compiles ES6 to ES5. Enjoy the new version of JavaScript today. ES6 REPL, ES6 vs ES5, ES6 Katas, Pluralsight course
Webpack Bundles npm packages and our JS into a single file. Includes hot reloading via react-transform-hmr. Quick Webpack How-to Pluralsight Course
Browsersync Lightweight development HTTP server that supports synchronized testing and debugging on multiple devices. Intro vid
Jest Automated tests with built-in expect assertions and Enzyme for DOM testing without a browser using Node. Pluralsight Course
TrackJS JavaScript error tracking. Free trial
ESLint Lint JS. Reports syntax and style issues. Using eslint-plugin-react for additional React specific linting rules.
SASS Compiled CSS styles with variables, functions, and more. Pluralsight Course
PostCSS Transform styles with JS plugins. Used to autoprefix CSS
Editor Config Enforce consistent editor settings (spaces vs tabs, etc). IDE Plugins
npm Scripts Glues all this together in a handy automated build. Pluralsight course, Why not Gulp?

The starter kit includes a working example app that puts all of the above to use.


Questions?

Check out the FAQ

More Repositories

1

pluralsight-redux-starter

Completed Dev Environment for "Building Applications with React and Redux" on Pluralsight
JavaScript
1,285
star
2

speaker-starter-kit

Resources for aspiring speakers
797
star
3

react-flux-starter-kit

Quickly get started with React and Flux using Browserify and Gulp
JavaScript
684
star
4

reactjsconsulting

React Related Resources
JavaScript
323
star
5

javascript-development-environment

JavaScript development environment discussed in "Building a JavaScript Development Environment" on Pluralsight
JavaScript
298
star
6

a11y

Repository on accessibility
HTML
281
star
7

timeless-skills

These are the timeless skills I wish I’d learned in school, and the resources I recommend to learn them.
277
star
8

react-switchboard

Quickly create custom DevTools for your React app
TypeScript
239
star
9

ps-react

Reusable React components built in "Creating Reusable React Components" on Pluralsight
JavaScript
136
star
10

switchboard-with-vite-demo

Demo: react-switchboard with Vite
TypeScript
133
star
11

mock-api-example

Example Mock API for rapid development
JavaScript
122
star
12

graphql

Resources for learning GraphQL.
111
star
13

react-state-demo

This app showcases eight ways to handle React state.
JavaScript
75
star
14

7-pillar-developer

7 Pillar Developer Talk Repo
59
star
15

react-flux-building-applications

Final version of demo app for React and Flux course on Pluralsight
JavaScript
57
star
16

react-tour-of-heroes

Implementation of Angular 2's "Tour of Heroes" Tutorial in React
JavaScript
54
star
17

ama

Ask me anything.
40
star
18

shell

Module Federation demo
TypeScript
32
star
19

dynamic-import-example

Showcase using ES dynamic imports in create-react-app
JavaScript
31
star
20

devup-2017

Repository for "Build a JS Dev Environment in 1 Hour" at DevUp 2017
JavaScript
27
star
21

testing-react

Testing Demo App
JavaScript
21
star
22

get-started-in-programming

Resources for people just getting started in programming
19
star
23

outlierdeveloper

OutlierDeveloper.com
19
star
24

js-dev-env-demo

Course demo
JavaScript
17
star
25

react-auth0-final

The final app used to record the course
JavaScript
16
star
26

fluent2017

JavaScript Development Environment for Fluent 2017
JavaScript
15
star
27

js-dev-env-demo-api

API for JS Dev Env Demo in Pluralsight course
JavaScript
13
star
28

react-umd-example

Example of consuming a UMD React component
JavaScript
12
star
29

vite-project

A reference project for using Vite and Vitest with React
TypeScript
12
star
30

clean-coding-principles-c-sharp

Demo for "Clean Coding Principles in C#" on Pluralsight
C#
11
star
31

pluralsight-reusable-react-components

WIP for scripting demo
JavaScript
8
star
32

farfetch

8
star
33

mock-data-pattern

Example of centralized mock data pattern for React apps
JavaScript
8
star
34

pro-javascript-bootcamp

Pro JavaScript Bootcamp
JavaScript
7
star
35

angular-2-tour-of-heroes

Implementation of Angular 2's "Tour of Heroes" Tutorial
JavaScript
7
star
36

pluralsight-reusable-components-cra

Building reusable components with create-react-app as foundation
JavaScript
7
star
37

fluent2016

"React and Flux from Scratch" - Tutorial for Fluent 2016 in San Francisco
JavaScript
6
star
38

isomorphic-demos

List of Isomorphic Demos I've found across the web
6
star
39

react-typescript-starter-kit

Simple starter kit that shows how TypeScript and React can work together
JavaScript
6
star
40

CleanCodePresentation

Clean Code Presentation Example Application
JavaScript
6
star
41

typescript-react

Kicking the tires on TypeScript with React
TypeScript
6
star
42

fluent2016complete

The completed Fluent2016 Demo at https://github.com/coryhouse/fluent2016
JavaScript
6
star
43

create-react-library

Create a React component library project via a configurable command line
5
star
44

skillpath-react

React training at Skillpath
JavaScript
5
star
45

react-state-managing

Repo for Managing React State on Pluralsight
JavaScript
5
star
46

everlaw-shoes

TypeScript
5
star
47

pluralsight-clean-code-demo

C#
5
star
48

js-async-patterns

Examples of Async patterns in JS
JavaScript
5
star
49

acutrack-react

JavaScript
5
star
50

my-component

React component created by nwb
JavaScript
4
star
51

js-blurb

Short blurb on JS
4
star
52

vite-pwa-app

Vite app using vite-pwa plugin to notify upon deployment
MDX
3
star
53

mobx

MobX Demo
JavaScript
3
star
54

repo-template

A repo template with the key pieces included
3
star
55

react-flux

JavaScript
3
star
56

americo-react

TypeScript
3
star
57

react-third-party-state

Compares React third party state libraries
TypeScript
2
star
58

taxslayer

JavaScript
2
star
59

nextjs-13-demo

TypeScript
2
star
60

paycor

JavaScript
2
star
61

vercel-pluralsight-demo

Demo of hosting Next.js on Vercel
JavaScript
2
star
62

charleston-digital-hub

Course management app
JavaScript
2
star
63

eboss

JavaScript
2
star
64

malle-sept

JavaScript
2
star
65

html5-web-components

Repo for HTML5 Web Component Fundamentals on Pluralsight
2
star
66

xstate-demo

Xstate with React demo
TypeScript
2
star
67

DependencyInjectionExample

Dependency Injection example
JavaScript
2
star
68

athena-watertown

React app
JavaScript
2
star
69

managing-react-state-kcdc-2021

Demo code for "Managing React State: 7 Years of Lessons Learned" at KCDC 2021
JavaScript
2
star
70

react-state-options

Contrast React state options
2
star
71

react-rendering-service

Returns HTML of React component via webservice
JavaScript
2
star
72

trpc-demo

TypeScript
2
star
73

remix-jokes

Remix jokes tutorial
TypeScript
2
star
74

advanced-react-starter

Starter project for advanced React
JavaScript
2
star
75

babel-node

Shows how babel-node throws an error when you hit ctrl+c instead of exiting clean
JavaScript
2
star
76

shell-monorepo-poc

TypeScript
2
star
77

fds-theming

TypeScript
2
star
78

kcdc24

2
star
79

swa-react

JavaScript
1
star
80

percy-demo

Demo of using Percy for automated image-based testing
JavaScript
1
star
81

kcdc2019-react

React Precompiler
JavaScript
1
star
82

react-monorepo

A monorepo supporting multiple teams contributing separate pieces of a large React app
1
star
83

oclc-react-restaurant

TypeScript
1
star
84

e-gineering

React workshop for e-gineering
TypeScript
1
star
85

storybook-css-bug

JavaScript
1
star
86

akin-gump

JavaScript
1
star
87

ps-dev-env-script

Use to create script from ground up
JavaScript
1
star
88

slingshot-fork

JavaScript
1
star
89

everkicks

Shoe store for Everlaw React training
JavaScript
1
star
90

reactjsconsulting.com

reactjsconsulting.com Source Code
JavaScript
1
star
91

remote-2

Shell tech demo remote app 2
TypeScript
1
star
92

tideworks

JavaScript
1
star
93

react-via-cdn

Simple example of using React via a CDN
HTML
1
star
94

crap-okta-from-scratch

Connect create-react-app app to OKTA from scratch
JavaScript
1
star
95

Helmes

React and JavaScript consulting
JavaScript
1
star
96

hallmark

eCards App
JavaScript
1
star
97

next-trpc-demo

Demo of using tRPC with Next.js
TypeScript
1
star
98

kiewit-react

JavaScript
1
star
99

oberhaching-react

Library app
TypeScript
1
star
100

react-restaurant-assets

Assets for a restaurant app built in React
TypeScript
1
star