├── .slugignore
├── logs
└── .gitignore
├── .jshintignore
├── packages
└── custom
│ └── meanStarter
│ ├── README.md
│ ├── public
│ ├── assets
│ │ ├── css
│ │ │ └── common.css
│ │ ├── img
│ │ │ ├── bg.png
│ │ │ ├── gmap.png
│ │ │ ├── logo.png
│ │ │ ├── cactus.png
│ │ │ ├── mail_login.png
│ │ │ ├── makeapoint.png
│ │ │ ├── social_fb.png
│ │ │ ├── social_g+.png
│ │ │ ├── social_in.png
│ │ │ ├── social_tw.png
│ │ │ ├── apple
│ │ │ │ ├── splash.png
│ │ │ │ ├── splash2x.png
│ │ │ │ ├── apple-touch-icon.png
│ │ │ │ ├── apple-touch-icon-precomposed.png
│ │ │ │ ├── apple-touch-icon-57x57-precomposed.png
│ │ │ │ ├── apple-touch-icon-72x72-precomposed.png
│ │ │ │ ├── apple-touch-icon-114x114-precomposed.png
│ │ │ │ └── apple-touch-icon-144x144-precomposed.png
│ │ │ ├── button_login.png
│ │ │ ├── devide_line.png
│ │ │ ├── eye_password.png
│ │ │ ├── icons
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── github.png
│ │ │ │ ├── google.png
│ │ │ │ ├── twitter.png
│ │ │ │ ├── facebook.png
│ │ │ │ └── linkedin.png
│ │ │ ├── social_github.png
│ │ │ ├── woman_ninja.png
│ │ │ ├── loaders
│ │ │ │ └── loader.gif
│ │ │ ├── welcome_social.png
│ │ │ ├── welcome_sprite.png
│ │ │ ├── button_login_hover.png
│ │ │ ├── devide_line_long.png
│ │ │ ├── eye_password_disabled.png
│ │ │ ├── woman_ninja_forg_pass.png
│ │ │ └── sprites
│ │ │ │ ├── glyphicons-halflings.png
│ │ │ │ └── glyphicons-halflings-white.png
│ │ └── fonts
│ │ │ ├── proximanova-light.eot
│ │ │ ├── proximanova-light.ttf
│ │ │ ├── proximanova-light.woff
│ │ │ ├── opensanshebrew-light.eot
│ │ │ ├── opensanshebrew-light.ttf
│ │ │ ├── opensanshebrew-light.woff
│ │ │ ├── opensanshebrew-regular.eot
│ │ │ ├── opensanshebrew-regular.ttf
│ │ │ ├── opensanshebrew-regular.woff
│ │ │ ├── ufonts.com_futura-book.eot
│ │ │ ├── ufonts.com_futura-book.ttf
│ │ │ ├── ufonts.com_futura-book.woff
│ │ │ ├── mark_simonson_-_proxima_nova_regular.eot
│ │ │ ├── mark_simonson_-_proxima_nova_regular.ttf
│ │ │ ├── mark_simonson_-_proxima_nova_regular.woff
│ │ │ └── opensanshebrew-light.svg
│ ├── index.js
│ ├── controllers
│ │ ├── starter.js
│ │ ├── header.js
│ │ └── index.js
│ ├── views
│ │ ├── users
│ │ │ ├── index.html
│ │ │ ├── login.html
│ │ │ ├── forgot-password.html
│ │ │ ├── reset-password.html
│ │ │ └── register.html
│ │ └── system
│ │ │ ├── header.html
│ │ │ └── index.html
│ └── routes
│ │ ├── system.js
│ │ └── users.js
│ ├── mean.json
│ ├── server
│ └── views
│ │ ├── index.html
│ │ ├── includes
│ │ ├── foot.html
│ │ └── head.html
│ │ ├── 404.html
│ │ ├── 500.html
│ │ └── layouts
│ │ └── default.html
│ ├── package.json
│ └── app.js
├── Procfile
├── .hound.yml
├── mean.json
├── docker-compose.yml
├── .bowerrc
├── tests
├── e2e
│ └── smoke
│ │ └── home.spec.js
└── config
│ └── e2e
│ └── protractor.config.js
├── tools
├── test
│ └── mocha-req.js
└── scripts
│ └── postinstall.js
├── gulp
├── utils.js
├── test.js
├── e2e.js
├── production.js
└── development.js
├── config
├── middlewares
│ └── logging.js
├── assets.json
├── env
│ ├── test.js
│ ├── development.js
│ ├── default.js
│ └── production.js
└── express.js
├── .editorconfig
├── bower.json
├── webpack.test.js
├── .csslintrc
├── gulpfile.js
├── .travis.yml
├── .platform.app.yaml
├── Dockerfile
├── webpack.config.js
├── CONTRIBUTING.md
├── LICENSE
├── .gitignore
├── app.js
├── server.js
├── karma.conf.js
├── package.json
├── .jshintrc
├── .snyk
└── README.MD
/.slugignore:
--------------------------------------------------------------------------------
1 | /test
--------------------------------------------------------------------------------
/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 |
--------------------------------------------------------------------------------
/.jshintignore:
--------------------------------------------------------------------------------
1 | test/coverage/**
2 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/README.md:
--------------------------------------------------------------------------------
1 | README: meanStarter
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: ./node_modules/.bin/forever -m 5 server.js
2 |
--------------------------------------------------------------------------------
/.hound.yml:
--------------------------------------------------------------------------------
1 | jshint:
2 | config_file: .jshintrc
3 | ignore_file: .jshintignore
4 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/css/common.css:
--------------------------------------------------------------------------------
1 | .MEAN-Logo {
2 | height: 80%
3 | }
4 |
--------------------------------------------------------------------------------
/mean.json:
--------------------------------------------------------------------------------
1 | {
2 | "dependencies": {},
3 | "anonymizedData": true,
4 | "name": "mean"
5 | }
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import './assets/css/common.css';
4 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/bg.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/gmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/gmap.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/logo.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/cactus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/cactus.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/mail_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/mail_login.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/makeapoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/makeapoint.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/social_fb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/social_fb.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/social_g+.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/social_g+.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/social_in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/social_in.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/social_tw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/social_tw.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/splash.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/button_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/button_login.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/devide_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/devide_line.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/eye_password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/eye_password.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/favicon.ico
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/github.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/google.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/twitter.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/social_github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/social_github.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/woman_ninja.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/woman_ninja.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/splash2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/splash2x.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/facebook.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/icons/linkedin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/icons/linkedin.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/loaders/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/loaders/loader.gif
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/welcome_social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/welcome_social.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/welcome_sprite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/welcome_sprite.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/button_login_hover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/button_login_hover.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/devide_line_long.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/devide_line_long.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/proximanova-light.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/proximanova-light.eot
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/proximanova-light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/proximanova-light.ttf
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/proximanova-light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/proximanova-light.woff
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | app:
2 | build: .
3 | ports:
4 | - "3000:3000"
5 | links:
6 | - db
7 |
8 | db:
9 | image: mongo
10 | ports:
11 | - "27017:27017"
12 |
13 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.eot
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.ttf
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.woff
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/eye_password_disabled.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/eye_password_disabled.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/woman_ninja_forg_pass.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/woman_ninja_forg_pass.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.eot
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.ttf
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-regular.woff
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.eot
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.ttf
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/ufonts.com_futura-book.woff
--------------------------------------------------------------------------------
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "bower_components",
3 | "storage": {
4 | "packages": ".bower-cache",
5 | "registry": ".bower-registry"
6 | },
7 | "tmp": ".bower-tmp"
8 | }
9 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/sprites/glyphicons-halflings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/sprites/glyphicons-halflings.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/sprites/glyphicons-halflings-white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/sprites/glyphicons-halflings-white.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.eot
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.ttf
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/fonts/mark_simonson_-_proxima_nova_regular.woff
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-57x57-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-57x57-precomposed.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-72x72-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-72x72-precomposed.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-114x114-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-114x114-precomposed.png
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-144x144-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/todo/mean/master/packages/custom/meanStarter/public/assets/img/apple/apple-touch-icon-144x144-precomposed.png
--------------------------------------------------------------------------------
/tests/e2e/smoke/home.spec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('Smoke test home page', function () {
4 | it('title should contain MEAN', function () {
5 | browser.get('/');
6 | expect(browser.getTitle()).toMatch(/.*MEAN.*/);
7 | })
8 | });
9 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/mean.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "meanStarter",
3 | "version": "0.1.0",
4 | "mean": "0.6.0",
5 | "dependencies": {
6 | "system": "latest",
7 | "users": "latest",
8 | "circles": "latest",
9 | "admin": "latest"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/tools/test/mocha-req.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | process.env.NODE_ENV = 'test'
4 | var path = require('path')
5 | var appRoot = path.join(__dirname, '/../../')
6 | require(appRoot + 'server.js')
7 | require('meanio/lib/core_modules/module/util').preload(appRoot + '/packages/**/server', 'model')
8 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/index.html:
--------------------------------------------------------------------------------
1 | {% extends 'layouts/default.html' %}
2 | {% block content %}
3 |
4 |
8 | {% endblock %}
9 |
--------------------------------------------------------------------------------
/gulp/utils.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var gulp = require('gulp');
4 | var del = require('del');
5 | var gulpLoadPlugins = require('gulp-load-plugins');
6 | var plugins = gulpLoadPlugins;
7 |
8 | gulp.task('help', plugins.taskListing);
9 |
10 | gulp.task('clean', function (cb) {
11 | return del(['bower_components/build'], cb);
12 | });
13 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/includes/foot.html:
--------------------------------------------------------------------------------
1 | MEAN.io makes building apps simpler and faster
2 |
3 |
4 | {% if (process.env.NODE_ENV == 'development') %}
5 |
6 | {% endif %}
7 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/404.html:
--------------------------------------------------------------------------------
1 | {% extends 'layouts/default.html' %}
2 |
3 | {% block main %}
4 | Oops something went wrong
5 |
6 | 404
7 | {% endblock %}
8 |
9 | {% block content %}
10 |
11 |
12 |
13 | {{error}}
14 |
15 |
16 |
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/config/middlewares/logging.js:
--------------------------------------------------------------------------------
1 | /* globals require */
2 | ;(function () {
3 | 'use strict'
4 |
5 | module.exports = function (app, config) {
6 | var format, options
7 |
8 | if (config !== false) {
9 | config = config || {}
10 |
11 | format = config.format || 'dev'
12 | options = config.options || {}
13 |
14 | app.use(require('morgan')(format, options))
15 | }
16 | }
17 | })()
18 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/500.html:
--------------------------------------------------------------------------------
1 | {% extends 'layouts/default.html' %}
2 |
3 | {% block main %}
4 | Oops something went wrong
5 |
6 | 500
7 | {% endblock %}
8 |
9 | {% block content %}
10 |
11 |
12 |
13 | {{error}}
14 |
15 |
16 |
17 | {% endblock %}
18 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/controllers/starter.js:
--------------------------------------------------------------------------------
1 | (function () {
2 | 'use strict';
3 |
4 | angular.module('mean.meanStarter')
5 | .controller('StarterController', StarterController);
6 |
7 | StarterController.$inject = ['$scope', 'Global'];
8 |
9 | function StarterController ($scope, Global) {
10 | // Original scaffolded code.
11 | $scope.global = Global;
12 | $scope.package = {
13 | name: 'meanStarter'
14 | };
15 | }
16 | })();
17 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 |
8 | [*]
9 |
10 | # Change these settings to your own preference
11 | indent_style = space
12 | indent_size = 2
13 |
14 | # We recommend you to keep these unchanged
15 | end_of_line = lf
16 | charset = utf-8
17 | trim_trailing_whitespace = true
18 | insert_final_newline = true
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mean",
3 | "dependencies": {
4 | "jquery": "latest",
5 | "angular": "latest",
6 | "angular-resource": "latest",
7 | "angular-cookies": "latest",
8 | "angular-mocks": "latest",
9 | "angular-route": "latest",
10 | "bootstrap": "latest",
11 | "angular-bootstrap": "latest",
12 | "angular-ui-router": "latest",
13 | "web-bootstrap": "./node_modules/meanio/resources/web-bootstrap.js",
14 | "angular-ui-select": "latest",
15 | "angular-sanitize": "latest"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/webpack.test.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = {
4 | module: {
5 | loaders: [
6 | {test: /\.css$/, loader: 'style-loader!css-loader'},
7 | {
8 | test: /\.js$/,
9 | exclude: /(node_modules|bower_components|lib)/,
10 | loader: 'babel?presets[]=es2015&presets[]=stage-1'
11 | },
12 | {
13 | test: /(.*)\.(eot|svg|ttf|woff|woff2)$/,
14 | loader: 'url-loader'
15 | }
16 | ]
17 | },
18 | resolve: {
19 | modulesDirectories: ['bower_components', 'node_modules']
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/.csslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "adjoining-classes": false,
3 | "box-model": false,
4 | "box-sizing": false,
5 | "compatible-vendor-prefixes": false,
6 | "floats": false,
7 | "font-sizes": false,
8 | "gradients": false,
9 | "important": false,
10 | "known-properties": false,
11 | "outline-none": false,
12 | "overqualified-elements": false,
13 | "qualified-headings": false,
14 | "regex-selectors": false,
15 | "shorthand": false,
16 | "text-indent": false,
17 | "unique-headings": false,
18 | "universal-selector": false,
19 | "unqualified-attributes": false
20 | }
21 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "meanStarter",
3 | "version": "0.0.1",
4 | "description": "A starter layout / theme package for MEAN",
5 | "author": {
6 | "name": "MEAN.io"
7 | },
8 | "mean": "0.6.0",
9 | "dependencies": {
10 | "meanio-system": "git://github.com/linnovate/meanio-system.git",
11 | "meanio-users": "git://github.com/linnovate/meanio-users.git",
12 | "meanio-circles": "git://github.com/linnovate/meanio-circles.git",
13 | "meanio-admin": "git://github.com/linnovate/meanio-admin.git"
14 | },
15 | "license": "MIT"
16 | }
17 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/app.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | /*
4 | * Defining the Package
5 | */
6 | var Module = require('meanio').Module
7 | var path = require('path')
8 | var MeanStarter = new Module('meanStarter')
9 |
10 | /*
11 | * All MEAN packages require registration
12 | * Dependency injection is used to define required modules
13 | */
14 | MeanStarter.register(function (app, users, system) {
15 | // Set views path, template engine and default layout
16 | app.set('views', path.join(__dirname, '/server/views'))
17 |
18 | MeanStarter.angularDependencies(['mean.system', 'mean.users'])
19 |
20 | return MeanStarter
21 | })
22 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/users/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | var gulp = require('gulp')
4 |
5 | var env = process.env.NODE_ENV || 'development'
6 | /*
7 | var defaultTasks = ['clean', 'jshint', 'csslint','serve','watch'] // initialize with development settings
8 | if (env === 'production') { var defaultTasks = ['clean', 'cssmin', 'uglify', 'serve', 'watch'];}
9 | if (env === 'test') { var defaultTasks = ['env:test', 'karma:unit', 'mochaTest'];}
10 | */
11 | // read gulp directory contents for the tasks...
12 | require('require-dir')('./gulp')
13 | console.log('Invoking gulp -', env)
14 | gulp.task('default', ['clean'], function (defaultTasks) {
15 | // run with paramater
16 | gulp.start(env)
17 | })
18 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | sudo: false
3 | node_js:
4 | - "4.5.0"
5 | - "6.5.0"
6 | env:
7 | - NODE_ENV=development
8 | services:
9 | - mongodb
10 |
11 | before_install:
12 | - npm i -g npm@'>=3.5.3'
13 | - npm -v
14 | - npm i -g bower
15 | - bower -v
16 |
17 | notifications:
18 | webhooks:
19 | urls:
20 | - https://webhooks.gitter.im/e/08c84711c36e875930d0
21 | - https://hooks.slack.com/services/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
22 | on_success: change # options: [always|never|change] default: always
23 | on_failure: always # options: [always|never|change] default: always
24 | on_start: always # default: false
25 |
26 |
27 |
--------------------------------------------------------------------------------
/.platform.app.yaml:
--------------------------------------------------------------------------------
1 | name: node
2 | type: nodejs
3 |
4 | web:
5 | commands:
6 | start: "PM2_HOME=/app/run pm2 start index.js --no-daemon"
7 | #in this setup you will find your application stdout and stderr in /app/run/logs
8 | locations:
9 | "/public":
10 | passthru: false
11 | root: "public"
12 | # Whether to allow files not matching a rule or not.
13 | allow: true
14 | rules:
15 | '\.png$':
16 | allow: true
17 | expires: -1
18 | dependencies:
19 | nodejs:
20 | pm2: "^0.15.10"
21 | bower:
22 | gulp:
23 | mounts:
24 | "/run": "shared:files/run"
25 | disk: 512
26 | hooks:
27 | build: |
28 | npm install
29 | bower install
30 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/routes/system.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // Setting up route
4 | angular.module('mean.meanStarter').config(['$meanStateProvider', '$urlRouterProvider',
5 | function ($meanStateProvider, $urlRouterProvider) {
6 | // For unmatched routes:
7 | $urlRouterProvider.otherwise('/');
8 |
9 | // states for my app
10 | $meanStateProvider
11 | .state('home', {
12 | url: '/',
13 | templateUrl: 'meanStarter/views/system/index.html'
14 | });
15 | }
16 | ]).config(['$locationProvider',
17 | function ($locationProvider) {
18 | $locationProvider.html5Mode({
19 | enabled: true,
20 | requireBase: false
21 | });
22 | }
23 | ]);
24 |
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:4.2
2 |
3 | RUN mkdir -p /usr/src/app
4 | WORKDIR /usr/src/app
5 |
6 | RUN npm install -g mean-cli bower gulp
7 |
8 | RUN groupadd -r node \
9 | && useradd -r -m -g node node
10 |
11 | COPY . /usr/src/app/
12 | RUN rm -rf /usr/src/app/node_modules
13 | RUN chown -R node:node /usr/src/app
14 |
15 | USER node
16 | RUN touch /home/node/.mean
17 | RUN npm install
18 | ENV PORT 3000
19 | ENV DB_PORT_27017_TCP_ADDR db
20 | CMD [ "npm", "start" ]
21 | EXPOSE 3000
22 |
23 |
24 | #How to build:
25 | # git clone https://github.com/linnovate/mean
26 | # cd mean
27 | # docker build -t mean .
28 |
29 | #How to run:
30 | # docker pull mongo
31 | # docker run -d --name db mongo
32 | # docker run -p 3000:3000 --link db:db mean
33 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | {% include '../includes/head.html' %}
4 |
5 |
6 |
7 |
8 | {% block content %}{% endblock %}
9 |
14 | {% include '../includes/foot.html' %}
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | var path = require('path')
4 |
5 | // var ngAnnotatePlugin = require('ng-annotate-webpack-plugin')
6 |
7 | module.exports = {
8 | context: __dirname,
9 | entry: './app.js',
10 | output: {
11 | path: path.join(__dirname, './bundle'),
12 | publicPath: '/',
13 | filename: 'app.js'
14 | },
15 | module: {
16 | loaders: [{
17 | test: /\.css$/,
18 | loader: 'style-loader!css-loader'
19 | }, {
20 | test: /\.js$/,
21 | exclude: /(node_modules|bower_components|lib)/,
22 | loader: 'babel?presets[]=es2015&presets[]=stage-1'
23 | }, {
24 | test: /(.*)\.(eot|svg|ttf|woff|woff2)$/,
25 | loader: 'url-loader'
26 | }]
27 | },
28 | resolve: {
29 | modulesDirectories: ['bower_components', 'node_modules']
30 | },
31 | plugins: [
32 | // new ngAnnotatePlugin({
33 | // add: true,
34 | // // other ng-annotate options here
35 | // })
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/tests/config/e2e/protractor.config.js:
--------------------------------------------------------------------------------
1 | var jasmineReporters = require('jasmine-reporters')
2 |
3 | exports.config = {
4 | baseUrl: 'http://localhost:3001',
5 | framework: 'jasmine2',
6 | specs: [
7 | '../../e2e/**/*.spec.js'
8 | ],
9 | multiCapabilities: [
10 | {
11 | browserName: 'chrome'
12 | },
13 | {
14 | browserName: 'firefox'
15 | }
16 | ],
17 |
18 | onPrepare: function () {
19 | // Creates independent results files for each browser
20 | // Otherwise they run at the same time and overwrite each other
21 | var capsPromise = browser.getCapabilities()
22 |
23 | return capsPromise.then(function (caps) {
24 | var browserName = caps.caps_.browserName
25 | var browserVersion = caps.caps_.version
26 | var browserPrefix = browserName + '-' + browserVersion + '-'
27 | jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
28 | savePath: 'tests/results/e2e/junit',
29 | filePrefix: browserPrefix,
30 | consolidateAll: false
31 | }))
32 | })
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/config/assets.json:
--------------------------------------------------------------------------------
1 | {
2 | "core": {
3 | "css": {
4 | "bower_components/build/css/dist.min.css": [
5 | "bower_components/angular/angular-csp.css",
6 | "bower_components/angular-ui-select/dist/select.min.css"
7 | ]
8 | },
9 | "js": {
10 | "bower_components/build/js/dist.min.js": [
11 | "bower_components/jquery/dist/jquery.min.js",
12 | "bower_components/angular/angular.min.js",
13 | "bower_components/angular-mocks/angular-mocks.js",
14 | "bower_components/angular-cookies/angular-cookies.min.js",
15 | "bower_components/angular-resource/angular-resource.min.js",
16 | "bower_components/angular-sanitize/angular-sanitize.min.js",
17 | "bower_components/angular-ui-router/release/angular-ui-router.min.js",
18 | "bower_components/angular-jwt/dist/angular-jwt.min.js",
19 | "bower_components/angular-bootstrap/ui-bootstrap-tpls.js",
20 | "bower_components/angular-ui-select/dist/select.min.js",
21 | "bower_components/web-bootstrap/index.js"
22 | ]
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/users/login.html:
--------------------------------------------------------------------------------
1 |
25 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing
2 |
3 | ### Reporting an Issue
4 | 1. Please make sure that the issue you have found is not an issue that has already been opened
5 | 2. If that's the case, then add your observations in that same issue
6 | 3. If your issue is unique, please add following details in the issue:
7 | 1. OS name and version
8 | 2. NodeJS and NPM version : Output of `node -v` and `npm -v`
9 | 3. MEAN Status : Output of `mean status` in project directory
10 | 4. Tracelog : The error that got printed on the console
11 | 5. Any other relevant details
12 | 4. Add `[Feature]` in the title if its a suggestion rather than an issue that you would like to see in MEAN.
13 |
14 |
15 | ### Creating a pull request
16 | 1. There should be an issue for every pull request that is created. If no issue exists for your pull request, please create one.
17 | 2. Make sure that your changes are passing the test by running `npm test`
18 | 3. If there are any lint warnings, please clean those up as well
19 | 4. In the comments for the pull request mention the issues that you are solving by this pull request
20 | 5. Create the pull request
21 |
--------------------------------------------------------------------------------
/gulp/test.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var gulp = require('gulp');
4 | var gulpLoadPlugins = require('gulp-load-plugins');
5 | // var request = require('request')
6 | var KarmaServer = require('karma').Server;
7 | // var fs = require('fs')
8 | var path = require('path');
9 |
10 | var plugins = gulpLoadPlugins();
11 |
12 | process.env.NODE_ENV = 'test';
13 |
14 | gulp.task('test', ['startServer', 'stopServer']);
15 | gulp.task('startServer', function (done) {
16 | var promise = require('../server.js');
17 | promise.then(function (app) {
18 | done()
19 | })
20 | });
21 | gulp.task('stopServer', ['runKarma'], function () {
22 | process.exit();
23 | });
24 | gulp.task('runMocha', ['startServer'], function () {
25 | return gulp.src('./packages/**/server/tests/**/*.spec.js', {read: false})
26 | .pipe(plugins.mocha({
27 | reporter: 'spec'
28 | }))
29 | .on('error', function (error) {
30 | console.error(error);
31 | this.emit('end')
32 | });
33 | });
34 | gulp.task('runKarma', ['runMocha'], function (done) {
35 | var karma = new KarmaServer({
36 | configFile: path.join(__dirname, '/../karma.conf.js'),
37 | singleRun: true
38 | }, function () {
39 | done();
40 | });
41 |
42 | karma.start();
43 | });
44 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/users/forgot-password.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/gulp/e2e.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var gulp = require('gulp');
4 | var path = require('path');
5 | var shell = require('shelljs');
6 |
7 | gulp.task('e2e.test', ['e2e.startServer', 'e2e.stopServer'], function (done) {});
8 |
9 | gulp.task('e2e.update', function (done) {
10 | // Install/update webdriver requirements for Protractor e2e testing
11 | console.log('Protractor webdriver-manager update');
12 | var webdriverBin = path.join(require.resolve('protractor'), '../..', 'bin/webdriver-manager').normalize();
13 | shell.exec('node ' + webdriverBin + ' update', function (code, output) {
14 | console.log(output);
15 | if (code !== 0) {
16 | process.exit(code);
17 | }
18 |
19 | done();
20 | });
21 | });
22 |
23 | gulp.task('e2e.startServer', ['e2e.update'], function (done) {
24 | var promise = require('../server.js');
25 |
26 | promise.then(function (app) {
27 | done();
28 | });
29 | });
30 |
31 | gulp.task('e2e.runProtractor', ['e2e.startServer'], function (done) {
32 | shell.exec('node node_modules/protractor/bin/protractor tests/config/e2e/protractor.config.js', function (code, output) {
33 | done();
34 | });
35 | });
36 |
37 | gulp.task('e2e.stopServer', ['e2e.runProtractor'], function () {
38 | process.exit();
39 | });
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | ========================================
2 | MEAN.IO is licensed under the MIT License
3 | ========================================
4 |
5 | Copyright (C) 2012-2014 Linnovate Technologies
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/users/reset-password.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # --------------------
2 | # OSX Files
3 | # --------------------
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 | Icon
8 | ._*
9 | .Spotlight-V100
10 | .Trashes
11 |
12 | # --------------------
13 | # Eclipse or Nodeclipse "Enide Studio" Files
14 | # --------------------
15 | # recommended to add to Git SCM
16 | # or generate with `nodeclipse -p` command
17 | .project
18 | .settings/
19 | .*.md.html
20 |
21 |
22 | # --------------------
23 | # IntelliJ Files
24 | # --------------------
25 | *.iml
26 | *.ipr
27 | *.iws
28 | .idea/
29 |
30 | # --------------------
31 | # Netbeans Files
32 | # --------------------
33 | nbproject/private/
34 | build/
35 | nbbuild/
36 | dist/
37 | nbdist/
38 | nbactions.xml
39 | nb-configuration.xml
40 |
41 | # --------------------
42 | # Node Files
43 | # --------------------
44 | .nodemonignore
45 | npm-debug.log
46 | node_modules/
47 |
48 | # --------------------
49 | # SASS Files
50 | # --------------------
51 | .sass-cache/
52 |
53 | # --------------------
54 | # Bower Files
55 | # --------------------
56 | .bower-*/
57 | bower_components
58 |
59 | # --------------------
60 | # App Files
61 | # --------------------
62 | data/
63 | tests/results/**
64 | modules/public/
65 | modules/views/
66 | /public/build/
67 | /packages/contrib/
68 | /packages/**/**/public/assets/lib
69 |
70 |
71 | # --------------------
72 | # vim Files
73 | # --------------------
74 | *.swp
75 |
76 | #webpack
77 | /bundle
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/routes/users.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | // Setting up route
4 | angular.module('mean.meanStarter').config(['$meanStateProvider',
5 | function ($meanStateProvider) {
6 | // states for users
7 | $meanStateProvider
8 | .state('auth', {
9 | url: '/auth',
10 | abstract: true,
11 | templateUrl: 'meanStarter/views/users/index.html'
12 | })
13 | .state('auth.login', {
14 | url: '/login',
15 | templateUrl: 'meanStarter/views/users/login.html',
16 | resolve: {
17 | loggedin: function (MeanUser) {
18 | return MeanUser.checkLoggedOut()
19 | }
20 | }
21 | })
22 | .state('auth.register', {
23 | url: '/register',
24 | templateUrl: 'meanStarter/views/users/register.html',
25 | resolve: {
26 | loggedin: function (MeanUser) {
27 | return MeanUser.checkLoggedOut()
28 | }
29 | }
30 | })
31 | .state('forgot-password', {
32 | url: '/forgot-password',
33 | templateUrl: 'meanStarter/views/users/forgot-password.html',
34 | resolve: {
35 | loggedin: function (MeanUser) {
36 | return MeanUser.checkLoggedOut()
37 | }
38 | }
39 | })
40 | .state('reset-password', {
41 | url: '/reset/:tokenId',
42 | templateUrl: 'meanStarter/views/users/reset-password.html',
43 | resolve: {
44 | loggedin: function (MeanUser) {
45 | return MeanUser.checkLoggedOut()
46 | }
47 | }
48 | });
49 | }
50 | ]);
51 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/system/header.html:
--------------------------------------------------------------------------------
1 |
33 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | import 'angular/angular-csp.css';
4 | import 'angular-ui-select/select.min.css';
5 | import 'angular-material/angular-material.min.css';
6 |
7 | import jQuery from 'jquery';
8 | import 'angular';
9 | import 'angular-ui-select/select';
10 | import 'angular-mocks';
11 | import 'angular-cookies';
12 | import 'angular-resource';
13 | import 'angular-sanitize';
14 | import 'angular-ui-router';
15 | import 'angular-jwt';
16 | import 'angular-aria';
17 | import 'angular-animate';
18 | import 'angular-material';
19 |
20 | window.$ = jQuery;
21 |
22 | angular.element(document).ready(function () {
23 | // Fixing facebook bug with redirect
24 | if (window.location.hash === '#_=_') {
25 | window.location.hash = '#!';
26 | }
27 |
28 | // Then init the app
29 | angular.bootstrap(document, ['mean']);
30 | });
31 |
32 | function processModules (modules) {
33 | var packageModules = ['ngCookies', 'ngResource', 'ui.router', 'ui.select', 'ngSanitize', 'ngMaterial'];
34 | var m;
35 | var mn;
36 | for (var index in modules) {
37 | m = modules[index];
38 | mn = 'mean.' + m.name;
39 | angular.module(mn, m.angularDependencies || []);
40 | packageModules.push(mn);
41 | }
42 |
43 | var req = require.context('./packages', true, /\/public\/(?!tests|assets|views)(.*)\.js$/);
44 | req.keys().map(req);
45 | req = require.context('./node_modules', true, /\/meanio-(.*)\/public\/(?!tests|assets|views)(.*)\.js$/);
46 | req.keys().map(req);
47 | angular.module('mean', packageModules);
48 | }
49 |
50 | jQuery.ajax('/_getModules', {
51 | dataType: 'json',
52 | async: false,
53 | success: processModules
54 | });
55 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/server/views/includes/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{appName}} - {{title}}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/controllers/header.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('mean.system').controller('HeaderController', ['$scope', '$rootScope', 'Menus', 'MeanUser', '$state',
4 | function ($scope, $rootScope, Menus, MeanUser, $state) {
5 | var vm = this;
6 |
7 | vm.menus = {};
8 | vm.hdrvars = {
9 | authenticated: MeanUser.loggedin,
10 | user: MeanUser.user,
11 | isAdmin: MeanUser.isAdmin
12 | };
13 |
14 | // Default hard coded menu items for main menu
15 | var defaultMainMenu = [];
16 |
17 | // Query menus added by modules. Only returns menus that user is allowed to see.
18 | function queryMenu (name, defaultMenu) {
19 | Menus.query({
20 | name: name,
21 | defaultMenu: defaultMenu
22 | }, function (menu) {
23 | vm.menus[name] = menu
24 | });
25 | }
26 |
27 | // Query server for menus and check permissions
28 | queryMenu('main', defaultMainMenu);
29 | queryMenu('account', []);
30 |
31 | $scope.isCollapsed = false;
32 |
33 | $rootScope.$on('loggedin', function () {
34 | queryMenu('main', defaultMainMenu);
35 |
36 | vm.hdrvars = {
37 | authenticated: MeanUser.loggedin,
38 | user: MeanUser.user,
39 | isAdmin: MeanUser.isAdmin
40 | }
41 | });
42 |
43 | vm.logout = function () {
44 | MeanUser.logout()
45 | };
46 |
47 | $rootScope.$on('logout', function () {
48 | vm.hdrvars = {
49 | authenticated: false,
50 | user: {},
51 | isAdmin: false
52 | };
53 | queryMenu('main', defaultMainMenu);
54 | $state.go('home');
55 | });
56 | }
57 | ]);
58 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/users/register.html:
--------------------------------------------------------------------------------
1 |
40 |
--------------------------------------------------------------------------------
/config/env/test.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = {
4 | db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-test',
5 | http: {
6 | port: 3001
7 | },
8 | aggregate: false,
9 | assets: {
10 | hash: false
11 | },
12 | logging: {
13 | format: 'common'
14 | },
15 | app: {
16 | name: 'MEAN - A Modern Stack - Test'
17 | },
18 | strategies: {
19 | local: {
20 | enabled: true
21 | },
22 | landingPage: '/',
23 | facebook: {
24 | clientID: 'APP_ID',
25 | clientSecret: 'APP_SECRET',
26 | callbackURL: 'http://localhost:3000/auth/facebook/callback',
27 | enabled: false
28 | },
29 | twitter: {
30 | clientID: 'CONSUMER_KEY',
31 | clientSecret: 'CONSUMER_SECRET',
32 | callbackURL: 'http://localhost:3000/auth/twitter/callback',
33 | enabled: false
34 | },
35 | github: {
36 | clientID: 'APP_ID',
37 | clientSecret: 'APP_SECRET',
38 | callbackURL: 'http://localhost:3000/auth/github/callback',
39 | enabled: false
40 | },
41 | google: {
42 | clientID: 'APP_ID',
43 | clientSecret: 'APP_SECRET',
44 | callbackURL: 'http://localhost:3000/auth/google/callback',
45 | enabled: false
46 | },
47 | linkedin: {
48 | clientID: 'API_KEY',
49 | clientSecret: 'SECRET_KEY',
50 | callbackURL: 'http://localhost:3000/auth/linkedin/callback',
51 | enabled: false
52 | }
53 | },
54 | emailFrom: 'SENDER EMAIL ADDRESS', // sender address like ABC
55 | mailer: {
56 | service: 'SERVICE_PROVIDER',
57 | auth: {
58 | user: 'EMAIL_ID',
59 | pass: 'PASSWORD'
60 | }
61 | },
62 | secret: 'SOME_TOKEN_SECRET'
63 | }
64 |
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | /*
4 | var cl = console.log
5 | console.log = function(){
6 | console.trace()
7 | cl.apply(console,arguments)
8 | }
9 | */
10 |
11 | process.env.NODE_CONFIG_DIR = './config/env'
12 |
13 | // Requires meanio .
14 | var mean = require('meanio')
15 | var cluster = require('cluster')
16 | var deferred = require('q').defer()
17 | var debug = require('debug')('cluster')
18 |
19 | // Code to run if we're in the master process or if we are not in debug mode/ running tests
20 |
21 | if ((cluster.isMaster) &&
22 | (process.execArgv.indexOf('--debug') < 0) &&
23 | (process.env.NODE_ENV !== 'test') && (process.env.NODE_ENV !== 'development') &&
24 | (process.execArgv.indexOf('--singleProcess') < 0)) {
25 | // if (cluster.isMaster) {
26 |
27 | debug(`Production Environment`)
28 | // Count the machine's CPUs
29 | var cpuCount = process.env.CPU_COUNT || require('os').cpus().length
30 |
31 | // Create a worker for each CPU
32 | for (var i = 0; i < cpuCount; i += 1) {
33 | debug(`forking ${i}`)
34 | cluster.fork()
35 | }
36 |
37 | // Listen for dying workers
38 | cluster.on('exit', function (worker) {
39 | // Replace the dead worker, we're not sentimental
40 | debug(`Worker ${worker.id} died :(`)
41 | cluster.fork()
42 | })
43 |
44 | // Code to run if we're in a worker process
45 | } else {
46 | var workerId = 0
47 | if (!cluster.isMaster) {
48 | workerId = cluster.worker.id
49 | }
50 | // Creates and serves mean application
51 | mean.serve({ workerid: workerId }, function (app) {
52 | var config = app.getConfig()
53 | var port = config.https && config.https.port ? config.https.port : config.http.port
54 | debug(`MEAN app started on port ${port} (${process.env.NODE_ENV}) with cluster worker id ${workerId}`)
55 |
56 | deferred.resolve(app)
57 | })
58 | }
59 |
60 | module.exports = deferred.promise
61 |
--------------------------------------------------------------------------------
/gulp/production.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var gulp = require('gulp');
4 | var gulpLoadPlugins = require('gulp-load-plugins');
5 | var path = require('path');
6 | var _ = require('lodash');
7 | var plugins = gulpLoadPlugins();
8 | var defaultTasks = ['clean', 'cssmin', 'uglify', 'prodServe'];
9 | var assets = require('../config/assets.json');
10 |
11 | gulp.task('env:production', function () {
12 | process.env.NODE_ENV = 'production';
13 | });
14 |
15 | function tokenizeConfig (config) {
16 | var destTokens = _.keys(config)[0].split('/');
17 |
18 | return {
19 | srcGlob: _.flatten(_.values(config)),
20 | destDir: destTokens[destTokens.length - 2],
21 | destFile: destTokens[destTokens.length - 1]
22 | };
23 | }
24 |
25 | gulp.task('cssmin', function () {
26 | console.log('in cssmin');
27 | var config = tokenizeConfig(assets.core.css);
28 |
29 | if (config.srcGlob.length) {
30 | return gulp.src(config.srcGlob)
31 | .pipe(plugins.cssmin({
32 | keepBreaks: true
33 | }))
34 | .pipe(plugins.concat(config.destFile))
35 | .pipe(gulp.dest(path.join('bower_components/build', config.destDir)));
36 | }
37 | });
38 |
39 | gulp.task('uglify', function () {
40 | console.log('in uglify');
41 | var config = tokenizeConfig(assets.core.js);
42 |
43 | if (config.srcGlob.length) {
44 | return gulp.src(config.srcGlob)
45 | .pipe(plugins.concat(config.destFile))
46 | .pipe(plugins.uglify({
47 | mangle: false
48 | }))
49 | .pipe(gulp.dest(path.join('bower_components/build', config.destDir)));
50 | }
51 | });
52 |
53 | gulp.task('prodServe', ['env:production'], function () {
54 | plugins.nodemon({
55 | script: 'server.js',
56 | ext: 'html js',
57 | env: {
58 | 'NODE_ENV': 'production'
59 | },
60 | ignore: ['./node_modules/**']
61 | })
62 | })
63 | gulp.task('production', defaultTasks)
64 |
--------------------------------------------------------------------------------
/config/env/development.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = {
4 | db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-dev',
5 | debug: true,
6 | logging: {
7 | format: 'tiny'
8 | },
9 | // aggregate: 'whatever that is not false, because boolean false value turns aggregation off', //false
10 | aggregate: false,
11 | mongoose: {
12 | debug: false
13 | },
14 | hostname: 'http://localhost:3000',
15 | app: {
16 | name: 'MEAN - A Modern Stack - Development'
17 | },
18 | strategies: {
19 | local: {
20 | enabled: true
21 | },
22 | landingPage: '/',
23 | facebook: {
24 | clientID: 'DEFAULT_APP_ID',
25 | clientSecret: 'APP_SECRET',
26 | callbackURL: 'http://localhost:3000/api/auth/facebook/callback',
27 | enabled: false
28 | },
29 | twitter: {
30 | clientID: 'DEFAULT_CONSUMER_KEY',
31 | clientSecret: 'CONSUMER_SECRET',
32 | callbackURL: 'http://localhost:3000/api/auth/twitter/callback',
33 | enabled: false
34 | },
35 | github: {
36 | clientID: 'DEFAULT_APP_ID',
37 | clientSecret: 'APP_SECRET',
38 | callbackURL: 'http://localhost:3000/api/auth/github/callback',
39 | enabled: false
40 | },
41 | google: {
42 | clientID: 'DEFAULT_APP_ID',
43 | clientSecret: 'APP_SECRET',
44 | callbackURL: 'http://localhost:3000/api/auth/google/callback',
45 | enabled: false
46 | },
47 | linkedin: {
48 | clientID: 'DEFAULT_API_KEY',
49 | clientSecret: 'SECRET_KEY',
50 | callbackURL: 'http://localhost:3000/api/auth/linkedin/callback',
51 | enabled: false
52 | }
53 | },
54 | emailFrom: 'SENDER EMAIL ADDRESS', // sender address like ABC
55 | mailer: {
56 | service: 'SERVICE_PROVIDER', // Gmail, SMTP
57 | auth: {
58 | user: 'EMAIL_ID',
59 | pass: 'PASSWORD'
60 | }
61 | },
62 | secret: 'SOME_TOKEN_SECRET'
63 | }
64 |
--------------------------------------------------------------------------------
/config/env/default.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | var path = require('path')
4 | var rootPath = path.join(__dirname, '/../..')
5 |
6 | module.exports = {
7 | root: rootPath,
8 | http: {
9 | port: process.env.PORT || 3000
10 | },
11 | https: {
12 | port: false,
13 |
14 | // Paths to key and cert as string
15 | ssl: {
16 | key: '',
17 | cert: '',
18 | ca: ''
19 | }
20 | },
21 | hostname: process.env.HOST || process.env.HOSTNAME,
22 | db: process.env.MONGOHQ_URL,
23 | templateEngine: 'swig',
24 |
25 | // The secret should be set to a non-guessable string that
26 | // is used to compute a session hash
27 | sessionSecret: 'MEAN',
28 |
29 | // The name of the MongoDB collection to store sessions in
30 | sessionCollection: 'sessions',
31 |
32 | // The session cookie settings
33 | sessionCookie: {
34 | path: '/',
35 | httpOnly: true,
36 | // If secure is set to true then it will cause the cookie to be set
37 | // only when SSL-enabled (HTTPS) is used, and otherwise it won't
38 | // set a cookie. 'true' is recommended yet it requires the above
39 | // mentioned pre-requisite.
40 | secure: false,
41 | // Only set the maxAge to null if the cookie shouldn't be expired
42 | // at all. The cookie will expunge when the browser is closed.
43 | maxAge: null
44 | },
45 | public: {
46 | languages: [{
47 | locale: 'en',
48 | direction: 'ltr'
49 | }, {
50 | locale: 'he',
51 | direction: 'rtl'
52 | }],
53 | currentLanguage: 'en',
54 | loginPage: '/auth/login',
55 | cssFramework: 'bootstrap'
56 | },
57 | clusterSticky: false,
58 | stickyOptions: {
59 | proxy: false, // activate layer 4 patching
60 | header: 'x-forwarded-for', // provide here your header containing the users ip
61 | num: (process.env.CPU_COUNT || require('os').cpus().length) - 1
62 | },
63 | // The session cookie name
64 | sessionName: 'connect.sid',
65 | // Set bodyParser options
66 | bodyParser: {
67 | json: {limit: '100kb'},
68 | urlencoded: {limit: '100kb', extended: true}
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/config/express.js:
--------------------------------------------------------------------------------
1 | /* globals require */
2 | 'use strict'
3 |
4 | /**
5 | * Module dependencies.
6 | */
7 | var mean = require('meanio')
8 | var compression = require('compression')
9 | var consolidate = require('consolidate')
10 | var express = require('express')
11 | var helpers = require('view-helpers')
12 | var flash = require('connect-flash')
13 | var modRewrite = require('connect-modrewrite')
14 | // seo = require('mean-seo'),
15 | var config = mean.getConfig()
16 | var bodyParser = require('body-parser')
17 | var helmet = require('helmet')
18 |
19 | module.exports = function (app, db) {
20 | app.use(bodyParser.json(config.bodyParser.json))
21 | app.use(bodyParser.urlencoded(config.bodyParser.urlencoded))
22 |
23 | app.use(helmet())
24 |
25 | app.set('showStackError', true)
26 |
27 | // Prettify HTML
28 | app.locals.pretty = true
29 |
30 | // cache=memory or swig dies in NODE_ENV=production
31 | app.locals.cache = 'memory'
32 |
33 | // Should be placed before express.static
34 | // To ensure that all assets and data are compressed (utilize bandwidth)
35 | app.use(compression({
36 | // Levels are specified in a range of 0 to 9, where-as 0 is
37 | // no compression and 9 is best compression, but slowest
38 | level: 9
39 | }))
40 |
41 | // Enable compression on bower_components
42 | app.use('/bower_components', express.static(config.root + '/bower_components'))
43 |
44 | app.use('/bundle', express.static(config.root + '/bundle'))
45 |
46 | // Adds logging based on logging config in config/env/ entry
47 | require('./middlewares/logging')(app, config.logging)
48 |
49 | // assign the template engine to .html files
50 | app.engine('html', consolidate[config.templateEngine])
51 |
52 | // set .html as the default extension
53 | app.set('view engine', 'html')
54 |
55 | // Dynamic helpers
56 | app.use(helpers(config.app.name))
57 |
58 | // Connect flash for flash messages
59 | app.use(flash())
60 |
61 | app.use(modRewrite([
62 |
63 | '!^/api/.*|\\_getModules|\\.html|\\.js|\\.css|\\.swf|\\.jp(e?)g|\\.JP(E?)G|\\.PNG|\\.png|\\.ico|\\.gif|\\.svg|\\.eot|\\.ttf|\\.woff|\\.txt|\\.pdf$ / [L]'
64 |
65 | ]))
66 |
67 | // app.use(seo())
68 | }
69 |
--------------------------------------------------------------------------------
/config/env/production.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | module.exports = {
4 | db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-prod',
5 | /**
6 | * Database options that will be passed directly to mongoose.connect
7 | * Below are some examples.
8 | * See http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#mongoclient-connect-options
9 | * and http://mongoosejs.com/docs/connections.html for more information
10 | */
11 | dbOptions: {
12 | /*
13 | server: {
14 | socketOptions: {
15 | keepAlive: 1
16 | },
17 | poolSize: 5
18 | },
19 | replset: {
20 | rs_name: 'myReplicaSet',
21 | poolSize: 5
22 | },
23 | db: {
24 | w: 1,
25 | numberOfRetries: 2
26 | }
27 | */
28 | },
29 | hostname: 'http://localhost:3000',
30 | app: {
31 | name: 'MEAN - A Modern Stack - Production'
32 | },
33 | logging: {
34 | format: 'combined'
35 | },
36 | strategies: {
37 | local: {
38 | enabled: true
39 | },
40 | landingPage: '/',
41 | facebook: {
42 | clientID: 'APP_ID',
43 | clientSecret: 'APP_SECRET',
44 | callbackURL: 'http://localhost:3000/api/auth/facebook/callback',
45 | enabled: false
46 | },
47 | twitter: {
48 | clientID: 'CONSUMER_KEY',
49 | clientSecret: 'CONSUMER_SECRET',
50 | callbackURL: 'http://localhost:3000/api/auth/twitter/callback',
51 | enabled: false
52 | },
53 | github: {
54 | clientID: 'APP_ID',
55 | clientSecret: 'APP_SECRET',
56 | callbackURL: 'http://localhost:3000/api/auth/github/callback',
57 | enabled: false
58 | },
59 | google: {
60 | clientID: 'APP_ID',
61 | clientSecret: 'APP_SECRET',
62 | callbackURL: 'http://localhost:3000/api/auth/google/callback',
63 | enabled: false
64 | },
65 | linkedin: {
66 | clientID: 'API_KEY',
67 | clientSecret: 'SECRET_KEY',
68 | callbackURL: 'http://localhost:3000/api/auth/linkedin/callback',
69 | enabled: false
70 | }
71 | },
72 | emailFrom: 'SENDER EMAIL ADDRESS', // sender address like ABC
73 | mailer: {
74 | service: 'SERVICE_PROVIDER',
75 | auth: {
76 | user: 'EMAIL_ID',
77 | pass: 'PASSWORD'
78 | }
79 | },
80 | secret: 'SOME_TOKEN_SECRET'
81 | }
82 |
--------------------------------------------------------------------------------
/tools/scripts/postinstall.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | var fs = require('fs')
4 | var npm = require('npm')
5 | var path = require('path')
6 | var shell = require('shelljs')
7 |
8 | function loadPackageJson (path, callback) {
9 | fs.readFile(path, function (err, data) {
10 | if (err) return callback(err)
11 |
12 | try {
13 | var pkg = JSON.parse(data.toString())
14 | callback(null, pkg)
15 | } catch (err) {
16 | return callback(err)
17 | }
18 | })
19 | }
20 |
21 | // Installs dependencies from package.json from mean packages into root node_modules
22 | function packagesNpmInstall (source) {
23 | var packages = path.join(process.cwd(), source)
24 | npm.load({
25 | loglevel: 'error'
26 | }, function (err, npm) {
27 | if (!err) {
28 | fs.readdir(packages, function (err, files) {
29 | if (err && err.code !== 'ENOENT') throw Error(err)
30 |
31 | if (!files || !files.length) return
32 | console.log('Auto installing package dependencies')
33 |
34 | files.forEach(function (file) {
35 | var pkgPath = path.join(packages, file)
36 |
37 | loadPackageJson(path.join(pkgPath, 'package.json'), function (err, data) {
38 | if (err || !data.mean) return
39 |
40 | var installDeps = []
41 |
42 | if (data.dependencies) {
43 | for (var dep in data.dependencies) {
44 | installDeps.push(dep + '@' + data.dependencies[dep])
45 | }
46 | if (process.env === 'development' && data.devDependencies) {
47 | for (var devDep in data.devDependencies) {
48 | installDeps.push(devDep + '@' + data.devDependencies[devDep])
49 | }
50 | }
51 | }
52 | if (installDeps.length) {
53 | npm.commands.install(installDeps, function (err) {
54 | if (err) {
55 | console.log('Error: npm install failed')
56 | return console.error(err)
57 | } else {
58 | console.log(' Dependencies installed for package ' + file)
59 | }
60 | })
61 | }
62 | })
63 | })
64 | })
65 | }
66 | })
67 | }
68 |
69 | shell.exec('bower update', function (code) {
70 | console.log(' Updating Bower dependencies')
71 | })
72 |
73 | packagesNpmInstall('packages/contrib')
74 | packagesNpmInstall('packages/custom')
75 | packagesNpmInstall('packages/core')
76 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | // Karma configuration
4 | module.exports = function (config) {
5 | var basePath = '.'
6 |
7 | config.set({
8 |
9 | // base path, that will be used to resolve files and exclude
10 | basePath: basePath,
11 |
12 | // frameworks to use
13 | frameworks: ['jasmine'],
14 | files: [
15 | 'app.js',
16 | 'packages/**/public/tests/**/*.js'
17 | ],
18 | // list of files to exclude
19 | exclude: [],
20 |
21 | // test results reporter to use
22 | // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
23 | reporters: ['progress', 'coverage', 'junit'],
24 |
25 | junitReporter: {
26 | outputDir: 'tests/results/public/junit/'
27 | },
28 |
29 | // coverage
30 | preprocessors: {
31 | // source files that you want to generate coverage for
32 | // do not include tests or libraries
33 | // (these files will be instrumented by Istanbul)
34 | 'packages/**/public/controllers/**/*.js': ['coverage'],
35 | 'packages/**/public/services/**/*.js': ['coverage'],
36 | 'packages/**/public/directives/**/*.js': ['coverage'],
37 |
38 | 'packages/**/public/**/*.html': ['ng-html2js'],
39 |
40 | // 'packages/**/public/tests/**/*.js': ['webpack', 'babel'],
41 | 'app.js': ['webpack']
42 | },
43 |
44 | webpack: require('./webpack.test.js'),
45 | webpackMiddleware: {
46 | noInfo: true
47 | },
48 |
49 | coverageReporter: {
50 | type: 'html',
51 | dir: 'tests/results/coverage/'
52 | },
53 |
54 | ngHtml2JsPreprocessor: {
55 | cacheIdFromPath: function (path) {
56 | var cacheId = path
57 |
58 | // Strip packages/custom/ and public/ to match the pattern of URL that mean.io uses
59 | cacheId = cacheId.replace('packages/custom/', '')
60 | cacheId = cacheId.replace('public/', '')
61 |
62 | return cacheId
63 | }
64 | },
65 |
66 | // web server port
67 | port: 9876,
68 | // Look for server on port 3001 (invoked by mocha) - via @brownman
69 | proxies: {
70 | '/': 'http://localhost:3001/'
71 | },
72 |
73 | // enable / disable colors in the output (reporters and logs)
74 | colors: true,
75 |
76 | // level of logging
77 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
78 | logLevel: config.LOG_INFO,
79 |
80 | // enable / disable watching file and executing tests whenever any file changes
81 | autoWatch: false,
82 |
83 | // Start these browsers, currently available:
84 | // - Chrome
85 | // - ChromeCanary
86 | // - Firefox
87 | // - Opera
88 | // - Safari (only Mac)
89 | // - PhantomJS
90 | // - IE (only Windows)
91 | browsers: ['PhantomJS'],
92 |
93 | // If browser does not capture in given timeout [ms], kill it
94 | captureTimeout: 60000,
95 | // How long will Karma wait for a message from a browser before disconnecting from it (in ms).
96 | browserNoActivityTimeout: 60000,
97 | // Continuous Integration mode
98 | // if true, it capture browsers, run tests and exit
99 | singleRun: true,
100 | plugins: [
101 | 'karma-jasmine',
102 | 'karma-webpack',
103 | 'karma-ng-html2js-preprocessor',
104 | 'karma-phantomjs-launcher',
105 | 'karma-coverage',
106 | 'karma-junit-reporter'
107 | ]
108 | })
109 | }
110 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/controllers/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | angular.module('mean.system').controller('IndexController', ['$scope', 'Global',
4 | function ($scope, Global) {
5 | $scope.global = Global;
6 | $scope.sites = [{
7 | 'name': 'makeapoint',
8 | 'text': 'Makeapoint is a platform to craft and fine-tune ideas and messages providing a graphical experience which brough an offline methodlogy online',
9 | 'author': 'Linnovate',
10 | 'link': 'http://www.linnovate.net',
11 | 'image': '/meanStarter/assets/img/makeapoint.png'
12 | }, {
13 | 'name': 'Cactus Intranet',
14 | 'text': 'Cactus Intranet is an enterprise social network with features like real-time newsfeed, notifications, groups, events, polls, referral system etc. The system has role based permission system, allowing different stakeholders access and controls relevant to them.',
15 | 'author': 'QED42',
16 | 'link': 'http://www.qed42.com',
17 | 'image': '/meanStarter/assets/img/cactus.png'
18 | }];
19 | $scope.packages = {
20 | 'gmap': {
21 | 'name': 'gmap',
22 | 'text': 'gmap lets you add geographical information to your applications objects',
23 | 'author': 'Linnovate',
24 | 'link': 'http://www.qed42.com',
25 | 'image': '/meanStarter/assets/img/gmap.png'
26 | },
27 | 'upload': {
28 | 'name': 'Upload',
29 | 'text': 'Upload lets you add upload functionality to MEAN stack',
30 | 'author': 'Linnovate',
31 | 'link': 'http://www.linnovate.net',
32 | 'image': 'http://cdn.designbyhumans.com/pictures/blog/09-2013/pop-culture-cats/Pop_Culture_Cats_Hamilton_Hipster.jpg'
33 | },
34 | 'socket': {
35 | 'name': 'Socket',
36 | 'text': 'Socket.io support',
37 | 'author': 'Linnovate',
38 | 'link': 'http://www.linnovate.net',
39 | 'image': 'http://cdn.designbyhumans.com/pictures/blog/09-2013/pop-culture-cats/Pop_Culture_Cats_Hamilton_Hipster.jpg'
40 | }
41 | };
42 |
43 | $scope.docs = [{
44 | text: 'Overview',
45 | link: 'http://learn.mean.io/#mean-technologies'
46 | }, {
47 | text: 'Packages',
48 | link: 'http://learn.mean.io/#mean-packages'
49 | }, {
50 | text: 'CLI',
51 | link: 'http://learn.mean.io/#mean-cli'
52 | }, {
53 | text: 'Network',
54 | link: 'http://learn.mean.io/#mean-mean-network'
55 | }, {
56 | text: 'Overriding',
57 | link: 'http://learn.mean.io/#mean-packages-overriding-the-default-layouts'
58 | }, {
59 | text: 'Contribution',
60 | link: 'http://learn.mean.io/#mean-packages-contributing-your-package'
61 | }];
62 |
63 | $scope.communities = [{
64 | link: 'https://facebook.com/groups/mean.io/',
65 | text: 'Informal support, news and just hanging out',
66 | icon: 'facebook'
67 | }, {
68 | link: 'https://github.com/linnovate/mean/',
69 | text: 'Issues, Support, Code discussions and PRs',
70 | icon: 'facebook'
71 | }, {
72 | link: 'https://gitter.im/linnovate/mean/',
73 | text: 'Support and Technical discussions',
74 | icon: 'gitter'
75 | }, {
76 | link: 'https://hangout.mean.io/',
77 | text: 'Video support, shared coding and to meet the people behind mean.io',
78 | icon: 'hangout'
79 | }];
80 |
81 | $scope.$watch(function () {
82 | for (var i = 0; i < $scope.sites.length; i += 1) {
83 | if ($scope.sites[i].active) {
84 | return $scope.sites[i];
85 | }
86 | }
87 | }, function (currentSlide, previousSlide) {
88 | if (currentSlide !== previousSlide) {
89 | console.log('currentSlide:', currentSlide);
90 | }
91 | });
92 | }
93 | ]);
94 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mean",
3 | "description": "MEAN.io: A fullstack JavaScript framework powered by MongoDB, ExpressJS, AngularJS, NodeJS.",
4 | "version": "0.7.0",
5 | "private": false,
6 | "author": "Linnovate ",
7 | "contributors": "https://github.com/linnovate/mean/graphs/contributors",
8 | "mean": "0.7.0",
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/linnovate/mean.git"
12 | },
13 | "license": "MIT",
14 | "scripts": {
15 | "start": "cross-env DEBUG=cluster node server",
16 | "mocha": "node tools/test/run-mocha.js",
17 | "karma": "node node_modules/karma/bin/karma start karma.conf.js",
18 | "test": "gulp test",
19 | "test-e2e": "gulp e2e.test",
20 | "postinstall": "node tools/scripts/postinstall.js",
21 | "snyk-protect": "snyk protect",
22 | "prepublish": "npm run snyk-protect"
23 | },
24 | "dependencies": {
25 | "angular": "^1.5.5",
26 | "angular-animate": "^1.5.8",
27 | "angular-aria": "^1.5.8",
28 | "angular-bootstrap": "^0.12.2",
29 | "angular-cookies": "^1.5.2",
30 | "angular-jwt": "^0.1.7",
31 | "angular-material": "^1.1.0",
32 | "angular-mocks": "^1.5.2",
33 | "angular-resource": "^1.5.2",
34 | "angular-route": "^1.5.2",
35 | "angular-sanitize": "^1.5.2",
36 | "angular-ui-router": "0.3.1",
37 | "angular-ui-select": "^0.12.100",
38 | "body-parser": "^1.15.2",
39 | "bootstrap": "^3.3.7",
40 | "compression": "^1.6.2",
41 | "connect-flash": "^0.1.1",
42 | "connect-modrewrite": "^0.9.0",
43 | "consolidate": "^0.14.1",
44 | "cross-env": "^3.0.0",
45 | "debug": "^2.2.0",
46 | "express": "^4.14.0",
47 | "file-loader": "^0.9.0",
48 | "helmet": "^2.2.0",
49 | "jasmine": "^2.5.2",
50 | "lodash": "^4.16.4",
51 | "meanio": "~0.9.3",
52 | "meanio-admin": "git://github.com/linnovate/meanio-admin.git",
53 | "meanio-circles": "git://github.com/linnovate/meanio-circles.git",
54 | "meanio-system": "git://github.com/linnovate/meanio-system.git",
55 | "meanio-users": "git://github.com/linnovate/meanio-users.git",
56 | "morgan": "^1.7.0",
57 | "npm": "^3.10.7",
58 | "protractor": "^4.0.8",
59 | "q": "^1.4.1",
60 | "request": "^2.76.0",
61 | "shelljs": "^0.7.5",
62 | "snyk": "^1.17.5",
63 | "view-helpers": "0.1.5"
64 | },
65 | "devDependencies": {
66 | "babel-core": "^6.18.0",
67 | "babel-loader": "^6.2.7",
68 | "babel-preset-es2015": "^6.18.0",
69 | "babel-preset-stage-1": "^6.16.0",
70 | "css-loader": "^0.25.0",
71 | "del": "^2.2.2",
72 | "expect.js": "^0.3.1",
73 | "file-loader": "^0.9.0",
74 | "gulp": "^3.9.1",
75 | "gulp-concat": "^2.6.0",
76 | "gulp-csslint": "^1.0.0",
77 | "gulp-cssmin": "^0.1.7",
78 | "gulp-jshint": "^2.0.2",
79 | "gulp-less": "^3.1.0",
80 | "gulp-livereload": "^3.8.1",
81 | "gulp-load-plugins": "^1.3.0",
82 | "gulp-mocha": "^3.0.1",
83 | "gulp-nodemon": "^2.2.1",
84 | "gulp-sass": "^2.3.2",
85 | "gulp-uglify": "^2.0.0",
86 | "gulp-util": "^3.0.7",
87 | "jasmine": "^2.5.2",
88 | "jasmine-reporters": "^2.2.0",
89 | "jquery": "^3.1.1",
90 | "jshint": "^2.9.4",
91 | "jshint-stylish": "^2.2.1",
92 | "jsonwebtoken": "^7.1.9",
93 | "karma": "^1.3.0",
94 | "karma-chrome-launcher": "^2.0.0",
95 | "karma-coffee-preprocessor": "^1.0.1",
96 | "karma-coverage": "^1.1.1",
97 | "karma-firefox-launcher": "^1.0.0",
98 | "karma-html2js-preprocessor": "^1.1.0",
99 | "karma-jasmine": "^1.0.2",
100 | "karma-junit-reporter": "^1.1.0",
101 | "karma-ng-html2js-preprocessor": "^1.0.0",
102 | "karma-phantomjs-launcher": "^1.0.2",
103 | "karma-phantomjs-shim": "^1.4.0",
104 | "karma-requirejs": "^1.1.0",
105 | "karma-script-launcher": "^1.0.0",
106 | "karma-webpack": "^1.7.0",
107 | "mocha": "^3.1.2",
108 | "phantomjs-prebuilt": "^2.1.13",
109 | "protractor": "^4.0.10",
110 | "require-dir": "^0.3.1",
111 | "requirejs": "^2.3.2",
112 | "style-loader": "^0.13.1",
113 | "supertest": "^2.0.1",
114 | "through": "^2.3.8",
115 | "url-loader": "^0.5.7",
116 | "webpack": "^1.13.3",
117 | "webpack-dev-server": "^1.16.2"
118 | },
119 | "snyk": true
120 | }
121 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/views/system/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | With MEAN framework, you can create members , articles, or add more features with packages from the
5 | community.
6 |
7 |
8 |
9 |
10 | community
11 | group
12 |
13 |
14 |
15 |
16 |
17 | face
18 | Facebook
19 |
20 |
21 | code
22 | GitHub
23 |
24 |
25 | textsms
26 | Gitter
27 |
28 |
29 | voice_chat
30 | Hangout
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
Browse the Documentation
40 |
41 | Before you jump in it's important to read the documentation and learn about the different aspects of extending and developing MEAN.
42 |
43 |
44 | Mean is based on MongoDB, Express.js, Angular.js and Node.js and even basic proficiency in these technologies will help you dive in to mean development - luckily there are plenty of tutorials around .
45 |
46 |
47 |
48 |
49 | {{doc.text}}
50 |
51 | More Info
52 |
53 |
54 |
55 |
56 |
57 |
Browse our packages
58 | All Packages
59 |
60 |
61 |
62 |
63 |
64 | {{package.name}} - {{package.author}}
65 | {{package.text}}
66 |
67 |
68 |
69 | More Info
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | {{site.name}} - {{site.author}}
81 | {{site.text}}
82 |
83 |
84 |
85 | More Info
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "maxerr" : 50, // {int} Maximum error before stopping
3 |
4 | // Enforcing
5 | "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
6 | "camelcase" : false, // true: Identifiers must be in camelCase
7 | "curly" : false, // true: Require {} for every new block or scope
8 | "eqeqeq" : true, // true: Require triple equals (===) for comparison
9 | "forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
10 | "immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
11 | "indent" : 2, // {int} Number of spaces to use for indentation
12 | "latedef" : false, // false: Allows function hoisting
13 | "newcap" : true, // true: Require capitalization of all constructor functions e.g. `new F()`
14 | "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
15 | "noempty" : true, // true: Prohibit use of empty blocks
16 | "nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
17 | "plusplus" : false, // true: Prohibit use of `++` & `--`
18 | "quotmark" : "single", // Quotation mark consistency:
19 | // false : do nothing (default)
20 | // true : ensure whatever is used is consistent
21 | // "single" : require single quotes
22 | // "double" : require double quotes
23 | "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
24 | "unused" : "vars", // true: Require all defined variables be used
25 | "strict" : true, // true: Requires all functions run in ES5 Strict Mode
26 | "maxparams" : false, // {int} Max number of formal params allowed per function
27 | "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
28 | "maxstatements" : false, // {int} Max number statements per function
29 | "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
30 | "maxlen" : false, // {int} Max number of characters per line
31 |
32 | // Relaxing
33 | "asi" : true, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
34 | "boss" : false, // true: Tolerate assignments where comparisons would be expected
35 | "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
36 | "eqnull" : false, // true: Tolerate use of `== null`
37 | "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
38 | "esnext" : true, // true: Allow ES.next (ES6) syntax (ex: `const`)
39 | "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
40 | // (ex: `for each`, multiple try/catch, function expression…)
41 | "evil" : false, // true: Tolerate use of `eval` and `new Function()`
42 | "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
43 | "funcscope" : false, // true: Tolerate defining variables inside control statements
44 | "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
45 | "iterator" : false, // true: Tolerate using the `__iterator__` property
46 | "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
47 | "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
48 | "laxcomma" : false, // true: Tolerate comma-first style coding
49 | "loopfunc" : false, // true: Tolerate functions being defined in loops
50 | "multistr" : false, // true: Tolerate multi-line strings
51 | "proto" : false, // true: Tolerate using the `__proto__` property
52 | "scripturl" : false, // true: Tolerate script-targeted URLs
53 | "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
54 | "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
55 | "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
56 | "validthis" : false, // true: Tolerate using this in a non-constructor function
57 |
58 | // Environments
59 | "browser" : true, // Web Browser (window, document, etc)
60 | "couch" : false, // CouchDB
61 | "devel" : true, // Development/debugging (alert, confirm, etc)
62 | "dojo" : false, // Dojo Toolkit
63 | "jquery" : false, // jQuery
64 | "mootools" : false, // MooTools
65 | "node" : true, // Node.js
66 | "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
67 | "prototypejs" : false, // Prototype and Scriptaculous
68 | "rhino" : false, // Rhino
69 | "worker" : false, // Web Workers
70 | "wsh" : false, // Windows Scripting Host
71 | "yui" : false, // Yahoo User Interface
72 |
73 | // Custom Globals
74 | "globals": {
75 | "$" : true,
76 | "angular" : true,
77 | "define" : false,
78 | "jasmine" : false,
79 | "require" : false,
80 | "exports" : false,
81 | "module" : false,
82 | "describe" : false,
83 | "before" : false,
84 | "beforeEach" : false,
85 | "after" : false,
86 | "afterEach" : false,
87 | "it" : false,
88 | "inject" : false,
89 | "expect" : false,
90 | "spyOn" : false
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/.snyk:
--------------------------------------------------------------------------------
1 | version: v1.5.2
2 | ignore: {}
3 | patch:
4 | 'npm:minimatch:20160620':
5 | - npm > fstream-npm > fstream-ignore > minimatch:
6 | patched: '2016-07-05T10:40:06.562Z'
7 | npm > node-gyp > rimraf > glob > minimatch:
8 | patched: '2016-08-04T11:07:59.126Z'
9 | - npm > node-gyp > minimatch:
10 | patched: '2016-07-05T10:40:06.562Z'
11 | npm > node-gyp > tar > fstream > rimraf > glob > minimatch:
12 | patched: '2016-08-04T11:07:59.126Z'
13 | - npm > node-gyp > glob > minimatch:
14 | patched: '2016-07-05T10:40:06.562Z'
15 | npm > node-gyp > fstream > rimraf > glob > minimatch:
16 | patched: '2016-08-04T11:07:59.126Z'
17 | - npm > npm-registry-client > rimraf > glob > minimatch:
18 | patched: '2016-07-22T12:56:52.773Z'
19 | npm > node-gyp > glob > minimatch:
20 | patched: '2016-08-04T11:07:59.126Z'
21 | - npm > rimraf > glob > minimatch:
22 | patched: '2016-07-22T12:56:52.773Z'
23 | npm > npm-registry-client > rimraf > glob > minimatch:
24 | patched: '2016-08-04T11:07:59.126Z'
25 | - npm > tar > fstream > rimraf > glob > minimatch:
26 | patched: '2016-07-22T12:56:52.773Z'
27 | npm > rimraf > glob > minimatch:
28 | patched: '2016-08-04T11:07:59.126Z'
29 | - npm > fs-vacuum > rimraf > glob > minimatch:
30 | patched: '2016-07-22T12:56:52.773Z'
31 | npm > tar > fstream > rimraf > glob > minimatch:
32 | patched: '2016-08-04T11:07:59.126Z'
33 | - npm > fstream > rimraf > glob > minimatch:
34 | patched: '2016-07-22T12:56:52.773Z'
35 | npm > fs-vacuum > rimraf > glob > minimatch:
36 | patched: '2016-08-04T11:07:59.126Z'
37 | - npm > fstream-npm > fstream-ignore > fstream > rimraf > glob > minimatch:
38 | patched: '2016-07-22T12:56:52.773Z'
39 | npm > fstream > rimraf > glob > minimatch:
40 | patched: '2016-08-04T11:07:59.126Z'
41 | - npm > glob > minimatch:
42 | patched: '2016-07-22T12:56:52.773Z'
43 | npm > fstream-npm > fstream-ignore > fstream > rimraf > glob > minimatch:
44 | patched: '2016-08-04T11:07:59.126Z'
45 | - npm > read-installed > read-package-json > glob > minimatch:
46 | patched: '2016-07-22T12:56:52.773Z'
47 | npm > glob > minimatch:
48 | patched: '2016-08-04T11:07:59.126Z'
49 | - npm > read-package-json > glob > minimatch:
50 | patched: '2016-07-22T12:56:52.773Z'
51 | npm > read-installed > read-package-json > glob > minimatch:
52 | patched: '2016-08-04T11:07:59.126Z'
53 | - npm > read-package-tree > read-package-json > glob > minimatch:
54 | patched: '2016-07-22T13:20:52.696Z'
55 | npm > read-package-json > glob > minimatch:
56 | patched: '2016-08-04T11:07:59.126Z'
57 | - npm > init-package-json > read-package-json > glob > minimatch:
58 | patched: '2016-07-22T12:56:52.773Z'
59 | npm > read-package-tree > read-package-json > glob > minimatch:
60 | patched: '2016-08-04T11:07:59.126Z'
61 | - npm > init-package-json > glob > minimatch:
62 | patched: '2016-07-22T12:56:52.773Z'
63 | npm > init-package-json > read-package-json > glob > minimatch:
64 | patched: '2016-08-04T11:07:59.126Z'
65 | - npm > fstream-npm > fstream-ignore > minimatch:
66 | patched: '2016-07-22T12:56:52.773Z'
67 | npm > init-package-json > glob > minimatch:
68 | patched: '2016-08-04T11:07:59.126Z'
69 | - npm > node-gyp > minimatch:
70 | patched: '2016-07-22T12:56:52.773Z'
71 | npm > fstream-npm > fstream-ignore > minimatch:
72 | patched: '2016-08-04T11:07:59.126Z'
73 | - npm > node-gyp > glob > minimatch:
74 | patched: '2016-07-22T12:56:52.773Z'
75 | - npm > node-gyp > rimraf > glob > minimatch:
76 | patched: '2016-07-22T12:56:52.773Z'
77 | - npm > node-gyp > tar > fstream > rimraf > glob > minimatch:
78 | patched: '2016-07-22T12:56:52.773Z'
79 | - npm > node-gyp > fstream > rimraf > glob > minimatch:
80 | patched: '2016-07-22T12:56:52.773Z'
81 | - npm > node-gyp > rimraf > glob > minimatch:
82 | patched: '2016-07-22T13:20:52.696Z'
83 | - npm > node-gyp > tar > fstream > rimraf > glob > minimatch:
84 | patched: '2016-07-22T13:20:52.696Z'
85 | - npm > node-gyp > fstream > rimraf > glob > minimatch:
86 | patched: '2016-07-22T13:20:52.696Z'
87 | - npm > node-gyp > glob > minimatch:
88 | patched: '2016-07-22T13:20:52.696Z'
89 | - npm > npm-registry-client > rimraf > glob > minimatch:
90 | patched: '2016-07-22T13:20:52.696Z'
91 | - npm > rimraf > glob > minimatch:
92 | patched: '2016-07-22T13:20:52.696Z'
93 | - npm > tar > fstream > rimraf > glob > minimatch:
94 | patched: '2016-07-22T13:20:52.696Z'
95 | - npm > fs-vacuum > rimraf > glob > minimatch:
96 | patched: '2016-07-22T13:20:52.696Z'
97 | - npm > fstream > rimraf > glob > minimatch:
98 | patched: '2016-07-22T13:20:52.696Z'
99 | - npm > fstream-npm > fstream-ignore > fstream > rimraf > glob > minimatch:
100 | patched: '2016-07-22T13:20:52.696Z'
101 | - npm > glob > minimatch:
102 | patched: '2016-07-22T13:20:52.696Z'
103 | - npm > read-installed > read-package-json > glob > minimatch:
104 | patched: '2016-07-22T13:20:52.696Z'
105 | - npm > read-package-json > glob > minimatch:
106 | patched: '2016-07-22T13:20:52.696Z'
107 | - npm > init-package-json > read-package-json > glob > minimatch:
108 | patched: '2016-07-22T13:20:52.696Z'
109 | - npm > init-package-json > glob > minimatch:
110 | patched: '2016-07-22T13:20:52.696Z'
111 | - npm > fstream-npm > fstream-ignore > minimatch:
112 | patched: '2016-07-22T13:20:52.696Z'
113 | 'npm:uglify-js:20151024':
114 | - meanio > swig > uglify-js:
115 | patched: '2016-08-04T11:07:59.126Z'
116 | 'npm:tough-cookie:20160722':
117 | - npm > npm-registry-client > request > tough-cookie:
118 | patched: '2016-08-04T11:07:59.126Z'
119 | - npm > request > tough-cookie:
120 | patched: '2016-08-04T11:07:59.126Z'
121 | - npm > node-gyp > request > tough-cookie:
122 | patched: '2016-08-04T11:07:59.126Z'
123 |
--------------------------------------------------------------------------------
/gulp/development.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /* jshint -W040 */
4 |
5 | var gulp = require('gulp');
6 | var gulpLoadPlugins = require('gulp-load-plugins');
7 | var through = require('through');
8 | var gutil = require('gulp-util');
9 | var plugins = gulpLoadPlugins();
10 | var path = require('path');
11 | var paths = {
12 | js: ['./*.js', 'config/**/*.js', 'gulp/**/*.js', 'tools/**/*.js', 'packages/**/*.js', '!packages/**/node_modules/**', '!packages/**/assets/**/lib/**', '!packages/**/assets/**/js/**'],
13 | html: ['packages/**/*.html', '!packages/**/node_modules/**', '!packages/**/assets/**/lib/**'],
14 | css: ['packages/**/*.css', '!packages/**/node_modules/**', '!packages/**/assets/**/lib/**'],
15 | less: ['packages/**/*.less', '!packages/**/_*.less', '!packages/**/node_modules/**', '!packages/**/assets/**/lib/**'],
16 | sass: ['packages/**/*.scss', '!packages/**/node_modules/**', '!packages/**/assets/**/lib/**']
17 | };
18 | var webpack = require('webpack');
19 | var webpackConfig = require('../webpack.config.js');
20 |
21 | /** General watch/restart flow **/
22 | // .less / .scss files are watched by less/sass and produce .css files
23 | // .js / .css files are watched by nodemon, invoke webpack,csslint, and jshint as needed before restarting and invoking livereload after
24 | // .html files are watched by livereload explicitly
25 |
26 | var startupTasks = ['devServe'];
27 |
28 | gulp.task('development', startupTasks);
29 | gulp.task('devServe', ['env:development', 'webpack:build-dev', 'jshint', 'csslint', 'watch'], devServeTask);
30 | gulp.task('env:development', envDevelopmentTask);
31 | gulp.task('webpack:build-dev', ['sass', 'less'], webpackBuild);
32 | gulp.task('sass', sassTask);
33 | gulp.task('less', lessTask);
34 | gulp.task('jshint', jshintTask);
35 | gulp.task('csslint', csslintTask);
36 |
37 | gulp.task('webpack:rebuild-dev', webpackBuild);
38 | gulp.task('watch', watchTask);
39 | gulp.task('livereload', livereloadTask);
40 |
41 | ////////////////////////////////////////////////////////////////////
42 |
43 | // modify some webpack config options
44 | var devConfig = Object.create(webpackConfig);
45 | devConfig.devtool = 'sourcemap';
46 | devConfig.debug = true;
47 | // create a single instance of the compiler to allow caching
48 | var devCompiler = webpack(devConfig);
49 |
50 | function webpackBuild (callback) {
51 | // run webpack
52 | devCompiler.run(function (err, stats) {
53 | if (err) {
54 | throw new gutil.PluginError('webpackBuild', err);
55 | }
56 | gutil.log('webpackBuild', stats.toString({
57 | colors: true
58 | }));
59 | callback()
60 | })
61 | }
62 |
63 | function jshintTask (callback) {
64 | gulp.src(paths.js)
65 | .pipe(plugins.jshint())
66 | .pipe(plugins.jshint.reporter('jshint-stylish'))
67 | .pipe(count('jshint', 'files lint free'));
68 | callback();
69 | }
70 |
71 | function envDevelopmentTask (callback) {
72 | process.env.NODE_ENV = 'development';
73 | callback();
74 | }
75 |
76 | function csslintTask () {
77 | return gulp.src(paths.css)
78 | .pipe(plugins.csslint('.csslintrc'))
79 | .pipe(plugins.csslint.formatter())
80 | .pipe(count('csslint', 'files lint free'));
81 | }
82 |
83 | function lessTask () {
84 | return gulp.src(paths.less)
85 | .pipe(plugins.less())
86 | .pipe(gulp.dest('./packages'));
87 | }
88 |
89 | function sassTask () {
90 | return gulp.src(paths.sass)
91 | .pipe(plugins.sass().on('error', plugins.sass.logError))
92 | .pipe(gulp.dest('./packages'));
93 | }
94 |
95 | function devServeTask () {
96 | plugins.nodemon({
97 | script: 'server.js',
98 | ext: 'js css',
99 | env: {
100 | 'NODE_ENV': 'development'
101 | },
102 | ignore: [
103 | 'node_modules/',
104 | 'bower_components/',
105 | 'bundle/', // Causes infinite loop since webpack is tasked to run
106 | 'logs/',
107 | 'packages/*/*/public/assets/lib/',
108 | 'packages/*/*/public/**/*.scss', // Trigger off resulting css files not before scss finishes
109 | 'packages/*/*/public/**/*.less', // Trigger off resulting css files not before less finishes
110 | 'packages/*/*/node_modules/',
111 | '.DS_Store', '**/.DS_Store',
112 | '.bower-*',
113 | '**/.bower-*',
114 | '**/tests'
115 | ],
116 | tasks: function (changedFiles) {
117 | var tasks = [];
118 | changedFiles.forEach(function (file) {
119 | if (path.extname(file) === '.css' && tasks.indexOf('csslint') === -1) {
120 | tasks.push('csslint');
121 | }
122 | if (path.extname(file) === '.js' && tasks.indexOf('jshint') === -1) {
123 | tasks.push('jshint');
124 | }
125 | if (path.extname(file) === '.js' || path.extname(file) === '.css' && tasks.indexOf('webpack:rebuild-dev') === -1) {
126 | tasks.push('webpack:rebuild-dev');
127 | }
128 | });
129 | return tasks;
130 | },
131 | nodeArgs: ['--debug'],
132 | stdout: false
133 | })
134 | .on('readable', function () {
135 | this.stdout.on('data', function (chunk) {
136 | if (/Mean app started/.test(chunk)) {
137 | setTimeout(function () {
138 | plugins.livereload.reload();
139 | }, 500)
140 | }
141 | process.stdout.write(chunk)
142 | });
143 | this.stderr.pipe(process.stderr)
144 | })
145 | .on('restart', function () {
146 | plugins.livereload.reload();
147 | });
148 | }
149 |
150 | function watchTask (callback) {
151 | plugins.livereload.listen({
152 | interval: 500
153 | });
154 |
155 | gulp.watch(paths.html, ['livereload']);
156 | gulp.watch(paths.less, ['less']);
157 | gulp.watch(paths.sass, ['sass']);
158 | callback();
159 | }
160 |
161 | function livereloadTask (callback) {
162 | plugins.livereload.reload();
163 | callback();
164 | }
165 |
166 | function count (taskName, message) {
167 | var fileCount = 0;
168 |
169 | function countFiles (file) {
170 | fileCount++;
171 | }
172 |
173 | function endStream () {
174 | gutil.log(gutil.colors.cyan(taskName + ': ') + fileCount + ' ' + message || 'files processed.');
175 | this.emit('end');
176 | }
177 |
178 | return through(countFiles, endStream);
179 | }
180 |
--------------------------------------------------------------------------------
/README.MD:
--------------------------------------------------------------------------------
1 | [](https://travis-ci.org/linnovate/mean)
2 | [](https://david-dm.org/linnovate/mean)
3 | [](https://gitter.im/linnovate/mean?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4 | [](https://snyk.io/test/github/linnovate/mean)
5 |
6 | # [](http://mean.io/) MEAN Stack
7 |
8 | MEAN is a framework for an easy starting point with [MongoDB](https://www.mongodb.org/), [Node.js](http://www.nodejs.org/), [Express](http://expressjs.com/), and [AngularJS](https://angularjs.org/) based applications. It is designed to give you a quick and organized way to start developing MEAN based web apps with useful modules like Mongoose and Passport pre-bundled and configured. We mainly try to take care of the connection points between existing popular frameworks and solve common integration problems.
9 |
10 | ## Prerequisite Technologies
11 | ### Linux
12 | * *Node.js* - Download and Install Node.js, nodeschool has free node tutorials to get you started. We recommend node-4.x as the preferred node version to run mean.io.
13 | * *MongoDB* - Download and Install mongodb - Checkout their manual if you're just starting.
14 |
15 | If you're using ubuntu, this is the preferred repository to use...
16 |
17 | ```bash
18 | $ curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
19 | $ sudo apt-get update
20 | $ sudo apt-get install nodejs
21 | ```
22 |
23 | * *Git* - Get git using a package manager or download it.
24 |
25 | ### Windows
26 | * *Node.js* - Download and Install Node.js, nodeschool has free node tutorials to get you started.
27 | * *MongoDB* - Follow the great tutorial from the mongodb site - "Install Mongodb On Windows"
28 | * *Git* - The easiest way to install git and then run the rest of the commands through the *git bash* application (via command prompt) is by downloading and installing Git for Windows
29 |
30 | ### OSX
31 | * *Node.js* - Download and Install Node.js or use the packages within brew or macports.
32 | * *MongoDB* - Follow the tutorial here - Install mongodb on OSX
33 | * *git* - Get git from here .
34 |
35 | ## Prerequisite packages
36 |
37 | * Mean currently uses gulp as a build tool and bower to manage frontend packages.
38 | ```
39 | $ npm install -g gulp
40 | // and bower
41 | $ npm install -g bower
42 | ```
43 |
44 | ## Installation
45 | To start with MEAN install the `mean-cli` package from NPM.
46 | This will add the *mean* command which lets you interact (install, manage, update ...) your Mean based application.
47 |
48 | ### Install the MEAN CLI
49 |
50 | In linux install in globally as root
51 | ```bash
52 | $ sudo npm install -g mean-cli
53 | $ mean init
54 | $ cd && npm install
55 | ```
56 |
57 | ### Invoke node with a task manager
58 | Mean supports the gulp task runner for various services which are applied on the code.
59 | To start your application run -
60 | ```bash
61 | $ gulp
62 | ```
63 |
64 | Alternatively, when not using `gulp` (and for production environments) you can run:
65 | ```bash
66 | $ node server
67 | ```
68 | Then, open a browser and go to:
69 | ```bash
70 | http://localhost:3000
71 | ```
72 |
73 | ### Running on a different port
74 | If you have a rails, node, or other mean project already running, you may need to use a different port. You can set the port and start your new mean project with one command:
75 | ```bash
76 | $ export PORT=3001 && gulp
77 | ```
78 |
79 | Then, open a browser and change the port number before you visit:
80 | ```bash
81 | http://localhost:3001
82 | ```
83 |
84 | ### Troubleshooting
85 | During installation depending on your os and prerequisite versions you may encounter some issues.
86 |
87 | Most issues can be solved by one of the following tips, but if you are unable to find a solution feel free to contact us via the repository issue tracker or the links provided below.
88 |
89 | #### Update NPM, Bower or Gulp
90 | Sometimes you may find there is a weird error during install like npm's *Error: ENOENT*. Usually updating those tools to the latest version solves the issue.
91 |
92 | * Updating NPM:
93 | ```bash
94 | $ npm update -g npm
95 | ```
96 |
97 | * Updating Gulp:
98 | ```bash
99 | $ npm update -g gulp
100 | ```
101 |
102 | * Updating Bower:
103 | ```bash
104 | $ npm update -g bower
105 | ```
106 |
107 | #### Cleaning NPM and Bower cache
108 | NPM and Bower has a caching system for holding packages that you already installed.
109 | We found that often cleaning the cache solves some troubles this system creates.
110 |
111 | * NPM Clean Cache:
112 | ```bash
113 | $ npm cache clean
114 | ```
115 |
116 | * Bower Clean Cache:
117 | ```bash
118 | $ bower cache clean
119 | ```
120 |
121 | #### Installation problems on Windows 8 / 8.1
122 | Some of Mean.io dependencies uses [node-gyp](https://github.com/nodejs/node-gyp) with supported Python version 2.7.x. So if you see an error related to node-gyp rebuild follow next steps:
123 |
124 | 1. install [Python 2.7.x](https://www.python.org/downloads/)
125 | 2. install [Microsoft Visual Studio C++ 2012 Express](http://www.microsoft.com/en-us/download/details.aspx?id=34673)
126 | 3. Run NPM update
127 |
128 | ```bash
129 | $ npm update -g
130 | ```
131 |
132 | #### Git "not found" on Windows
133 | If you get this error when trying to `mean init`:
134 |
135 | ```text
136 | Prerequisite not installed: git
137 | ```
138 |
139 | And you definitely have Git for Windows installed, then it's not included in your path. Find the folder containing git.exe (likely `C:\Program Files (x86)\Git\cmd`) and add it to your PATH.
140 |
141 | ## Technologies
142 |
143 | ### The MEAN stack
144 |
145 | MEAN is an acronym for *M*ongo, *E*xpress.js , *A*ngular.js and *N*ode.js
146 |
147 |
148 | MongoDB
149 | Go through MongoDB Official Website and proceed to its Great Manual , which should help you understand NoSQL and MongoDB better.
150 | Express
151 | The best way to understand express is through its Official Website , particularly The Express Guide ; you can also go through this StackOverflow thread for more resources.
152 | AngularJS
153 | Angular's Official Website is a great starting point. CodeSchool and google created a great tutorial for beginners, and the angular videos by Egghead .
154 | Node.js
155 | Start by going through Node.js Official Website and the documentation page as well as this StackOverflow thread , which should get you going with the Node.js platform in no time.
156 |
157 |
158 | ### Additional Tools
159 | * Mongoose - The mongodb node.js driver in charge of providing elegant mongodb object modeling for node.js
160 | * Passport - An authentication middleware for Node.js which supports authentication using a username and password, Facebook, Twitter, and more.
161 | * Twitter Bootstrap - The most popular HTML, CSS, and JS framework for developing responsive, mobile first projects.
162 | * UI Bootstrap - Bootstrap components written in pure AngularJS
163 |
164 |
165 | ## CLI
166 | ### Overview
167 |
168 | The MEAN CLI is a simple Command Line Interface for installing and managing MEAN applications. As a core module of the Mean.io project, it provides a number of useful tools to make interaction with your MEAN application easier, with features such as: scaffolding, module creation and admin, status checks, and user management.
169 | ```bash
170 | $ mean
171 | $ mean --help
172 | $ mean help
173 | ```
174 | mean help can also be used in conjunction with any command to get more information about that particular functionality. For example, try mean help init to see the options for init
175 | ```bash
176 | $ mean help [command]
177 | ```
178 | ### Users
179 |
180 | Information can be display for a specific customer via mean user email. Email is required. User roles can be assigned or removed with the --addRole (or -a) and --removeRole (or -r) options, respectively.
181 | For example, the admin role is required to edit tokens.
182 |
183 | ```bash
184 | $ mean user
185 | $ mean user --addRole ;
186 | $ mean user --removeRole ;
187 | ```
188 |
189 | ### Packages
190 | #### Management
191 | All of the remaining of the commands must be run from the root folder of your MEAN application.
192 | Contributed MEAN packages can be installed or uninstalled via the CLI. Also, currently installed modules can be viewed with the list command.
193 |
194 | ```bash
195 | $ mean list
196 | $ mean install
197 | $ mean uninstall
198 | ```
199 |
200 | Mean packages installed via the installer are found in /node_modules
201 | #### Search
202 | To find new packages run the *mean search* command
203 | ```bash
204 | $ mean search [packagename]
205 | ```
206 | `mean search` will return all of the available packages, `mean search [packagename]` will filter the search results.
207 |
208 | #### Scaffolding
209 | To create a new MEAN app, run mean init. Name for the application is optional. If no name is provided, "mean" is used. The MEAN project will be cloned from GitHub into a directory of the application name.
210 | ```bash
211 | $ mean init [name]
212 | $ cd [name] && npm install
213 | ```
214 | Note: git must be installed for this command to work properly.
215 |
216 | ### Misc
217 | Status
218 | Check the database connection for a particular environment (e.g. development (default), test, production) and make sure that the meanio command line version is up to date.
219 | ```bash
220 | $ mean status
221 | ```
222 | Docs
223 | A simple shortcut to open the mean documentation in your default browser.
224 | ```bash
225 | $ mean docs
226 | ```
227 |
228 | ## Packages
229 |
230 | Everything in mean.io is a package and when extending mean with custom functionality make sure you create your own package and do not alter the core packages.
231 |
232 | The mean.io package system allows developers to create modular code that provides useful tools that other mean developers can use. The packages, when published, are plug-and-play and are used in a way very similar to traditional npm packages.
233 |
234 | The mean.io package system integrates all the packages into the mean project as if the code was part of mean itself and provides the developers with all the necessary tools required to integrate their package into the host project.
235 |
236 | There are two types of packages:
237 |
238 | **Custom Packages** are generated by the mean scaffolder and contain most of your application logic. Custom packages are found in */packages/custom* and can be published as a contrib package for use by other developers.
239 |
240 | **Contrib Packages** are installed by the mean installer and are found at */packages/contrib*. Contrib packages are "plug and play".
241 |
242 | ### Core Packages
243 |
244 | All `Core` packages can be overridden by other packages allowing you to extend and adapt it to fit your specific needs. See `Overriding views` for detailed examples.
245 |
246 |
247 | #### System
248 | The "system" package creates the basic pages as well as defines the layout of the site and integrates the menu into the page. The system package also allows us to define things such as rendering engines, static files and routing on the client and server side.
249 | #### Users
250 | The "users" package creates the database model of the user, provides validation as well as various login and registration features.
251 | #### Access
252 | The "access" package manages permissions and middleware. It controls the various authentication methods and is dependent on the users package
253 | #### Theme
254 | The "theme" package adds some basic CSS and other assets such as images and backgrounds
255 | #### Articles
256 | The "articles" package is typically used as an example starting point for managing content that might be used in a blog or cms. The full CRUD is implemented on the server and client.
257 | ### File structure
258 | The file structure is similar to that of the mean project itself
259 |
260 | `Fundamental` Files at the `root` of the package
261 |
262 | **Server**
263 |
264 | Packages are registered in the **app.js**
265 | Defines package name, version and `mean=true` in the **package.json**
266 |
267 | All of the Server side code resides in the `/server` directory.
268 |
269 | Server
270 | --- config # Configuration files
271 | --- controllers # Server side logic goes here
272 | --- models # Database Schema Models
273 | --- routes # Rest api endpoints for routing
274 | --- views # Swig based html rendering
275 |
276 | **Client**
277 |
278 | All of the Client side code resides in the `/public` directory.
279 |
280 | public
281 | --- assets # JavaScript/CSS/Images (not aggregated)
282 | --- controllers # Angular controllers
283 | --- config # Contains routing files
284 | --- services # Angular services (also directive and filter folders)
285 | --- views # Angular views
286 |
287 | All JavaScript within `public` is automatically aggregated with the exception of files in `public/assets`, which can be manually added using the `aggregateAsset()` function.
288 |
289 | Files within the `public` directory of the package can be accessed externally at `/[package-name]/path-to-file-relative-to-public`. For example, to access the `Tokens` Angular controller, `tokens/controllers/tokens.js`.
290 |
291 | ###Registering a Package
292 |
293 | In order for a Package to work it needs to be registered. By doing this you make the package system aware that you are ready and that other packages are able to depend on you. The packages are registered from within `app.js`.
294 |
295 | When registering you are required to declare all your dependencies in order for the package system to make them available to your package.
296 |
297 | ```javascript
298 | // Example of registering the MyPackage
299 | MyPackage.register(function(app, auth, database) {
300 | // ...
301 | });
302 | ```
303 |
304 | MEAN has 3 pre registered dependencies:
305 | - `app` Makes the express app available .
306 | - `auth` Includes some basic authentication functions
307 | - `database` Contains the Mongoose database connection
308 |
309 | > All dependencies specified must be registered in order to use them
310 |
311 | ###Dependency Injection
312 |
313 | > An injection is the passing of a dependency (a service) to a dependent
314 | > object (a client). The service is made part of the client's state.
315 | > Passing the service to the client, rather than allowing a client to
316 | > build or find the service, is the fundamental requirement of the
317 | > pattern. [Wikipedia](https://en.wikipedia.org/wiki/Dependency_injection)
318 |
319 |
320 | Dependency injection allows you to declare what dependencies you require and rely on the package system to resolve all dependencies for you. Any package registered is automatically made available to anyone who would like to depend on them.
321 |
322 | Looking again at the registration example we can see that `MyPackage` depends on the `Tokens` package and can make use of its full functionality, including overriding it.
323 |
324 | ```javascript
325 | // Example of registering the tokens package
326 | MyPackage.register(function(app, auth, database, Tokens) {
327 |
328 | // I can make use of the tokens within my module
329 | MyPackage.someExampleFunction('some parameter');
330 |
331 | // I can override functions
332 | MyPackage.someExampleFunction = function(param) {
333 | //my custom logic goes here
334 | };
335 | });
336 | ```
337 |
338 | > Packages when in code are used in a capitalized form
339 |
340 | ###Angular Modules and Dependencies
341 |
342 | Every package registration automatically creates a corresponding angular module of the form `mean.[package-name]`
343 |
344 | The package system injects this information into the mean init functions and allows developers to base their controllers, services, filters, directives etc on either an existing module or on their own one.
345 |
346 | In addition you are able to declare which angular dependencies you want your angular module to use.
347 |
348 | Below is an example of adding an angular dependency to our angular module.
349 |
350 | ```javascript
351 | // Example of adding an angular dependency of the ngDragDrop to the
352 | MyPackage.angularDependencies(['ngDragDrop']);
353 | ```
354 |
355 | > See the assets section for an example how to add external libraries to
356 | > the client such as the `gDragDrop `javascript library
357 |
358 | ###Assets and Aggregation
359 |
360 | All assets such as images, javascript libraries and CSS stylesheets should be within `public/assets` of the package file structure.
361 |
362 | Javascript and CSS from `assets` can be aggregated to the global aggregation files. By default all javascript is automatically wrapped within an anonymous function unless given the option `{global:true}` to not enclose the javascript within a contained scope
363 |
364 | ```javascript
365 |
366 | //Adding jquery to the mean project
367 | MyPackage.aggregateAsset('js','jquery.min.js');
368 |
369 | //Adding another library - global by default is false
370 | MyPackage.aggregateAsset('js','jquery.min.js', {global:true});
371 |
372 | //Adding some css to the mean project
373 | MyPackage.aggregateAsset('css','default.css');
374 | ```
375 |
376 | > Javascript files outside of assets are automatically aggregated and
377 | > injected into the mean project. As a result libraries that you do not
378 | > want aggregated should be placed within `public/assets/js`
379 |
380 | The aggregation supports the ability to control the location of where to inject the aggregated code and if you add a weight and a group to your aggregateAsset method you can make sure it's included in the correct region.
381 |
382 | ```javascript
383 | MyPackage.aggregateAsset('js','first.js',{global:true, weight: -4, group: 'header'});
384 | ```
385 |
386 | >The line that gets loaded in your head.html calls the header group and injects the js you want to include first-
387 | > in packages/system/server/views/includes/head.html
388 | >
389 |
390 | ###Settings Object
391 | The settings object is a persistence object that is stored in the packages collection and allows for saving persistent information per package such as configuration options or admin settings for the package.
392 |
393 | Receives two arguments the first being the settings object the second is a callback function
394 |
395 | ```javascript
396 | MyPackage.settings({'someSetting':'some value'}, function (err, settings) {
397 | // You will receive the settings object on success
398 | });
399 |
400 | // Another save settings example this time with no callback
401 | // This writes over the last settings.
402 | MyPackage.settings({'anotherSettings':'some value'});
403 |
404 | // Get settings. Retrieves latest saved settings
405 | MyPackage.settings(function (err, settings) {
406 | // You now have the settings object
407 | });
408 | ```
409 |
410 | > Each time you save settings you overwrite your previous value.
411 | > Settings are designed to be used to store basic configuration options
412 | > and should not be used as a large data store
413 |
414 |
415 | ###Express Routes
416 | All routing to server side controllers is handled by express routes. The package system uses the typical express approach. The package system has a route function that passes along the package object to the main routing file typically `server/routes/myPackage.js`
417 |
418 | By default the Package Object is passed to the routes along with the other arguments
419 | `MyPackage.routes(app, auth, database);`
420 |
421 |
422 | Example from the `server/routes/myPackage.js`
423 |
424 | ```javascript
425 | // The Package is past automatically as first parameter
426 | module.exports = function(MyPackage, app, auth, database) {
427 |
428 | // example route
429 | app.get('/myPackage/example/anyone', function (req,res,next) {
430 | res.send('Anyone can access this');
431 | });
432 | };
433 | ```
434 |
435 | ###Angular Routes
436 | The angular routes are defined in `public/routes/myPackage.js`. Just like the latest version of mean, the packages use the `$stateProvider`
437 |
438 | ```javascript
439 | $stateProvider
440 | .state('myPackage example page', {
441 | url: '/myPackage/example',
442 | templateUrl: 'myPackage/views/index.html'
443 | });
444 | ```
445 |
446 | > The angular views are publically accessible via templateUrl when
447 | > prefixed with the package name
448 |
449 | ###Menu System
450 |
451 | Packages are able to hook into an existing menu system and add links to various menus integrated within Mean.
452 |
453 | Each link specifies its `title`, `template`, `menu` and `role` that is allowed to see the link. If the menu specified does not exist, a new menu will be created. The menu object is made accessible within the client by means of a *menu angular service* that queries the menu controller for information about links.
454 |
455 | Below is an example how to add a link to the main menu from `app.js`
456 |
457 | ```javascript
458 | //We are adding a link to the main menu for all authenticated users
459 | MyPackage.menus.add({
460 | title: "myPackage example page",
461 | link: "myPackage example page",
462 | roles: ["authenticated"],
463 | menu: "main"
464 | });
465 | ```
466 |
467 |
468 | > You can look at the angular header controller in the mean project for
469 | > more info. You can find it `public/system/controllers/header.js` and
470 | > see how the menu service is implemented
471 |
472 | ###Html View Rendering
473 | The packages come built in with a rendering function allowing packages to render static html. The default templating engine is *swig*. The views are found in `server/views` of the package and should end with the `.html` suffix
474 |
475 | Below is an example rendering some simple html
476 |
477 | ```javascript
478 | app.get('/myPackage/example/render', function (req,res,next) {
479 | MyPackage.render('index', {packageName:'myPackage'}, function (err, html) {
480 | //Rendering a view from the Package server/views
481 | res.send(html);
482 | });
483 | });
484 | ```
485 |
486 | ###Overriding the default layouts
487 | One is able to override the default layout of the application through a custom package.
488 |
489 | Below is an example overriding the default layout of system and instead using the layouts found locally within the package
490 |
491 | ```javascript
492 | MyPackage.register(function(system, app) {
493 | app.set('views', __dirname + '/server/views');
494 | // ...
495 | ```
496 |
497 | > Please note that the package must depend on `System` to ensure it is
498 | > evaluated after `System` and can thus override the views folder
499 |
500 | ### Overriding views
501 | You may override public views used by certain core packages. To create a custom home page, you would create a custom package and modify the script in it's public folder like so:
502 |
503 | ```javascript
504 | angular.module('mean.mycustompackage', ['mean.system'])
505 | .config(['$viewPathProvider', function($viewPathProvider) {
506 | $viewPathProvider.override('system/views/index.html', 'mycustompackage/views/myhomepage.html');
507 | }]);
508 | ```
509 |
510 | This will render *mycustompackage/views/myhomepage.html* as the home page.
511 |
512 | ### Creating your own package
513 | To create your own package and scaffold its initial code, run the following command:
514 |
515 | ```bash
516 | $ mean package
517 | ```
518 |
519 | This will create a package under */packages/custom/pkgName*
520 |
521 | ### Deleting a package
522 | To delete your package, and remove its files:
523 |
524 | ```bash
525 | $ mean uninstall myPackage
526 | ```
527 | Where "myPackage" is the name of your package.
528 |
529 |
530 | ### Contributing your package
531 | Once your package is in good shape and you want to share it with the world you can start the process of contributing it and submitting it so it can be included in the package repository.
532 | To contribute your package register to the network (see the section below) and run
533 |
534 | ```bash
535 | $ mean register # register to the mean network (see below)
536 | $ cd
537 | $ mean publish
538 | ```
539 |
540 | ## MEAN Network
541 | Mean is a stand-alone instance that you can install locally or host on your server.
542 | We want to provide value to developers and are assembling a set of services which will be called the mean network.
543 | We're building all of this as we speak but we already have some elements in place.
544 |
545 | ### Network User Management
546 |
547 | #### Registration
548 | ```bash
549 | $ mean register
550 | ```
551 | #### Identity
552 | ```bash
553 | $ mean whoami
554 | ```
555 | ### Deploy
556 | Coming soon!
557 |
558 | ## Config
559 | All the configuration is specified in the [config](/config/) folder,
560 | through the [env](config/env/) files, and is orchestrated through the [meanio](https://github.com/linnovate/meanio) NPM module.
561 | Here you will need to specify your application name, database name, and hook up any social app keys if you want integration with Twitter, Facebook, GitHub, or Google.
562 |
563 | ### Environmental Settings
564 |
565 | There is a shared environment config: __all__
566 |
567 | * __root__ - This the default root path for the application.
568 | * __port__ - DEPRECATED to __http.port__ or __https.port__.
569 | * __http.port__ - This sets the default application port.
570 | * __https__ - These settings are for running HTTPS / SSL for a secure application.
571 | * __port__ - This sets the default application port for HTTPS / SSL. If HTTPS is not used then is value is to be set to __false__ which is the default setting. If HTTPS is to be used the standard HTTPS port is __443__.
572 | * __ssl.key__ - The path to public key.
573 | * __ssl.cert__ - The path to certificate.
574 |
575 | There are three environments provided by default: __development__, __test__, and __production__.
576 | Each of these environments has the following configuration options:
577 |
578 | * __db__ - This is where you specify the MongoDB / Mongoose settings
579 | * __url__ - This is the url/name of the MongoDB database to use, and is set by default to __mean-dev__ for the development environment.
580 | * __debug__ - Setting this option to __true__ will log the output all Mongoose executed collection methods to your console. The default is set to __true__ for the development environment.
581 | * __options__ - These are the database options that will be passed directly to mongoose.connect in the __production__ environment: [server, replset, user, pass, auth, mongos] (http://mongoosejs.com/docs/connections.html#options) or read [this] (http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#mongoclient-connect-options) for more information.
582 | * __app.name__ - This is the name of your app or website, and can be different for each environment. You can tell which environment you are running by looking at the TITLE attribute that your app generates.
583 | * __Social OAuth Keys__ - Facebook, GitHub, Google, Twitter. You can specify your own social application keys here for each platform:
584 | * __clientID__
585 | * __clientSecret__
586 | * __callbackURL__
587 | * __emailFrom__ - This is the from email address displayed when sending an email.
588 | * __mailer__ - This is where you enter your email service provider, username and password.
589 |
590 | To run with a different environment, just specify NODE_ENV as you call gulp:
591 | ```bash
592 | $ NODE_ENV=test gulp
593 | ```
594 | If you are using node instead of gulp, it is very similar:
595 | ```bash
596 | $ NODE_ENV=test node server
597 | ```
598 | To simply run tests
599 | ```bash
600 | $ npm test
601 | ```
602 | > NOTE: Running Node.js applications in the __production__ environment enables caching, which is disabled by default in all other environments.
603 |
604 | ### Logging
605 |
606 | As from mean-0.4.4 control over the logging format has been delegated to the env configuration files.
607 | The formats and implementation are done using the morgan node module and it's [predefined format](https://github.com/expressjs/morgan#predefined-formats)
608 | Within each configuration file (config/env/development.js) for instance you state the format in the 'logging' object.
609 | ```
610 | 'use strict';
611 |
612 | module.exports = {
613 | db: 'mongodb://' + (process.env.DB_PORT_27017_TCP_ADDR || 'localhost') + '/mean-dev',
614 | debug: true,
615 | logging: {
616 | format: 'tiny'
617 | },
618 | ```
619 |
620 | The default for the development environment uses [tiny format](https://github.com/expressjs/morgan#tiny)
621 | ```
622 | GET /system/views/index.html 304 2.379 ms - -
623 | GET /admin/menu/main 304 8.687 ms - -
624 | GET /system/assets/img/logos/meanlogo.png 304 2.803 ms - -
625 | GET /system/assets/img/backgrounds/footer-bg.png 304 4.481 ms - -
626 | GET /system/assets/img/ninja/footer-ninja.png 304 3.309 ms - -
627 | GET /system/assets/img/logos/linnovate.png 304 3.001 ms - -
628 | ```
629 |
630 | The production uses the widely used [combined format](https://github.com/expressjs/morgan#combined).
631 | ```
632 | :1 - - [22/Mar/2015:13:13:42 +0000] "GET /modules/aggregated.js HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
633 | ::1 - - [22/Mar/2015:13:13:42 +0000] "GET /modules/aggregated.js?group=header HTTP/1.1" 200 0 "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
634 | ::1 - - [22/Mar/2015:13:13:42 +0000] "GET / HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
635 | ::1 - - [22/Mar/2015:13:13:42 +0000] "GET /modules/aggregated.css HTTP/1.1" 200 - "http://localhost:3000/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36"
636 | ```
637 |
638 | ## Staying up to date
639 | After initializing a project, you'll see that the root directory of your project is already a git repository. MEAN uses git to download and update its own code. To handle its own operations, MEAN creates a remote called `upstream`. This way you can use git as you would in any other project.
640 |
641 | To update your MEAN app to the latest version of MEAN
642 |
643 | ```bash
644 | $ git pull upstream master
645 | $ npm install
646 | ```
647 |
648 | To maintain your own public or private repository, add your repository as remote. See here for information on [adding an existing project to GitHub](https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/).
649 |
650 | ```bash
651 | $ git remote add origin
652 | $ git push -u origin master
653 | ```
654 |
655 |
656 | ## Hosting MEAN
657 | Since version 0.4.2 MEAN provides a command to easily upload your app to the *mean cloud*.
658 | To do so all you need to do is the following steps.
659 |
660 | 1. make sure you have a unique name for your app (not the default mean) and that the name is in the package.json
661 | 1. Run `mean deploy`
662 | 1. It will create the meanio remote which can be used to update your remote app by `git push meanio master`
663 | 1. You can add remote command using the --remote flag for instance to add a role to a user on the remote cloud instance run `mean user -a RoleName emailAddress --remote`
664 | 1. To get an idea of whats happening on the mean log (node.js based logging) run `mean logs -n 100` to get the last 100 lines...
665 |
666 | ### Heroku
667 | Before you start make sure you have the [Heroku toolbelt](https://toolbelt.heroku.com/)
668 | installed and an accessible MongoDB instance - you can try [MongoHQ](https://www.compose.io/)
669 | which has an easy setup).
670 |
671 | Add the db string to the production env in *server/config/env/production.js*.
672 |
673 | Create heroku app (if needed)
674 | ```bash
675 | $ git init
676 | $ git add .
677 | $ git commit -m "initial version"
678 |
679 | $ heroku apps:create
680 | ```
681 |
682 | If you get missing module errors, install missing dependencies
683 | ```
684 | npm i -S ms kerberos
685 | npm update --save
686 | git commit -m "save versions to package.json"
687 | ```
688 |
689 | Push to heroku and configure
690 | ```
691 | $ git push heroku master
692 | $ heroku config:set NODE_MODULES_CACHE=false
693 | $ heroku config:set NODE_ENV=production
694 | $ heroku config:set CPU_COUNT=2
695 | ```
696 | You can adjust the CPU_COUNT variable up or down based on how much memory your app is consuming, or leave it unset to fork a process for each CPU.
697 |
698 | ### OpenShift
699 |
700 | 1. Register for an account on Openshift (https://www.openshift.com/).
701 | 1. Create an app on Openshift by choosing a 'Node' type site to create. Create the site by making Openshift use Linnovate's Openshift git repo as its source code (https://github.com/linnovate/mean-on-openshift.git).
702 | 1. On the second screen after the new application has been created, add a Mongo database.
703 | 1. When the site has been built, you can visit it on your newly created domain, which will look like my-domain.openshift.com. You may need to restart the instance on Openshift before you can see it. It will look like Mean.io boilerplate.
704 | 1. On your new app's console page on Openshift, make a note of the git repo where the code lives. Clone that repo to your local computer where your mean.io app codebase is.
705 | 1. Merge your completed local app into this new repo. You will have some conflicts, so merge carefully, line by line.
706 | 1. Commit and push the repo with the Openshift code back up to Openshift. Restart your instance on Openshift, you should see your site!
707 |
708 |
709 | ## More Information
710 | * Visit us at [Linnovate.net](http://www.linnovate.net/).
711 | * Visit our [Ninja's Zone](http://meanleanstartupmachine.com/) for extended support.
712 |
713 | ## Credits
714 | * To our awesome core team with help of our contributors which have made this project a success.
715 | * Valeri Karpov for coining the term *mean* and triggering the mean stack movement.
716 | * Amos Haviv for the creation of the initial version of Mean.io while working for us @linnovate.
717 | * Madhusudhan Srinivasa who inspired us with his great work.
718 |
719 | ## License
720 | We believe that mean should be free and easy to integrate within your existing projects so we chose [The MIT License](http://opensource.org/licenses/MIT)
721 |
--------------------------------------------------------------------------------
/packages/custom/meanStarter/public/assets/fonts/opensanshebrew-light.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
--------------------------------------------------------------------------------