This e-commerce Single Page Application project is a built on the MEAN Stack (Mongo, Express, Angular 2, Node) in order to help anyone who is trying to learn how these Javascript technologies work together. It shows how to do CRUD operation with Mongo DB and nested router control for Angular 2.
For simplicy, authentication is not implemented. I will be doing a separate project to demonstrate that feature soon.
Navigate to the project folder and run npm install
. Make sure you have mongo
installed on your machine or simply do sudo npm install -g mongo
and create a local database and a collection called ngBookStore
and books
respectively.
use ngBookStore
db.createCollection('books')
Run npm install
in the backend
folder and do node server.js
before navigating back to the project folder and run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the -prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
Before running the tests make sure you are serving the app via ng serve
.