6 |
7 | # React.js Webpack Starter
8 |
9 |
10 | > A React.js starter kit featuring [React.js](https://facebook.github.io/react/) ([JSX](https://facebook.github.io/react/docs/jsx-in-depth.html), [ES6](https://github.com/lukehoban/es6features#readme),
11 | [Babeljs](https://babeljs.io/),
12 | [PostCSS](https://github.com/postcss/postcss),
13 | [ReactHotLoader](https://github.com/gaearon/react-hot-loader), and [Webpack](http://webpack.github.io/)) by [Grégory D'Angelo](https://gdangelo.fr) for [EloquentWebApp](http://eloquentwebapp.com).
14 |
15 | > If you're looking to learn React.js in depth see [The Complete ReactJS Developer Course : Build Modern UI](http://eloquentwebapp.teachable.com/)
16 |
17 | This seed repo serves as a React.js starter for anyone looking to get up and running with React.js fast. Using a [Webpack](http://webpack.github.io/) for building our files and assisting with boilerplate.
18 | * Best practices in file and application organization for React.js.
19 | * Ready to go build system using Webpack and Babel for working with JSX and ES6.
20 | * A great React.js seed repo for anyone who wants to start their project.
21 | * Style with PostCSS
22 | * Tweak React components in real time with React Hot Loader
23 |
24 | ### Quick start
25 | > Clone/Download the repo then edit React components inside [`/src/components`](/src/components)
26 |
27 | ```bash
28 | # clone the repo
29 | git clone https://github.com/gdangelo/react-starter.git
30 |
31 | # change directory
32 | cd react-starter
33 |
34 | # install the dependencies with npm and bower
35 | npm install && bower install
36 |
37 | # start the server
38 | npm start
39 | ```
40 | go to [http://0.0.0.0:3000](http://0.0.0.0:3000) or [http://localhost:3000](http://localhost:3000) in your browser
41 |
42 | # Table of Contents
43 | * [File Structure](#file-structure)
44 | * [Getting Started](#getting-started)
45 | * [Dependencies](#dependencies)
46 | * [Installing](#installing)
47 | * [Running the app](#running-the-app)
48 | * [Support, Questions, or Feedback](#support-questions-or-feedback)
49 |
50 | ## File Structure
51 | We use the component approach in our starter. Each component lives in a single folder with each concern as a file: style and component class. Here's how it looks:
52 | ```
53 | react-starter/
54 | ├──build/ * Folder for compiled output
55 | │
56 | ├──src/ * Source files that will be compiled to javascript
57 | | ├──components/ * React components
58 | │ │ └──variables.scss * Global variables for styles
59 | │ │
60 | │ └──index.js * Entry file for the application
61 | │
62 | ├──tools/ * Build automation scripts and utilities
63 | │ ├──build.js * Builds the project from source to output (build) folder
64 | │ ├──bundle.js * Bundles the web resources into package(s) through Webpack
65 | │ ├──clean.js * Cleans up the output (build) folder
66 | │ ├──run.js * Helper function for running build automation tasks
67 | │ ├──start.js * Launches the development web server with hot reload
68 | │ └──webpack.config.js * Configurations for bundles
69 | │
70 | ├──index.html * The index HTML page that includes the bundle
71 | ├──.babelrc * Babel options file use to specify presets and plugins
72 | ├──package.json * What npm uses to manage it's dependencies
73 | └──bower.json * What bower uses to manage it's dependencies
74 | ```
75 |
76 | # Getting Started
77 | ## Dependencies
78 | What you need to run this app:
79 | * [Node.js](https://nodejs.org/) v5.0 or newer
80 | * `npm` v3.3 or newer (new to [npm](https://docs.npmjs.com/)?)
81 |
82 | ## Installing
83 | * `clone` the repo
84 | * `npm install` to install all npm dependencies
85 | * `bower install` to install all bower dependencies
86 |
87 | ## Running the app
88 | After you have installed all dependencies you can now run the app. Run `npm start` to start a local server using `webpack-dev-server`. The app will be server at `http://0.0.0.0:3000`.
89 |
90 | ## Other commands
91 |
92 | ### build files
93 | ```bash
94 | npm run build
95 | ```
96 |
97 | ### clean build folder
98 | ```bash
99 | npm run clean
100 | ```
101 |
102 | # Support, Questions, or Feedback
103 | > Contact me anytime for anything about this repo or React.js
104 |
105 | * Twitter: [@gdangel0](https://twitter.com/gdangel0)
106 | * Email: gregory@gdangelo.fr
107 | * Codementor: [@gdangelo](https://www.codementor.io/gdangelo)
108 |
109 | ___
110 |
111 | enjoy — Grégory D'Angelo for **EloquentWebApp**
112 |
113 |