Skip to content

Getting Started

Alfredo Barron edited this page Jan 18, 2017 · 3 revisions

Contents

Pre install

Linux Debian based

1. Update OS
$ sudo apt-get update
$ sudo apt-get upgrade
2. Install basics
$ sudo apt-get install make
$ sudo apt-get install build-essential g++
3. Most debian distros come with a pre-installed python but if not use this:
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.7
4. Install git
$ sudo apt-get install git
5. Install MongoDB
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
$ echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
$ sudo apt-get update
$ sudo apt-get install -y mongodb-org
$ sudo service mongod status
6. Install NodeJS
$ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
$ sudo apt-get install -y nodejs
7. Install Bower
$ sudo npm install -g bower
8. Install Gulp
$ sudo npm install -g gulp-cli
9. Install Sails
$ sudo npm -g install sails

Linux CentOS based

1. Update OS
$ sudo yum upgrade
2. Install basics
$ sudo yum groupinstall 'Development Tools'
3. CentOS come with a pre-installed python, check version with:
$ python --version
Python 2.7.5

If it is not Python 2.7, you should check if python2.7 exists under /usr/bin/ and make a symbolic link to it.

4. Install git (it may be already installed on step 1)
$ sudo yum install git
5. Install MongoDB

Create a /etc/yum.repos.d/mongodb-org-3.2.repo file with the following content

[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

then install it with

$ sudo yum install -y mongodb-org
6. Install NodeJS
$ curl -sL https://rpm.nodesource.com/setup_4.x | bash -
$ sudo yum install -y nodejs
7. Install Bower
$ sudo npm install -g bower
8. Install Gulp
$ sudo npm install -g gulp-cli
9. Install Sails
$ sudo npm -g install sails

Install

1. Clone the modulr repository
$ git clone https://github.com/modulr/modulr.git

Estructure

modulr/
├── api/ -> Backend (API Restful) with Sailsjs
└── app/ -> Frontend (SPA) with Angularjs
2. Install npm dependencies
~/modulr/api$ sudo npm install -g node-gyp
~/modulr/api$ npm install
~/modulr/app$ npm install

######3. Install bower dependencies

~/modulr/app$ bower install

If you receive conflicts notifications please chose no. 5

- Prefix the choice with ! to persist it to bower.json
- ? Answer
- angular#~1.5.0 which resolved to 1.5.8 and is required by modulr-app

Configure

Configure enviroment files

~/modulr/api/config/env$ mv development.example.js development.js
~/modulr/app/config/env$ mv development.example.json development.json

Start modulr

First check mongo is runing, if is not you can started with:

$ mongod
1. Start sails
~/modulr/api$ sails lift
2. Start web server
~/modulr/app$ gulp
3. Finaly step

Go to http://localhost:3000 in you browser.