/custom-meanScaffolding

A customized MEAN application scaffolding

Primary LanguageJavaScriptMIT LicenseMIT

MEAN Stack Scaffolding with AngularJS phone-cat sample code

This project is a scaffolding for a slimmed down MEAN MongoDB, Node.js, Express, and AngularJS based application.

This was made as a slimmed down version of the MEAN.io boilerplate (GitHub - MEAN.io), but trimming down the server side and client side code to more closely mimic that of the angular-phonecat tutorial at AngularJS.org.

This was made as an easy way to understand how all components of the MEAN stack fit together, and to also server as a starting point for branching and creating a new MEAN stack web application.

Prerequisites

####(assuming you're starting from a clean machine)

  • Node.js / NPM - Download and Install Node.js. You can also follow this gist for a quick and easy way to install Node.js and npm
  • MongoDB - Download and Install MongoDB - Make sure mongod is running on the default port (27017). Also, create a folder in the root directory (C:\ in windows), called \data\db (C:\data\db).
  • GIT - Download, Install, and Configure Git

Tools Prerequisites (all easily installed via npm!)

  • Bower - Web package manager.
$ npm install -g bower
  • nodemon - Code and file reloader.
$ npm install -g nodemon
  • Grunt - JavaScript Task Runner - Built with Grunt
$ npm install -g grunt
$ npm install -g grunt-cli

Additional Packages Utilized

  • Express - Defined as npm module in the package.json file.
  • Mongoose - Defined as npm module in the package.json file.
  • AngularJS - Defined as bower module in the bower.json file.
  • Twitter Bootstrap - Defined as bower module in the bower.json file.
  • UI Bootstrap - Defined as bower module in the bower.json file.

Getting Started After Pre-requisites

Clone this repository into your directory via git and download dependencies

$ [sudo] git clone [url] <dirName>

$ cd $ npm install $ bower install

Now, you'll need to run a script to insert mock data into your MongoDB instance. Open up a command line and go to the MongoDB directory (or have the directory in your PATH variable), and run the following command:

$ mongo "fullPath\scripts\insertMockMongoData.js"

You should now have all required packages installed in your directory. Simply start the server with the Grunt command:

$ grunt

If grunt aborts due to JSHINT or CSSHINT errors, these can be overridden with the force flag:

$ grunt --force

Once running, simply open a browser and go to:

http://localhost:3000

License

The MIT License