Skip to content

Commit

Permalink
Merge new mean version
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-holovin committed Nov 13, 2015
1 parent 77e27f2 commit d7f517a
Show file tree
Hide file tree
Showing 103 changed files with 6,466 additions and 2,549 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bower_components
# App Files
# --------------------
data/
test/coverage/
tests/results/**
modules/public/
modules/views/
/public/build/
Expand Down
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
"noempty" : true, // true: Prohibit use of empty blocks
"nonew" : true, // true: Prohibit use of constructors for side-effects (without assignment)
"plusplus" : true, // true: Prohibit use of `++` & `--`
"plusplus" : false, // true: Prohibit use of `++` & `--`
"quotmark" : "single", // Quotation mark consistency:
// false : do nothing (default)
// true : ensure whatever is used is consistent
Expand Down Expand Up @@ -72,6 +72,7 @@

// Custom Globals
"globals": {
"$" : true,
"angular" : true,
"define" : false,
"jasmine" : false,
Expand Down
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
language: node_js
sudo: false
node_js:
- "0.10"
- "0.12"
- "4.0"
- "4.2"
- "5.0"
env:
- NODE_ENV=development
services:
- mongodb

before_install:
- npm i -g bower

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/08c84711c36e875930d0
- https://hooks.slack.com/services/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
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
on_start: always # default: false


20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Contributing

### Reporting an Issue
1. Please make sure that there is not an issue already open
2. If that's the case, then add your observations in that same issue
3. If your issue is unique, add following details in the issue
1. OS name and version
2. NodeJS and NPM version : Output of `node -v` and `npm -v`
3. MEAN Status : Output of `mean status` in project directory
4. Tracelog : The error that got printed on the console
5. Any other relevant details
4. Add `[Feature]` in the title if its a suggestion rather than an issue that you would like to see in MEAN.


### Creating a pull request
1. There should be an issue for every pull request that is being created. If there is none, create it.
2. Make sure that your changes are passing the test but running `npm test`
3. If there are any lint warning, cleanup those as well
4. In the comments for pull request mention the issues that you are solving by this pull request
5. Create the pull request
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM node:0.10

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

RUN npm install -g mean-cli bower gulp

RUN groupadd -r node \
&& useradd -r -m -g node node

COPY . /usr/src/app/
RUN rm -rf /usr/src/app/node_modules
RUN chown -R node:node /usr/src/app

USER node
RUN touch /home/node/.mean
RUN npm install
ENV PORT 3000
ENV DB_PORT_27017_TCP_ADDR db
CMD [ "npm", "start" ]
EXPOSE 3000


#How to build:
# git clone https://github.com/linnovate/mean
# cd mean
# docker build -t mean .

#How to run:
# docker pull mongo
# docker run -d --name db mongo
# docker run -p 3000:3000 --link db:db mean
50 changes: 29 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/linnovate/mean.svg?branch=master)](https://travis-ci.org/linnovate/mean)
[![Build Status](https://travis-ci.org/linnovate/mean.svg)](https://travis-ci.org/linnovate/mean)
[![Dependencies Status](https://david-dm.org/linnovate/mean.svg)](https://david-dm.org/linnovate/mean)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/linnovate/mean?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
h
Expand All @@ -11,7 +11,7 @@ MEAN is a framework for an easy starting point with [MongoDB](http://www.mongodb
* *Node.js* - <a href="http://nodejs.org/download/">Download</a> and Install Node.js, nodeschool has free <a href=" http://nodeschool.io/#workshoppers">node tutorials</a> to get you started.
* *MongoDB* - <a href="http://www.mongodb.org/downloads">Download</a> and Install mongodb - <a href="http://docs.mongodb.org/manual">Checkout their manual</a> if you're just starting.

If you're using ubuntu this is the preffered repository to use...
If you're using ubuntu, this is the preferred repository to use...

```bash
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
Expand Down Expand Up @@ -54,7 +54,7 @@ $ cd <myApp> && npm install

### Invoke node with a task manager
Mean supports the gulp task runner for various services which are applied on the code.
To start you application run -
To start your application run -
```bash
$ gulp
```
Expand All @@ -68,6 +68,17 @@ Then, open a browser and go to:
http://localhost:3000
```

### Running on a different port
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:
```bash
$ export PORT=3001 && gulp
```

Then, open a browser and change the port number before you visit:
```bash
http://localhost:3001
```

### Troubleshooting
During installation depending on your os and prerequisite versions you may encounter some issues.

Expand Down Expand Up @@ -109,7 +120,7 @@ $ bower cache clean
Some of Mean.io dependencies uses [node-gyp](https://github.com/TooTallNate/node-gyp) with supported Python version 2.7.x. So if you see an error related to node-gyp rebuild follow next steps:

1. install [Python 2.7.x](https://www.python.org/downloads/)
2. install [Microsoft Visual Studio C++ 2012 Express](http://www.microsoft.com/ru-ru/download/details.aspx?id=34673)
2. install [Microsoft Visual Studio C++ 2012 Express](http://www.microsoft.com/en-us/download/details.aspx?id=34673)
3. Run NPM update

```bash
Expand Down Expand Up @@ -168,9 +179,9 @@ $ mean help [command]
<p>For example, the <i>admin</i> role is required to edit tokens.</p>

```bash
$ mean user <email>
$ mean user <email> --addRole <role>;
$ mean user <email> --removeRole <role>;
$ mean user <email>
$ mean user <email> --addRole <role>;
$ mean user <email> --removeRole <role>;
```

### Packages
Expand Down Expand Up @@ -218,7 +229,7 @@ Everything in mean.io is a package and when extending mean with custom functiona

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.

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 necceesary tools required to integrate their package into the host project.
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.

There are two types of packages:

Expand All @@ -236,20 +247,20 @@ The "system" package creates the basic pages as well as defines the layout of th
#### Users
The "users" package creates the database model of the user, provides validation as well as various login and registration features.
#### Access
The "access" package managers permissions and middleware. It controls the various authentication methods and is dependent on the users package
The "access" package manages permissions and middleware. It controls the various authentication methods and is dependent on the users package
#### Theme
The "theme" package adds some basic CSS and other assets such as images and backgrounds
#### Articles
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.
### Files structure
### File structure
The file structure is similar to that of the mean project itself

`Fundamental` Files at the `root` of the package

**Server**

Packages are registered in the **app.js**
Defines package name, version and `mean=true` in the **package.json**
Packages are registered in the **app.js**
Defines package name, version and `mean=true` in the **package.json**

All of the Server side code resides in the `/server` directory.

Expand Down Expand Up @@ -285,7 +296,6 @@ When registering you are required to declare all your dependencies in order for
// Example of registering the MyPackage
MyPackage.register(function(app, auth, database) {
// ...

});
```

Expand Down Expand Up @@ -349,7 +359,6 @@ All assets such as images, javascript libraries and CSS stylesheets should be wi

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


```javascript

//Adding jquery to the mean project
Expand All @@ -373,11 +382,11 @@ MyPackage.aggregateAsset('js','first.js',{global:true, weight: -4, group: 'head
```

>The line that gets loaded in your head.html calls the header group and injects the js you want to include first-
> in packages/system/server/views/includes/head.html
> in packages/system/server/views/includes/head.html
> <script type="text/javascript" src="/modules/aggregated.js?group=header"></script>
###Settings Object
The settings object is a persistance object that is stored in the packages collection and allows for saving persistant information per package such as configuration options or admin settings for the package.
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.

Receives two arguments the first being the settings object the second is a callback function

Expand Down Expand Up @@ -439,7 +448,7 @@ $stateProvider

Packages are able to hook into an existing menu system and add links to various menus integrated within Mean.

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.
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.

Below is an example how to add a link to the main menu from `app.js`

Expand Down Expand Up @@ -529,7 +538,7 @@ $ mean publish
## MEAN Network
Mean is a stand-alone instance that you can install locally or host on your server.
We want to provide value to developers and are assembling a set of services which will be called the mean network.
We're building all of this as we speak but we allready have some elements in place.
We're building all of this as we speak but we already have some elements in place.
### Network User Management
Expand Down Expand Up @@ -592,7 +601,7 @@ $ npm test
### Logging
As from mean-0.4.4 control over the logging format has been delgated to the env configuration files.
As from mean-0.4.4 control over the logging format has been delegated to the env configuration files.
The formats and implementation are done using the morgan node module and it's [predefined format](https://github.com/expressjs/morgan#predefined-formats)
Within each configuration file (config/env/development.js) for instance you state the format in the 'logging' object.
```
Expand Down Expand Up @@ -689,8 +698,7 @@ $ heroku config:set NODE_ENV=production
* To our awesome <a href="https://github.com/orgs/linnovate/teams/mean">core team</a> with help of our <a href="https://github.com/linnovate/mean/graphs/contributors">contributors</a> which have made this project a success.
* <a href="https://github.com/vkarpov15">Valeri Karpov</a> for coining the term *mean* and triggering the mean stack movement.
* <a href="https://github.com/amoshaviv">Amos Haviv</a> for the creation of the initial version of Mean.io while working for us @linnovate.
* <a href="https://github.com/madhums/">Madhusudhan Srinivasa</a> which inspired us with his great work.
* <a href="https://github.com/madhums/">Madhusudhan Srinivasa</a> who inspired us with his great work.
## License
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)
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"bootstrap": "latest",
"angular-bootstrap": "latest",
"angular-ui-router": "#master",
"web-bootstrap": "./node_modules/meanio/resources/web-bootstrap.js"
"web-bootstrap": "./node_modules/meanio/resources/web-bootstrap.js",
"angular-ui-select": "latest",
"angular-sanitize": "latest"
}
}
7 changes: 6 additions & 1 deletion config/assets.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"core": {
"css": {
"bower_components/build/css/dist.min.css": []
"bower_components/build/css/dist.min.css": [
"bower_components/angular/angular-csp.css",
"bower_components/angular-ui-select/dist/select.min.css"
]
},
"js": {
"bower_components/build/js/dist.min.js": [
Expand All @@ -10,9 +13,11 @@
"bower_components/angular-mocks/angular-mocks.js",
"bower_components/angular-cookies/angular-cookies.min.js",
"bower_components/angular-resource/angular-resource.min.js",
"bower_components/angular-sanitize/angular-sanitize.min.js",
"bower_components/angular-ui-router/release/angular-ui-router.min.js",
"bower_components/angular-jwt/dist/angular-jwt.min.js",
"bower_components/angular-bootstrap/ui-bootstrap-tpls.js",
"bower_components/angular-ui-select/dist/select.min.js",
"bower_components/web-bootstrap/index.js"
]
}
Expand Down
19 changes: 17 additions & 2 deletions config/env/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,23 @@ module.exports = {
// at all. The cookie will expunge when the browser is closed.
maxAge: null
},

public: {
languages: [{
locale: 'en',
direction: 'ltr',
}, {
locale: 'he',
direction: 'rtl',
}],
currentLanguage: 'en',
cssFramework: 'bootstrap'
},
// The session cookie name
sessionName: 'connect.sid',
attachmentDir: rootPath + '/files'
attachmentDir: rootPath + '/files',
// Set bodyParser options
bodyParser: {
json: {limit: '100kb'},
urlencoded: {limit: '100kb', extended: true}
}
};
Loading

0 comments on commit d7f517a

Please sign in to comment.