Git Product home page Git Product logo

mean-angular2-quickstart's Introduction

MEAN Stack Angular2 Starter

An Angular 2 quick start combined with Express and ready to be hooked up to a MongoDB database. Clone this and set up your MongoDB separately (e.g. with Mlab), then create a .env file specifying your database details.

Clone from Github for a local version

Clone from Gomix for a live, hosted version

Uses Mongoose to hook up to MongoDB. Includes an example Schema and corresponding Angular component and model.

I can't take credit for the Express and Mongoose code. These parts were mostly copied from the wonderful tutorials by:

Ganga Chris and

Chris Sevilleja

The Angular 2 was generated with Angular CLI version 1.0.0-rc.0.

Development server

Run node server.js in root directory after build. Navigate to http://localhost:3000/ to view the app.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive/pipe/service/class/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.

Configuration

Create a .env file in the root directory describing your MongoDB database. It should be in the format: `

Environment Config

store your secrets and config variables in here

only invited collaborators will be able to see your .env values

reference these in your code with process.env.SECRET

Standard URI format: mongodb://[user:pass@]host:db_port/db

If using mlab - you can find these details at the top of the page for your database,

see http://docs.mlab.com/connecting/#connect-string

USER=joe PASS=thisisapassword HOST=localhost DB_PORT=5000 DB=mydb

note: .env is a shell file so there can't be spaces around '=

`

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. Before running the tests make sure you are serving the app via ng serve.

Further help

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

mean-angular2-quickstart's People

Contributors

angular-cli avatar nickderobertis avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.