Get a development environment and project scaffold set up in a jiffy.
First install node and npm. There are instructions here:
http://blog.nodeknockout.com/post/65463770933/how-to-install-node-js-and-npm
Install git too:
https://help.github.com/articles/set-up-git/
Then install Yeoman. Yeoman is a useful tool for generating project scaffolding:
http://yeoman.io/codelab/setup.html
Finally, make sure you have a text editor installed. If you don't have a preference, try Atom. It is cross-platform, and has good support for JavaScript:
Find a yeoman generator appropriate for you project from:
Here are some suggestions:
- for Angular apps: generator-angular
- for React apps: generator-react-webpack
- for Node apps: generator-node
The README for each generator provides some instructions on how to use it.
Install your chosen generator. For example, if you picked 'generator-react-webpack':
$ npm install --global generator-react-webpack
(You might need to use sudo
with that command.)
Create a project directory, cd into it, and run the generator:
$ mkdir my-project
$ cd my-project
$ yo react-webpack my-project
To start a local web server for testing your project run:
$ grunt serve
While that command is running, it will watch your code for changes, and automatically rebuild.
You can view your project in a browser by navigating to:
The source for your project will be in src/
. When you open http://localhost:8000, what you see will be src/index.html
.
If you used the 'react-webpack' generator, then the main code for your application will be in src/scripts/components/main.js
and in src/scripts/components/MyProjectApp.js
.