I have been learning Node for the last couple of months, and now have a complex application. My problem is that, i'd like to make it reusable, and as I was a complete noob, I haven't thought of this from the start.
What I have :
A complex node/express app running as a daemon with pm2.
lots of child processes scripts, some in Node, and some using casperjs/phantomjs
a config file for db credentials, server port, etc.
many npm dependencies, some for the app itself, some used only by child processes. The app itself is running perfectly, every path is stored in the config file, so deployment shouldn't be too hard.
- All the npm dependencies in the package.json file
What I'd like to do :
- Store the app on a GIT repo so I can set it up quickly on an EC2 instance.
- Install pm2, phantomjs/casperjs, all the node_modules and create the arborescence of the app (includes some empty folders for app-created files) in a simple manner, so people who don't have my knowledge of the app can get it up and running fast.
My question :
Do I need to add the node_modules to my git repo?
how can I integrate app deployement, install of dependencies and install of pm2, phantom and casper in the simplest possible way? I don't mind making a script but I don't really know where to start or best practices. Most of what I see on the web is about nodejitsu/heroku and does not apply.
My flaws :
- New to Git
- Haven't followed any guidelines for development as it all started as a toy project.
Hope my problem is understandable, Thanks all!
EDIT :
SO far I have :
- Read Git for beginners: The definitive practical guide
- Made a repo on github, cloned it and used npm install to get my app dependencies.
Still trying to figure out how to include the external dependencies.