GithubHelp home page GithubHelp logo

mean-on-openshift's Introduction

Important: This project is currently unmaintained.

MEAN Logo MEAN Stack

Build Status Dependencies Status

MEAN is a boilerplate that provides a nice starting point for MongoDB, Node.js, Express, and AngularJS 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.

Prerequisites

  • Node.js - Download and Install Node.js. You can also follow this gist for a quick and easy way to install Node.js and npm
  • MongoDB - Download and Install MongoDB - Make sure mongod is running on the default port (27017).

Tools Prerequisites

  • NPM - Node.js package manage; should be installed when you install node.js.
  • Bower - Web package manager. Installing Bower is simple when you have npm:
$ npm install -g bower

Optional Built with Grunt

  • Grunt - Download and Install Grunt.
$ npm install -g grunt-cli

Additional Packages

  • Express - Defined as npm module in the package.json file.
  • Mongoose - Defined as npm module in the package.json file.
  • Passport - Defined as npm module in the package.json file.
  • AngularJS - Defined as bower module in the bower.json file.
  • Twitter Bootstrap - Defined as bower module in the bower.json file.
  • UI Bootstrap - Defined as bower module in the bower.json file.

Quick Install

The quickest way to get started with MEAN is to install the meanio package from NPM.

Install MEAN CLI:

$ [sudo] npm install -g meanio@latest
$ mean init <myApp>
$ cd <myApp> && npm install

We recommend using Grunt to start the server:

$ grunt

If grunt aborts because of JSHINT errors, these can be overridden with the force flag:

$ grunt -f

Alternatively, when not using grunt you can run:

$ node server

Then, open a browser and go to:

http://localhost:3000

Troubleshooting

During install some of you may encounter some issues.

Most issues can be solved by one of the following tips, but if are unable to find a solution feel free to contact us via the repository issue tracker or the links provided below.

Update NPM, Bower or Grunt

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.

  • Updating NPM:
$ npm update -g npm
  • Updating Grunt:
$ npm update -g grunt-cli
  • Updating Bower:
$ npm update -g bower

Cleaning NPM and Bower cache

NPM and Bower has a caching system for holding packages that you already installed. We found that often cleaning the cache solves some troubles this system creates.

  • NPM Clean Cache:
$ npm cache clean
  • Bower Clean Cache:
$ bower cache clean

Installation problems on Windows 8 / 8.1

Some of Mean.io dependencies uses 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
  2. install Microsoft Visual Studio C++ 2012 Express
  3. fire NPM update
$ npm update -g

Configuration

All configuration is specified in the config folder, through the env files, and is orchestrated through the meanio NPM module. 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.

Environmental Settings

There is a shared environment config: all.

  • root - This the default root path for the application.
  • port - DEPRECATED to http.port or https.port.
  • http.port - This sets the default application port.
  • https - These settings are for running HTTPS / SSL for a secure application.
    • 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.
    • ssl.key - The path to public key.
    • ssl.cert - The path to certificate.

There are three environments provided by default: development, test, and production.

Each of these environments has the following configuration options:

  • db - This is where you specify the MongoDB / Mongoose settings
  • 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.
  • Social OAuth Keys - Facebook, GitHub, Google, Twitter. You can specify your own social application keys here for each platform:
    • clientID
    • clientSecret
    • callbackURL
  • emailFrom - This is the from email address displayed when sending an email.
  • mailer - This is where you enter your email service provider, username and password.

To run with a different environment, just specify NODE_ENV as you call grunt:

$ NODE_ENV=test grunt

If you are using node instead of grunt, it is very similar:

$ NODE_ENV=test node server

To simply run tests

$ npm test

NOTE: Running Node.js applications in the production environment enables caching, which is disabled by default in all other environments.

Maintaining your own repository

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.

To maintain your own public or private repository, add your repository as remote. See here for information on adding an existing project to GitHub.

git remote add origin <remote repository URL>
git push -u origin master

Getting Started

We pre-included an article example. Check out:

OpenShift Quick Deployment

You can create your application from the command line with this command:

rhc app create mean nodejs-0.10 mongodb-2.4 --env NODE_ENV=production --from-code https://github.com/linnovate/mean-on-openshift.git

Or you can launch it from the OpenShift Online QuickStart

More Information

License

The MIT License

mean-on-openshift's People

Contributors

adrianedworthy avatar amenders avatar amoshaviv avatar ariutta avatar baer avatar ciccio86 avatar dizda avatar egdelwonk avatar ellman avatar enkodellc avatar fyockm avatar jackhsu978 avatar jonaswindey avatar krolow avatar liorkesos avatar lirantal avatar malterb avatar memolog avatar mrjasonweaver avatar mrngoitall avatar mrzepinski avatar piyuesh23 avatar pontifier avatar pratik60 avatar rschwabco avatar shai-weinstein avatar spacemonkey avatar tjkrusinski avatar udisun avatar wspurgin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mean-on-openshift's Issues

Grunt Task issues when running locally.

The issue with git clone of openshift instance running locally. The server runs fine. Once I add couple of additional angular modules and update assets.json, I try to build for production using grunt, I encounter errors. I am simply setting the ENV variable to production and running grunt. Perhaps there is a better way. See details of the problem below

Problem with running grunt for default task. It applies to both cssmin and uglify. I have installed load-grunt-tasks. When I run grunt default I get the error Task "cssmin" not found. This happened after I installed grunt-contrib-clean to get rid to "clear" Task not found. I do have a css file as well added to assets.json. Also I am running the openshift edition (https://github.com/linnovate/mean-on-openshift) and version details are

[email protected] /home/.......
└── [email protected] 

Contents of my assets.json file

{
  "core": {
    "css": {
      "bower_components/build/css/dist.min.css": [
        "bower_components/angular-material/angular-material.css"
      ]
    },
    "js": {
      "bower_components/build/js/dist.min.js": [
        "bower_components/jquery/dist/jquery.min.js",
        "bower_components/angular/angular.js",
        "bower_components/angular-mocks/angular-mocks.js",
        "bower_components/angular-cookies/angular-cookies.js",
        "bower_components/angular-resource/angular-resource.js",
        "bower_components/angular-ui-router/release/angular-ui-router.js",
        "bower_components/angular-aria/angular-aria.js",
        "bower_components/angular-animate/angular-animate.js",
        "bower_components/angular-material/angular-material.js"
      ]
    }
  }
}

Anyways I tried with the mean project locally and that seems to have shifted to using gulp , but that too is running into module dependency issues.

push mean packages to openshift ???

Hi,

Can somebody knows how to add mean packages (ex : mean-admin; tokens, translate, etc) to openshift?
I'm able to run my app locally (with pain^^) and these packages are well installed in my local dist. I was thinking that gitignore would not consider these packages as they are in node_modules/, so i add !node_modules/tokens to my gitignore files. but push fail...

I don't know how to do... locally, remotely (i try to run the command in the repo also but permission denied...)
Please, help, i'm desperate...

Use grunt to start server locally

Hi, I'm looking for a way to use grunt to start the server like mentioned in the documentation :

$ grunt

Unfortunately I have this.

grunt-cli: The grunt command line interface. (v0.1.13)

Fatal error: Unable to find local grunt.

So I checked the package.json file and I didn't see grunt-cli in dependencies... but just in script.

"start": "node node_modules/grunt-cli/bin/grunt",
"test": "node node_modules/grunt-cli/bin/grunt test",

What I have to do ? If I install locally grunt-cli I always have the error. If I install grunt too, I have an other error...

Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'

Did I miss something ?

Thank you.

add rockMongo cartridge not working

after deploy to the openshift. I tried to add the rockMongo cartridge to view the data in mongoDB. But I can't open the connection url since the MEAN stack routing defined the rules to prevent to show the connection console. Anyway to make this one work?

mean-admin, mean install, and .gitignore

mean-admin is installed under node_modules. You cannot mean install mean-admin from cli in shell, because of file ownership and rights to node_modules. If you pull and mean install mean-admin, it places it in node_modules, which is listed in .gitignore. grunt does not seem to work (at least not the way it does in linnovate/mean) and node server seems to hang, so after mean install mean-admin, you cannot easily verify that it has indeed worked correctly locally. Pushing states that no changes have been made, because they are being ignored. Unless you go looking and no basically what you're looking for, I can see many people not understanding this, not bothering to ask in gitter, and giving up after an hour.

This is not to say this was extremely difficult for people contributing to these projects to do, but rather that it's unnecessarily difficult and complicated for anyone to do and could, in the case of many uninitiated developers, prevent them from working with mean.io altogether. mean-admin should be easy to install or come mean.io by default (I suggest by default).

good practice to sync both local and remote

Hi again,

I'm new with openshift and i'm trying to discover this awesome mean stack build.

i've got a problem who block me in my workflow and i would like to solve this before i can think working with this stack in production.

I can't figure how to sync with best practices my local and remote dist on openshift.

I explain :

  1. I create my openshift cartridge with the mean-on-openshift pre-build.
  2. git clone my remote repo to my local computer.

From here, i want to add 3 packages (admin, translate, tokens) and create 2 custom (mypackage1, mypackage2).

If i try from my local, everything works fine with a node server cmd. but if i push to openshift, packages are not registered (i have solved this for the "officials" one by adding them on my package.json, but no way to figure out how to register my 2 customs...

So a start another project from scratch and run the install command on the openshift ssh shell :
_from /app-root/repo dir, i run "mean install mean-admin, mean install mean-translate, mean-install mean-tokens, mean package mypackage1, mean package mypackage2 and when i restart my gear, everything is ok and works fine. i've got all my packages admin in place and i can see my menu example links for mypackage1 and 2.

Now i would like to custom mypackage1. So i clone my repo in my local using git clone, and i don't know why but none of my packages are now register and there is no mypackage1 or 2 in my local packages/ folder...the app cloned seems to be the one from the beginning...

Question ?
How can get my custom packages to local when i git clone this new repo ?
maybe i miss something like "git add/commit/push" in the new dist from openshit to update the src filesystem before i can run a git clone in local ?

Thanks in advance for your help.

What is the best practice for dependencies injection ?

Hi,

I want to install ngDialog via bower, what is the best practice for injecting it in production, i'm a little bit lost ?

it works on my local computer with a "node sever", but when i push on openshift, i have this error :

Error: [$injector:modulerr] Failed to instantiate module ngDialog due to:
Error: [$injector:nomod] Module 'ngDialog' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

_i have register required css/js files in my assets.json
_i try by injecting 'ngDialog' in my default modules in init.js
_i try to inject it in my user module app.js ; MeanUser.angularDependencies(['ngDialog']);
_i try to inject it in my user module users.js : angular.module('mean.users', ['ngDialog']);
_and also in my controller...

I try all these at the same time, and also a few combinations. Most of are working locally. but none on openshift...
so, how you are handle your injections with this dist of meanio ?

Thanks for your help, your project rocks !

best,

push mean packages to openshift ???

Hi,

Can somebody knows how to add mean packages (ex : mean-admin; tokens, translate, etc) to openshift?
I'm able to run my app locally (with pain^^) and these packages are wekk installed in my local dist. I was thinking that gitignore would not consider these packages as they are in node_modules/, so i add !node_modules/tokens to my gitignore files. but push fail...

I don't know how to do... locally, remotely (i try to run the command in the repo also but permission denied...)
Please, help, i'm desperate...

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.