Skip to content

huytr4n/node-best-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Best Practice For Node.js

Features

  • Generate Node.js project template
  • Node.js 0.10, 0.12, 4.x
  • MongoDB
  • Chef
  • Vagrant
  • Server deployment (fabric)

Constraints

Usage

Install needed gem

gem install knife-solo
gem install berkshelf

Init project structure

mkdir <project_name> && cd <project_name>
git clone [email protected]:g-huytran/nodejs-gitlabci-practice.git

Development env with Vagrant

cd vagrant/
vagrant up
vagrant ssh

cd ../chef/
sudo knife solo bootstrap [email protected] -P vagrant

Testing

Test your code with lab

npm test

JSLint

npm run lint

Deployment

With github

knife solo boostrap root@[server-ip]
or knife solo cook root@[server-ip]

With rsync

node backend/deployment/sync.js --dest=server
knife solo boostrap root@[server-ip]
or knife solo cook root@[server-ip]

Note: a JSON file of --dest param must be existed on config folder

Folder structure

Local Repository

  1. chef: contains chef configuration + cookbooks
  2. backend: contains all backend code
  3. .gitlab-ci.yml: gitlab configuration
  4. install.sh: install environment for gitlab runner
  5. vagrant: vagrant configuration

Troubleshooting

TODO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published