-
[ONCE PER MACHINE/ENVIRONMENT] machine (global / program) installs
- Install git, nodejs, mongodb, and phantomjs
- See other README's (i.e. server-mac.md or server-windows.md or server-linux.md) or just google search for steps on how to do this.
- Configure git (required for pushing and pulling)
git config --global user.name "<your name>"
- i.e. git config --global user.name "Joe Bob"
git config --global user.email "<your email>"
- i.e. git config --global user.email youremail@email.com
git config --global --add color.ui true
- Install global NPM packages.
sudo npm install -g grunt-cli bower yo yuidocjs forever generator-mean-seed less
- NOTE: IF new global npm packages are installed, you'll need to run this again.
- Install Selenium server (for local Protractor tests, if using SauceLabs or another remote server, this can be skipped. Also NOTE this must be done AFTER
npm install
below since it requires Protractor first)./node_modules/protractor/bin/webdriver-manager update
- Install git, nodejs, mongodb, and phantomjs
-
Create a new directory where you want your app to be and then navigate to it (with
cd
) and run yeoman generator withyo mean-seed
- NOTE: if you're cloning / copying an EXISTING code repository, see cloning.md instead!
- You can skip the prompts if you want by using a JSON config file. To do so, create a
yo-configs
folder and add a JSON file to it with the answers to the prompts (see or copy a file in theyo-configs
folder from here for reference: https://github.com/jackrabbitsgroup/generator-mean-seed ).- To copy from the global generator-mean-seed install (and edit on command line - i.e. with
sudo vi default.json
) usecp [path to generator-mean-seed]/yo-configs/default.json yo-configs/default.json
and then edit is as needed. - To edit locally and then copy remotely to your server use
scp default.json [user]@[remote host ip/domain]:/[path to new app]/yo-configs/default.json
- To copy from the global generator-mean-seed install (and edit on command line - i.e. with
-
Install nodejs and bower dependencies using
npm
andbower
. This only needs to be done once initially, but must be re-run every time package.json is updated. When in doubt, runnpm install && bower install
from your project root since you can't run it too much (if you run it extra times it won't do anything).
cd /path/to/project
npm install && bower install
1. NOTE: Sometimes some bower packages timeout; just re-run `bower update && bower install` until it works (typically should work first or second time). You can also try `bower cache clean` and or `bower uninstall [package name]`.
2. NOTE: If npm errors (can use `npm list` to see if all dependencies were installed correctly), run `npm cache clean` (and optionally delete the troublesome package folders from the `node_modules` folder) then re-run `npm install`
3. NOTE: If you get an EACCESS error on `npm install`, try it with `sudo` in front..
4. NOTE: If you are on Windows and get a bson error (or any errors, for that matter), try it with Cygwin. Sometimes it doesn't work on Git Bash, but it will on Cygwin due to permissions issues. See http://stackoverflow.com/questions/14100027/cant-install-js-bson for more information.
- [OPTIONAL] Use a different / non-default config.json file
- All the config.json files for ALL environments should be in version control in the
app/configs
folder. To determine which file is used, theconfig_environment.json
file is checked and IF it exists AND theenvironment
key exists, that environment will be used. The naming conventions are:config-[your environment].json
for the config (i.e.config-triggerio.json
) andconfig-[your environment].test.json
for the accompanying test config (for running tests, which should run on a DIFFERENT, dummy database as it will be wiped clean each time!). So if you want to use the non-default environment, do the steps below: - FYI, the config.json file is used in the following files:
- Gruntfile.js
- run.js
- app/test/apiTestHelpers.js
- More info on configs: see configs.md
- All the config.json files for ALL environments should be in version control in the
# cd to root project directory
cd /path/to/project
# copy the config_environment.json file and set the `environment` key to your new environment.
cp app/config_environment.json config_environment.json
# Copy then EDIT your new config file
cp app/config.json app/config-[your environment].json
# Copy then EDIT your new config file for its test configuration (for backend tests)
cp app/config-[your environment].json app/config-[your environment].test.json
# Update your new, copied test config for the test environment - specifically, change 'db.database' and 'session.store.db' to a different testing database, such as 'test_temp'. Also, optionally, change the `server.port` so that way both the test server and the non-test server can run at the same time.
-
[OPTIONAL] Git add remote (should have already been git init'ed and commit'ed automatically)
- (optional) add a remote:
git remote add origin [url to repository]
- (optional) add a remote:
-
optional additional steps: see extra-setup.md
- see running.md