#description: E-com_merc.e platform using node, angular mongodb #deployed via heroku at https://tekrect.herokuapp.com/
You need Node 0.12 in your system. Verify if you already have it with node -v
. If not or a different version, you can use Node Version Manager (nvm) to install it:
curl https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | bash
source ~/.nvm/nvm.sh
nvm install 0.12
nvm use 0.12
# Yeaoman
npm install -g yo
# Angular fullstack generators
npm install -g [email protected]
# Grunt CLI
npm install -g grunt-cli
# Bower
npm install -g bower
You need to have ruby in your system. Mac OS X and Linux ship with Ruby, verify by typing ruby -v
. Then install the sass gem (library).
gem install sass
- Mac:
brew install mongodb 3.0.2
- Ubuntu:
sudo apt-get -y install mongodb=3.0.2
You can either build the project from scratch following the instructions on the book's chapter 1 or get the source code.
cd meanshop
npm install
bower install
Depending on the OS, there are some subtle differences.
If you don't have enough permissions consider using: sudo npm install
vs npm install
Allows running commands as root: bower install --allow-root
Detailed MongoDB installation on Ubuntu:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org=3.0.2 mongodb-org-server=3.0.2 mongodb-org-shell=3.0.2 mongodb-org-mongos=3.0.2 mongodb-org-tools=3.0.2
By default when you checkout, you get the master
branch which is the latests version of the app. For your convenience, you can also checkout chapter's code with the following commands (inside the project directory):
# checking out chapter 1
git checkout ch1
# checking out chapter 7
git checkout ch1
# checking out the latest
git checkout master
- run server (dev mode):
grunt serve
- run server (production mode):
grunt serve:dist
- run tests:
grunt test
- run e2e tests:
grunt test:e2e
- compile assets:
grunt build
For any question, ideas for improvement use email me.
If you have ideas to make this app better (and you should! 😉) you can contribute your features using the following instructions:
- Fork it clicking the fork button on the top right corner of this page.
- Create your feature branch:
git checkout -b my-new-feature
. - Commit your changes:
git add . && git commit -m 'Add some feature'
. - Push to the branch:
git push origin my-new-feature
- Come to this page and it will show up "create pull request" option.
- Submit your pull request and add some info about your changes. Include screenshots and animated GIFs in your pull request whenever possible.
Heroku requires installing a command-line program called heroku-toolbelt. Follow the instructions on https://toolbelt.heroku.com to install it. Also, create an account in Heroku if haven't yet.
Deploy commands:
# Build for production
grunt build
# Use angular generator to deploy
yo angular-fullstack:heroku
# Add MongoDB to heroku deployment
cd dist && heroku addons:create mongolab:sandbox
# Set environment to production
heroku config:set NODE_ENV=production
# Add all 3rd party credentials .e.g.:
$ heroku config:set FACEBOOK_ID=appId FACEBOOK_SECRET=secret
# See deployed app
heroku open
You can visualize all the set variables with
heroku config
.
Any other update can be refreshed on Heroku by typing the following command:
grunt buildcontrol:heroku
.
Find my contact info at [email protected]