If you are willing to setup a server using MEAN stack and you want to deploy code to a PaaS, You might find this repository useful. Will blog about the framework and its details on http://prasun.io/ when I have it in functional state.
Helpful Repositories which inspired a good part of the code:
- Fork and checkout
- Create a file .env.js, referring to .env.refer. If you need help please post a question on twitter @prasunsultania, or open a bug, if you think its a bug a) You need to have a mongod running on your local machine or subscribe for a Mongolab/MongoHQ account and paste its url in your .env.js
- Add an entry for login.localhost.in your hosts file, pointing to 127.0.0.1
- Run Following commands while you are in root directory of repository:
- Register with NGROK to test custom domains based pageSpeedInsight custom domains. After registration make sure to set
NGROK_HTTP_AUTH&npsp;and correct your domain name config in gruntfile.js code that connects to ngrok. If you dont want to register with ngrok, remove all configs in gruntfile.js for ngrok other than port.
- Thats it. Running tests (Backend Only):
grunt testCoverage&nbp;or use
b) Create a basic app in FB, Google and Twitter and enter API key, secret and callback urls in .env.js
- Develop using MEAN Stack and keep code platform agnostic to allow deploying on any PaaS.
- Front end and Back end decoupled of each other
- All Front end and its dependencies are under ./public
- Test Driven Development with Continuous Integration
- For CI: Used Travis CI, its very simple to use and nicely documented.
- For Back End: Used Mocha as test framework, Istanbul for code coverage and used Coveralls that uses the lcov output to give coverage report for each build and a nice badge
- For Front End: Again Mocha and Istanbul serves great. Here Tests are of two kinds:
- Unit: Karma serves good for the purpose of Unit tests, it runs all the JS in real browser.
- Functional: Or End to End tests are ran using Protractor on real browser.
- In each build commit on CI platform tests are ran using Saucelabs which kind of give you Cloud Access to the browser. Another great part of Saucelabs is that it is able to use localhost urls.
- PaaS Deployments:
- Currently code is deployed to CloudControl and Heroku by Travis CI once all the tests are passing
- Code is PaaS Platform agnostic, it needs correct env variables to be set. Please refer .env.js fore the same.