##Installation You need to install the following software in your server:
- linux distribution [ubuntu, centos, ...]
- git
- mongodb
- node
- npm
- imagemagick
- librsync and librsync-devel (rdiff)
##Post-Install ^
-
Clone repo
# cd to your destination parent folder $ git clone tilidom_node.git $ cd tilidom_node
-
Install npm modules
$ sudo npm install
-
Copy config base file
$ cp config/config.base.js config/config.js # or $ make config
-
Edit config/config.js with your custom configurations.
- change host to server's ip
- change db name
- change port
// config/config.js { mongo: { database: 'sampleDb' // <- desire dbname }, local: { port: 1337, // <- desire port host: '192.168.1.100' // <- server's ip } }
-
Install sails cli
$ sudo npm install -g sails
Optional software to run your app
$ sudo npm install -g forever
# or
$ sudo npm install -g pm2
##First time starting the app ^
- To start the app just type the following command:
$ sails lift # or $ node app.js
See common issues if you have any problems...
- Go to your favorite web browser and enter your app's server url
-
Example url:
http://192.168.1.29:1337
-
Initialize the application
http://192.168.1.29:1337/initialize
-
You've finished installing the app :D
-
##Creating Users ^ To create a user you need to run an api call user_register
Request
// example params
params: {
username: 'example@domain.com',
password: 'pass1234',
accept_terms: 1
}
// make request
GET /tilidom/tilidrive-api/user_register
Response
{
"message": "User was successfully registered",
"code": 0
}
##Update user to super admin ^
db.users.update(
{ _id: ObjectId("ID") },
{
// userinfo ...
userType: 'sa'
});
##How to make tag versions ^ Before commiting changes!
-
modify config.base.js
version: { current : 'v0.2.6', // <= change version description : 'bug fix: profile image', // <= change description of new version log : 'logs/version.log' },
# commit changes
$ commit -m "my commit"
# create tag
$ make tag
# push changes
$ git push -u origin master --tags
##Common Issues ^
-
The first time you start your app could crash, because no db was created before. Start again the application and there should not be an error.
$ sails lift
-
Trying start the app at port :80 getting errors?
- you need more priveliges to start your app
$ sudo sails lift
- you need more priveliges to start your app
-
more soon