Coder Social home page Coder Social logo

jpotts18 / mean-stack-relational Goto Github PK

View Code? Open in Web Editor NEW
425.0 42.0 175.0 3.99 MB

M*EAN (*MySQL, Express, Angular, Node) - A Simple, Scalable and Easy starting point for javascript web development with a relational database ORM

License: MIT License

JavaScript 86.97% HTML 12.44% CSS 0.59%

mean-stack-relational's Introduction

MEAN Stack Relational Mean Stack Build Status

Please use for reference only! No support or updates planned.

The main idea for this repository is shamelessly stolen from http://mean.io. It says:

MEAN is a boilerplate that provides a nice starting point for [MySQL], Express, Node.js, and AngularJS based applications. It is designed to give you quick and organized way to start developing of MEAN based web apps with useful modules like sequelize 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.

The MongoDB ORM, Mongoose, has been replaced with Sequelize. Switching from mongoose to sequelize allows developers easy access to MySQL, MariaDB, SQLite or PostgreSQL databases by mapping database entries to objects and vice versa.

Addy Osmani's Blog explains SQL databases, being strongly typed in nature are great at enforcing a level of consistency, ensuring many kinds of bad data simply don’t get recorded. By using SQL databases MEAN Stack Relational favors reliability over the performance gains of NoSQL databases.

Demo

Deploy to your Heroku account for a demo:

Deploy

Note: Deploy from main repository view to avoid missing app.json error.

Getting Started

Alright now the fun begins. First clone or download the repo to your computer.

  1. Clone the repository git clone [email protected]:jpotts18/mean-stack-relational.git.
  2. Go into the repository cd mean-stack-relational/.
  3. Install dependencies with NPM npm install. This will copy development.json5, and production.json5 from respective sample files in the config/env folder and run the grunt copy task to copy frontend lib files to their destination.
  4. Plug in your private and public keys for working with FB and Twitter into /config/env/development.json5 and/or /config/env/production.json5.
  5. Wire up the database connection found in /config/env/development.json5 and/or /config/env/production.json5.
  6. Run in production mode with: pm2 start pm2-ecosystem.json --env production (Run sudo npm install -g pm2 if it's not installed.), or
  7. Run in development mode with grunt: grunt
  8. Make something awesome!

Thats all! Now go and open up your browser at http://localhost:3000, and tweet @jpotts18 to say thanks!

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
  • MySQL - Download and Install MySQL - Make sure it's running on the default port (3306).

Tool Prerequisites

  • NPM - Node.js package manager, should be installed when you install node.js. NPM (Node Package Manager) will look at the package.json file in the root of the project and download all of the necessary dependencies and put them in a folder called node_modules

  • Bower - Web package manager, installing Bower is simple when you have npm: npm install -g bower

NPM Modules Used

  • Passport - Passport is authentication middleware for Node.js. Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application. A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more.
  • Express - Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.
  • Sequelize - The Sequelize library provides easy access to MySQL, MariaDB, SQLite or PostgreSQL databases by mapping database entries to objects and vice versa. To put it in a nutshell, it's an ORM (Object-Relational-Mapper). The library is written entirely in JavaScript and can be used in the Node.JS environment.

Javascript Tools Used

  • Grunt - In one word: automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you've configured it, a Grunt can do most of that mundane work for you—and your team—with basically zero effort.

    1. It watches your filesystem and when it detects a change it will livereload your changes.

    2. It runs jshint which looks through your javascript files and ensures coding standards.

    3. It runs nodemon which watches changes in specific folders and recompiles the app when necessary. No running node app.js every 2 minutes.

    4. It can also run tests like mocha and karma for you.

  • Bower - Bower is a package manager for the web. It offers a generic, unopinionated solution to the problem of front-end package management, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.

Front-End Tools Used

  • Angular.js - AngularJS is an open-source JavaScript framework, maintained by Google, that assists with running single-page applications. Its goal is to augment browser-based applications with model–view–controller (MVC) capability, in an effort to make both development and testing easier.
  • Twitter Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • UI Bootstrap - Bootstrap components written in pure AngularJS by the AngularUI Team

Project Roadmap

Following is a list of items detailing future direction for MEAN Stack Relational:

Purpose

  • Demonstrate several login strategies using passport.js
  • Demonstrate environment configuration best practices
  • Demonstrate how to use Sequelize to query a single table and to accomplish a join.

Additions

  • Demonstrate testing for Express routes and javascript classes using Mocha, Sinon, Proxyquire and more
  • Demonstrating modularity by using javascript classes for complex backend functionality
  • Yeoman generator to compete with MEAN

Troubleshooting and Contact

During install some of you may encounter some issues feel free to contact me (jpotts18) or the co-contributor (chaudhryjunaid), via the repository issue tracker or the links provided below. I am also available on twitter at @jpotts18 and Junaid at @chjunaidanwar.

mean-stack-relational's People

Contributors

ahmedhassan07 avatar chaudhryjunaid avatar eric-d avatar guohuang avatar jayprakash1 avatar jpotts18 avatar marianaiam avatar msteward 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  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  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

mean-stack-relational's Issues

Install docs update

Thanks for this project. Just thought I'd let you know the 'bower install' command is missing from the getting started section of the docs. Also, bower install places the components in a 'bower-components' directory under the 'public' directory. The code references them being in 'app/lib/. Not sure if that's something strange about my bower setup, but you need to run bower install, move the 'bower-components' directory inside the public directory and rename it to 'lib'. Otherwise, the app won't run (all kinds of missing files, etc.)

Again, thanks for this contribution. Cheers.

Not usable....

One of the reasons I was looking for a sequalizer generator was to understand, as well as speed up, professional website development.

Unfortunately, this means we can't use MEANjs or MEANio as they're using mongodb (not useful in MANY applications due to mongo being a dictionary data design making use with relational data impractical).

Fast forward to this git and we run into problems right out of the gate:
-starting out of the box, using "grunt" will wipe the database every, single, time.
-jade is being used instead of html (html is standard, and most will, or cannot, take the time to learn jade)
-other misc issues

This git would be a LOT more popular had it been constructed properly :(!

Figured you'd like some feedback rather than yet another person avoiding this solution D:

How to Migrate with an updated Models?

I've try to install sequelize-cli and run sequelize db:migrate

Loaded configuration file "config/config.js".
Unable to connect to database: SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO)

When I run this: sequelize db:migrate NODE_ENV=development
it show this message
Loaded configuration file "config/config.js".

It will gives this error, if I don't migrate.

error:  Error: Failed to lookup view "error" in views directory "/Users/Roller/Working/Web/ponds_web/app/views"
        at EventEmitter.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/application.js:579:17)
        at ServerResponse.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/response.js:960:7)
        at ServerResponse.res.render (/Users/Roller/Working/Web/ponds_web/node_modules/view-helpers/index.js:65:13)
        at .<anonymous> (/Users/Roller/Working/Web/ponds_web/app/controllers/skintypes.js:107:20)
        at tryCatcher (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/util.js:16:23)
        at Promise._settlePromiseFromHandler (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/promise.js:504:31)

To migrate it, now I'm going to mysql console.

drop schema myschema;
create schema myschema;

then I run grunt, so everything is up to date.

This is just in the development only, I don't want database to be dropped everytime when I made change to the model.

Push rejected, failed to compile Node.js app

I forked your app and deployed in heroku via github as master branch. But the below error occurs. How can i solve this. I want to just see your sample. Do you have any other links ??

bower ECONFLICT Unable to find suitable version for angular

   npm ERR! Linux 3.13.0-105-generic
   npm ERR! argv "/tmp/build_d395c665b5572b1720a72b88ad8f711a/vishesh1king-mean-stack-relational-455ce57/.heroku/node/bin/node" "/tmp/build_d395c665b5572b1720a72b88ad8f711a/vishesh1king-mean-stack-relational-455ce57/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_d395c665b5572b1720a72b88ad8f711a/vishesh1king-mean-stack-relational-455ce57/.npmrc"
   npm ERR! node v4.2.6
   npm ERR! npm  v2.14.22
   npm ERR! code ELIFECYCLE
   npm ERR! [email protected] postinstall: `bower install && cp config/env/development.json5.sample config/env/development.json5 && cp config/env/production.json5.sample config/env/production.json5 && node node_modules/grunt-cli/bin/grunt copy`
   npm ERR! Exit status 1
   npm ERR!
   npm ERR! Failed at the [email protected] postinstall script 'bower install && cp config/env/development.json5.sample config/env/development.json5 && cp config/env/production.json5.sample config/env/production.json5 && node node_modules/grunt-cli/bin/grunt copy'.
   npm ERR! This is most likely a problem with the mean-stack-relational package,
   npm ERR! not with npm itself.
   npm ERR! Tell the author that this fails on your system:
   npm ERR!     bower install && cp config/env/development.json5.sample config/env/development.json5 && cp config/env/production.json5.sample config/env/production.json5 && node node_modules/grunt-cli/bin/grunt copy
   npm ERR! You can get information on how to open an issue for this project with:
   npm ERR!     npm bugs mean-stack-relational
   npm ERR! Or if that isn't available, you can get their info via:
   npm ERR!
   npm ERR!     npm owner ls mean-stack-relational
   npm ERR! There is likely additional logging output above.
   
   npm ERR! Please include the following file with any support request:
   npm ERR!     /tmp/build_d395c665b5572b1720a72b88ad8f711a/vishesh1king-mean-stack-relational-455ce57/npm-debug.log

-----> Build failed

   We're sorry this build is failing! You can troubleshoot common issues here:
   https://devcenter.heroku.com/articles/troubleshooting-node-deploys
   
   Some possible problems:
   
   - Bower may need a resolution hint for angular
   https://github.com/bower/bower/issues/1746
   
   Love,
   Heroku

! Push rejected, failed to compile Node.js app.
! Push failed

unsigned_cert_in_chain

I cannot install the npm because of the unsigned_cert_in_chain error. Any suggestions on resolving this problem?

Routing error?

Grunt launches the server, but there is some sort of routing error, so nothing is displayed on the page, other than the title:

Essentially it returns the index everywhere, the '<' is from <!DOCTYPE html> ... etc

http://i.imgur.com/mB8ImUN.png

'Session' model table generation fails.

I got this error when attempting to run the app.

SequelizeDatabaseError: ER_TOO_LONG_KEY: Specified key was too long; max key length is 767 bytes

In the terminal nodemon this was shown by directly after the winston/sequelize "verbose:" logs. I see the 'Users', and 'Articles' tables being completed, and then showing their indexes, but it seems the error is triggered on the 'Sessions' table creation. The show index never triggers. From what I can tell the 'Sessions' model is (kind of) automatically generated from the config/middlewares/seesion.js file. Is that correct?

I've tried creating the database in various character encodings to no avail.

I'm kind of new at Sequelize, but I wonder if there is some way to address this error as this seems to be a rather frequent occurrence. There are tons of references to it on SE and other question sites. Any info you could give, prior to (or in addition to) a fix would be received with great appreciation. Thanks.

mean-stack-relation setup error

Just setting up mean-stack-relational, It looks as though have a db connection error I can't seem to get figured out, posted below. I have mysql running and I have tested the connection.

Any ideas?

Error: Cannot enqueue Query after fatal error. at Protocol._validateEnqueue (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express-mysql-session/node_modules/mysql-connection-manager/node_modules/mysql/lib/protocol/Protocol.js:193:16) at Protocol._enqueue (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express-mysql-session/node_modules/mysql-connection-manager/node_modules/mysql/lib/protocol/Protocol.js:129:13) at Connection.query (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express-mysql-session/node_modules/mysql-connection-manager/node_modules/mysql/lib/Connection.js:185:25) at SessionStore.get (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express-mysql-session/lib/index.js:151:18) at session (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express-session/index.js:392:11) at Layer.handle as handle_request at trim_prefix (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:302:13) at /Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:270:7 at Function.proto.process_params (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:321:12) at next (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:261:10) at methodOverride (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/method-override/index.js:63:14) at Layer.handle as handle_request at trim_prefix (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:302:13) at /Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:270:7 at Function.proto.process_params (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:321:12) at next (/Users/embrasse-moi/Documents/CRAIG_CODE/craiglorious/mean-stack-relational/node_modules/express/lib/router/index.js:261:10)

How to use raw query with this repo?

I tried various things to enable me to do raw query with this repo to no success. My ultimate goal is to be able to do complex query like for hierarchical data operation on a table. but i haven't been able to do a very simple raw query like "select * from article".
could any one help me?

Issue with "Compress"

I'm getting this issue (that I need to install "compress"). Thanks so much for making your work available Jeff, I really want to learn Node and to learn how to use Mysql/MariaDB with it and yours is one of the few examples available.

user1@test:~/workspace/mean-stack-relational-master$ grunt
Running "jshint:all" (jshint) task

22 files lint free.

Running "concurrent:tasks" (concurrent) task
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] v1.0.17
[nodemon] to restart at any time, enter rs
[nodemon] watching: /home/user1/workspace/mean-stack-relational-master/app//* /home/user1/workspace/mean-stack-relational-master/config//*
[nodemon] starting node app.js
Initializing Sequelize
Loading model file Article.js
Loading model file user.js
Initializing Express

Error: Most middleware (like compress) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/home/user1/workspace/mean-stack-relational-master/node_modules/express/lib/express.js:89:13)
at module.exports (/home/user1/workspace/mean-stack-relational-master/config/express.js:19:21)
at Object. (/home/user1/workspace/mean-stack-relational-master/app.js:23:28)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
[nodemon] app crashed - waiting for file changes before starting...

I ran "npm install compress" and "npm install connect" and "npm update" and then ran "grunt" again and got the same error as above.

I see in file /home/user1/workspace/mean-stack-relational-master/config/express.js the line:

app.use(express.compress({

and from looking at the connect site, I think compress is no longer included in express and is also now called compression? I'll tinker with this and update my post.

How to make multiple Layouts?

Hello,
i have used Default layout that points to index.html now i have created login.html that page has different layout i even created "login_layout.jade" in Layouts folder and login.jade with index.jade dir

Here is my directory structure...
http://prntscr.com/c418cn
So my question is how can i point my Angular View (Login Page) to that Login layout..
please help me
Thank you..

Installation on a fresh server

Hey,

I really like your stack and want to use it.
I'm really noob for nodeJS so please understand if my question is stupid :)

I follow all installation steps but I can't see nothing on my browser.
There is no errors when I run the "grunt" command.

Please let me know if you see something that messed up..
BTW i'm using Cloud9 IDE and env.

Thanks!

Here's the result for the grunt command:

Running "jshint:all" (jshint) task

public/js/config.js
line 4 col 9 Missing "use strict" statement.
line 29 col 9 Missing "use strict" statement.

public/js/controllers/articles.js
line 2 col 5 Missing "use strict" statement.

public/js/controllers/header.js
line 2 col 5 Missing "use strict" statement.

public/js/controllers/index.js
line 2 col 5 Missing "use strict" statement.

public/js/init.js
line 3 col 5 Missing "use strict" statement.

public/js/services/articles.js
line 3 col 5 Missing "use strict" statement.

public/js/services/global.js
line 4 col 9 Missing "use strict" statement.

test/mocha/controllers/articleControllerSpec.js
line 135 col 14 Missing semicolon.
line 197 col 14 Missing semicolon.
line 324 col 13 Expected an assignment or function call and instead saw an expression.

test/karma/karma.conf.js
line 5 col 5 Missing "use strict" statement.

✖ 9 errors
⚠ 3 warnings

Warning: Task "jshint:all" failed. Used --force, continuing.

Running "concurrent:tasks" (concurrent) task
Running "nodemon:dev" (nodemon) task
[nodemon] 1.9.1
[nodemon] to restart at any time, enter rs
[nodemon] watching: /home/ubuntu/workspace/app//* /home/ubuntu/workspace/config//* app.js gruntfile.js
[nodemon] starting node app.js --color
Running "watch" task
Waiting...
^A info: Starting M*EAN Stack Relational - Development...
info: Config loaded: development
info: Initializing Sequelize...
info: Checking if running on Heroku: false
info: Loading model file article.js
info: Loading model file user.js
info: Initializing Express
info: Express app started on port 3000
verbose: Executing (default): CREATE TABLE IF NOT EXISTS Users (id INTEGER NOT NULL auto_increment , name VARCHAR(255), email VARCHAR(255), username VARCHAR(255), hashedPassword VARCHAR(255), provider VARCHAR(255), salt VARCHAR(255), facebookUserId INTEGER, twitterUserId INTEGER, twitterKey VARCHAR(255), twitterSecret VARCHAR(255), github VARCHAR(255), openId VARCHAR(255), createdAt DATETIME NOT NULL, updatedAt DATETIME NOT NULL, PRIMARY KEY (id)) ENGINE=InnoDB;
verbose: Executing (default): SHOW INDEX FROM Users
verbose: Executing (default): CREATE TABLE IF NOT EXISTS Articles (id INTEGER NOT NULL auto_increment , title VARCHAR(255), content TEXT, createdAt DATETIME NOT NULL, updatedAt DATETIME NOT NULL, UserId INTEGER, PRIMARY KEY (id), FOREIGN KEY (UserId) REFERENCES Users (id) ON DELETE SET NULL ON UPDATE CASCADE) ENGINE=InnoDB;
verbose: Executing (default): SHOW INDEX FROM Articles
verbose: Executing (default): CREATE TABLE IF NOT EXISTS Sessions (id INTEGER NOT NULL auto_increment , sid VARCHAR(255) NOT NULL UNIQUE, data TEXT, createdAt DATETIME NOT NULL, updatedAt DATETIME NOT NULL, UNIQUE Sessions_sid_unique (sid), PRIMARY KEY (id)) ENGINE=InnoDB;
verbose: Executing (default): SHOW INDEX FROM Sessions
info: Database synchronized

article.all and article.find return hashed password and salt transmition

when you require an article the full User is transmit into the json also with the salt and the hashed password

to secure the return value it could be possible to change the line 16 with

db.Article.find({ where: {id: id}, include: [{model:db.User, attributes:['id','username']}]}).then(function(article){

and the line 101 into

db.Article.findAll({include: [{model:db.User, attributes: ['id','username']}]}).then(function(articles){

in the file controllers/articles.js

Many Problems to get it working!

I started out with a frest debian testing install.

  1. On npm install I got an error because node was not found (Debian installs nodejs instead of node). With a symlink I got the
  2. next error after bower was installed:

jquery#2.0.3 bower_components/jquery
npm ERR! peerinvalid The package karma-requirejs does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants karma-requirejs@~0.2.0

npm ERR! System Linux 3.13-1-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/severin/node/hybrid
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/severin/node/hybrid/npm-debug.log
npm ERR! not ok code 0

for now I just deleted everything related to karma ...

unexpected text

Error: /home/marcos/Sites/assinantes/app/views/includes/foot.jade:30
    28| if (process.env.NODE_ENV == 'development')
    29|     //Livereload script rendered 
  > 30|     script(type='text/javascript', src='http://localhost:35729/livereload.js')  
    31| 

unexpected text

Upgrade to the new meanio stack?

I ran across this and it looks great but was wondering if you were planning on updating it to match the new meanio with packages?

Thanks

View articles from a logged in user only

Hello!

I'm using your Mean Stack Relational as a basis for a new Contact Management App.
I did the whole setup and connected everything to a local SQLite database.
All works just fine my only question is how can I get it to work in such a way that a logged in user gets to see only his own articles (contacts in my case)? Right now a logged in user sees all the articles even those from another user. A logged in user is not allowed to delete an article from another user so it should be possible to list only the articles (contacts) of the user's articles or contacts.

Please let me know so I can work on this.

With kind regards,

Alessandro Giacoppo

facebookUserId : DATA_OUT_OF_RANGE

Awesome work jpotts!

Fyi, I got the below error, and I corrected it by changing the datatype for facebookUserId under model for user.js

Error: ER_WARN_DATA_OUT_OF_RANGE: Out of range value for column 'facebookUserId' at row 1

Cant singin

Hello,

I can not login. No error message, but stops at the login page.
Any idea?

Thanks!

Need help

Hello, i started a new touchscreen web application from this wanderfull solution. On the signin server page i need to use the angular js directives ng-keypad. The problem is that i cannot access anything from my client controller. There is something i do not completely anderstand. I can see in chrome that my controller files is really loaded when going into signin page but nothing is accessible into the scope.

Any help will be greatly apreciated since i'm stock.
You can reach me at [email protected]

Out of Date....Satellizer?

I know your not supporting this, btw great work, I was wondering how hard it would be to chagne from passport to satellizer?

using yeoman generator on this stack?

Hi,
Does yeoman auto generator work with your stack?
Or how do I configure (downgrade if required) to get it to work? generating new controllers, models, routes, views, .. automatically by copying user and article patterns.

Thanks

missing DB create scripts and documentation

I dont see any documentation about how to create the DB. The DB name is "mean_relational", but searching for this string only finds files in /config/env/. I'm wondering where the SQL dump file is to create the mean_relational db? When I run the app I get an error SequelizeConnectionError: ER_BAD_DB_ERROR: Unknown database 'mean_relational'. Please advise.

Question about window.user = ! {user}

Hi everyone,

In the source code, I saw the code like that: "window.user = ! {user}",
Could you tell me when user value is assigned? Why do we use it?
I 've got an issues: when I try to refresh the pages, window.user = null.
so, what should I do to solve it.

Thanks,

Social Login isn't working

I tried setting up the project and also provided it with fb app id and app secret, but when i click the fb login or signup button , i get CORS error

XMLHttpRequest cannot load https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%…facebook%2Fcallback&scope=email%2Cuser_about_me&client_id=xxxx. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.

Does anybody know how to resolve this issue?

How to Migrate with an update Models?

I've try to install sequelize-cli and run sequelize db:migrate

Loaded configuration file "config/config.js".
Unable to connect to database: SequelizeAccessDeniedError: ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO)

When I run this: sequelize db:migrate NODE_ENV=development
it show this message
Loaded configuration file "config/config.js".

It still gives this error:

error:  Error: Failed to lookup view "error" in views directory "/Users/Roller/Working/Web/ponds_web/app/views"
        at EventEmitter.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/application.js:579:17)
        at ServerResponse.render (/Users/Roller/Working/Web/ponds_web/node_modules/express/lib/response.js:960:7)
        at ServerResponse.res.render (/Users/Roller/Working/Web/ponds_web/node_modules/view-helpers/index.js:65:13)
        at .<anonymous> (/Users/Roller/Working/Web/ponds_web/app/controllers/skintypes.js:107:20)
        at tryCatcher (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/util.js:16:23)
        at Promise._settlePromiseFromHandler (/Users/Roller/Working/Web/ponds_web/node_modules/bluebird/js/release/promise.js:504:31)

Params issue

So I tried to add additional models, basing off of the articles model. Add controllers, ng controllers etc etc. I believe I have everything. The page displays, but when I try to create I'm getting a 404 and it's passing in http://localhost:3000/polls/:[poll]Id. Why is it adding :[poll]Id to the url? I feel like I'm missing something simple. I'm a rails dev and trying Node and Angular for the first time so not familiar with this tech :/

Error in Windows with the postinstall command

I get error in Windows because the cp command doesn't exist.
To fix this, I replaced the postinstall command with this:

"postinstall": "bower install && copy config\env\development.json5.sample config\env\development.json5 && copy config\env\production.json5.sample config\env\production.json5 && node node_modules/grunt-cli/bin/grunt copy"

I hope this will be useful,
Regards.

Adding a feature that isn't data-driven / using a directive

I've been learning Node/Express/Angular and I came across your project. I started out looking at the Mongo version and ran away because that was one too many new skills to learn. Being very comfortable with relational databases, I was very happy to come across your project -- thanks so much for sharing it. I was able to fairly easily create new data-driven entities and all their routes, scopes, views, menus, etc... by following your example (I searched for the words "article" and "Article" and found every example, scratched off the ones that didn't pertain to the article entitiy and created parallel new entities).

Then I went to do something that I thought would be simple in comparison, I was just going to create a "file select/upload" view to upload images. After a month of beating my head against that problem trying to translate html5/jquery, I realized that Angular doesn't have a set way of doing file upload like html5 and jquery. Then I came across a very nice Angular example below that works well as is and I tried to recreate it as a view but found that I didn't know how to scope it and I don't know how to include a directive within the project. When I try to run my example, it does create placeholders for the images (too many) but doesn't show the images and it creates an index out of the letters of the first selected file name for some reason (thus it winds up showing too many image placeholders). I saw the weird index thing by examining the element in Firefox's debugger. Could you offer any insight on including this as a directive? My goal was to add one more piece to the project that might be useful as a CMS.

html page:

<!DOCTYPE html>
<html ng-app="appFilereader">

  <head>
    <!-- The original angular include file used is v1.2.9 -->
    <script src="angular.min.js"></script>
    <script src="filereader.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  </head>

  <body>

  <form novalidate>
    Pick an image-file: <input type="file" ng-model="dummy.images" accept="image/*" multiple app-filereader /><br />
    <img ng-repeat="image in dummy.images track by $index" ng-src="{{image}}" width="300" /><br />
    <button ng-click="dummy.images = null" ng-show="!!dummy.images">Remove {{dummy.images.length}} images</button><br />
  </form>

  <pre>
  {{ dummy }}
  </pre>
</body>

</html>

filereader.js (the directive):

angular.module('appFilereader', []).directive('appFilereader', function($q) {
    /*
    made by [email protected] WTFPL licensed
    */
    var slice = Array.prototype.slice;

    return {
      restrict: 'A',
      require: '?ngModel',
      link: function(scope, element, attrs, ngModel) {
        if (!ngModel) return;

        ngModel.$render = function() {}

        element.bind('change', function(e) {
          var element = e.target;
          if(!element.value) return;

          element.disabled = true;
          $q.all(slice.call(element.files, 0).map(readFile))
            .then(function(values) {
              if (element.multiple) ngModel.$setViewValue(values);
              else ngModel.$setViewValue(values.length ? values[0] : null);
              element.value = null;
              element.disabled = false;
            });

          function readFile(file) {
            var deferred = $q.defer();

            var reader = new FileReader()
            reader.onload = function(e) {
              deferred.resolve(e.target.result);
            }
            reader.onerror = function(e) {
              deferred.reject(e);
            }
            reader.readAsDataURL(file);

            return deferred.promise;
          }

        }); //change

      } //link

    }; //return

  }) //appFilereader
;

Unable to create Package

When i run the command "mean package MyPackage" It throws error "Invalid MEAN app or not in app root".

Trouble running npm install: packages out of date?

New to node/express and would love to test out the mysql mean stack, but am running into issues getting the project set up.

I'm currently running node v0.12.1.

Here's a small screenshot of the ending output:

image

yoman generator issue

does anyone having issue with YO generator? i am a mac user, when i run npm install -g generator-meanjs i got a lot of errors at the end, is it because the folder structure of meanjs has changed?

here is the error:

npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/guo/.nvm/versions/node/v5.1.0/bin/node" "/Users/guo/.nvm/versions/node/v5.1.0/bin/npm" "install" "-g" "generator-meanjs"
npm ERR! node v5.1.0
npm ERR! npm v3.5.1
npm ERR! path /Users/guo/.nvm/versions/node/v5.1.0/lib/node_modules/generator-meanjs/node_modules/yeoman-generator/node_modules/download/node_modules/caw/node_modules/get-proxy/node_modules/rc/node_modules/deep-extend
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/Users/guo/.nvm/versions/node/v5.1.0/lib/node_modules/generator-meanjs/node_modules/yeoman-generator/node_modules/download/node_modules/caw/node_modules/get-proxy/node_modules/rc/node_modules/deep-extend' -> '/Users/guo/.nvm/versions/node/v5.1.0/lib/node_modules/generator-meanjs/node_modules/deep-extend'
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/guo/.nvm/versions/node/v5.1.0/lib/node_modules/generator-meanjs/node_modules/yeoman-generator/node_modules/download/node_modules/caw/node_modules/get-proxy/node_modules/rc/node_modules/deep-extend' -> '/Users/guo/.nvm/versions/node/v5.1.0/lib/node_modules/generator-meanjs/node_modules/deep-extend'

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.