npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-mean-stack

v0.4.0

Published

An other Yeoman Generator for MEAN (MongoDB, ExpressJS, AngularJS, NodeJS) applications

Downloads

9

Readme

NPM version NPM downloads Build Status Dependency Status

Yeoman generator for MEAN stack projects

Alt text

Introduction

MEAN stack defines application using MongoDB, ExpressJS, AngularJS and NodeJS for a full Javascript development. This generator will help you to start with a solid base, which permits you to code faster. Some usual tasks are handled in sub-generators too.

Prerequisites

To use the generator, you need some prerequisites :

  • Node.js with NPM
  • MongoDB (only needed if you want to use a local database, you could use a MongoDB web service like Mongolab too, but for development purpose it could be useful to have a local database)
  • Yo - This package manage all Yeoman's generators
$ npm install -g yo
  • Bower - Bower will manage your frontend dependencies
$ npm install -g bower
  • Grunt - Grunt will automate some tasks to build your app or check if there's no error in your code.
$ npm install -g grunt-cli

Please make sure to read the documentation of these packages before starting your MEAN project. You also need to know basics about Express, AngularJS, Mongoose and Passport.

Installation

Install the generator

$ npm install -g generator-mean-stack

Make a new directory and cd into it

$ mkdir -p mean-project && cd $_

Scaffold a new MEAN stack project

yo mean-stack

Note: If you want to test user authentication in the new generated project, you need to leave ngRoute, ngCookies and nodemailer

You also need Bootstrap and Font Awesome to get the good demo project style

Generators

Available generators:

Note: Generators are to be run from the app root directory

App

Sets up a new MEAN stack app, generating all the boilerplate you need to get started.

Example:

$ yo mean-stack

bRoute

Sets up a new route in Express router (located in app/backend/router/routes dir).

You can choose if the route has a restricted access (only for users) and if you want a ready CRUD template.

Example:

$ yo mean-stack:bRoute

Note: CRUD will create a route AND start the bModel sub-generator to set up a new Mongoose model

If you want to skip bModel generator, use the --skip-model option.

$ yo mean-stack:bRoute --skip-model

bModel

Create a new Mongoose model (located in app/backend/models dir).

Suggestion: If you have to make a new route too, use yo mean-stack:bRoute instead

Example:

$ yo mean-stack:bModel

Serve and build

The generator makes a gruntfile configuration, so building your app becomes easy.

Build a fresh new distribution :

$ grunt

Run the app server in development mode :

$ grunt serve

You can define a production target to serve in production mode :

grunt serve:production

Note: this last command builds automatically a new distribution before serving.

Deployment

Make sure to test your final distribution with Grunt :

$ grunt serve:production

The final distribution is located in /build directory.

$ cd build

Everything you need is here, you can init a git repo here and push your build :

git init && git remote add origin pathToYourProductionServer && git commit -am "Build 1.0.0" && git push origin master

Note: Make sure to configure your .gitignore file inside /build directory to match with your production server specifications.

Note2: .git folder and .gitignore file won't be overwritten during new build, but you can add other files too in Gruntfile.js configuration.

MEAN-Stack Example

Coming soon...

License

MIT License