Simple Mongoose-Express-Angular-Node "contact book" application, with Karma/Jasmine unit tests, and optional AWS S3 image store.
NOTE: this doesn't use nice things like express-generator, yeoman, grunt, and so on, more "bare bones".
md \data\db
c:\path\to\mongod.exe
mkdir fullstack (or any project name <app> you choose)
cd <app>
npm init (all defaults except specify server.js instead of index.js for main server)
npm install --save express
npm install --save ejs
npm install --save angular
npm install --save mongoose (mongodb client)
npm install --save aws-sdk (for s3 image storage)
npm install --save-dev nodemon
create <app>/views/index.ejs and <app>/app/app.js with the angular page html and code
create <app>/models/Contact.js with the Contact model
create <app>/routes/contacts.js with the /contacts route code
create <app>/server.js with the express app code
add <app>/package.json script "dev" "nodemon index.js"
npm install
npm run dev
NOTE: In order to use the AWS S3 image store, you must set some environment variables first:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION
MY_S3_BUCKET
The last saved data is now displayed on the right side of the screen.
npm install --save-dev karma karma-jasmine jasmine-core karma-chrome-launcher
npm install --save-dev angular-mocks angular-resource angular-route
karma init (all defaults)
npm install -g karma-cli
// list of files / patterns to load in the browser
files: [
'./node_modules/angular/angular.js',
'./node_modules/angular-resource/angular-resource.js',
'./node_modules/angular-route/angular-route.js',
'./node_modules/angular-mocks/angular-mocks.js',
'./app/app.js',
'./spec/*Spec.js'
]
npm run test