Skip to content

kponnima/myapp-angular-mean

Repository files navigation

MyApp

This project was generated with Angular CLI version 6.0.7.

Key components

MongoDB :

  • Stores user data
  • Sends user data back when requested

Express API

  • Create, Read, Update, Delete
  • Generates JWT token upon registration/login and passes to Angular Application
  • /api/register (POST)
  • /api/login (POST)
  • /api/home/USERNAME (GET)

Angular App

  • Calls API and deals with responses [Passes JWT token for protected routes]
  • Stores JWT in order to maintain user's session
  • Checks the validity of JWT when displaying protected views

Stripe

  • Stripe API integration for payment processing
  • Token validation and saving the charge/payment details to dB

Installation

Development Platform - VS Code

1] Clone this repository and import it to VS Code repository

2] MongoDB -Install MongoDB and start server

3] Update your database configuration in database.js under \config

4] Start NodeJS/Express/Moongoose connection server using start-server npm-script

5] Proxy Serve Angular app using serve-proxy npm-script

6] Browser should automatically serve the website on http://localhost:4200/. Else fire up a browser and launch the app using the url.

Startup Screen

Alt text

Login Screen

Alt text

Home Screen

Alt text

Development server

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. Alternate npx @angular/cli serve

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

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.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

#To change default style extension ng config defaults.styleExt=scss ng config schematics.@schematics/angular:component.styleext scss

#Build test ng build --watch --progress=true lite-server --baseDir='dist'