Giter VIP home page Giter VIP logo

sailng's Introduction

This repository is no longer maintained

Sailng

Sailng is a boilerplate that gives you a great foundation to start building realtime, Angular-based, single page applications.

It demonstrates how to create simple chat messages, update the page and delete a message all without a refresh. Go ahead and sign in with a couple different users in multiple browsers to see how it all works.

Current features include: a modular angular js architecture and file structure, an example of how to include services and directives from bower (lodash, angular-moment), and authentication using PassportJs.

More features are planned like i18n, plus I might modify the Gruntfile to run jshint and karma test runner on file saves.

To get up and running

You will need to have Sails 0.11.0-rc5 installed on your machine (sudo npm install [email protected] -g) and then clone the repo, cd into the project directory and run

$ npm install
$ cd assets
$ bower install
$ cd ../
$ sails lift

Check it out at http://localhost:1337

Screenshots

Messages

sailng's People

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

sailng's Issues

Back and forward doesn't work as expected

After clicking som links I noticed that Register and Login doesn't look like the other "pages". I is missing the header. There is just the form, nothing else. Should it be like that? ...and if I after going to either the Register och Login page, then trying to go back with the back button, well the URL change but nothing else...

adding tasks to the Grunt stack

I was attempting to upgrade the grunt tasks to include ngAnnotate, IIFE wrapping, and modify the uglification ...

But i cannot fathom how the directory structure is managed ..

I did a grunt wrap task, with expand set, and it ends up in .tmp/public/wrap/.tmp/public/src/** yikes. The next task can't seem to reference it, as all references are somehow redirected.

Could someone provide a little guidance on what/how this is kicked off and how directory redirects work?

Unknown authentication strategy "local"

Hi,my english is a little.
I Install and run the code, I register a new user and send messages, but when I logout and try to login again with the username and password the app show error 500

Unknown authentication strategy "local"

error: Sending 500 ("Server Error") response:
Error: Unknown authentication strategy "local"
at attempt (c:\nodejs\sailng\node_modules\passport\lib\middleware\authentica
te.js:166:37)
at authenticate (c:\nodejs\sailng\node_modules\passport\lib\middleware\authe
nticate.js:342:7)
at Authenticator.passport.callback (c:\nodejs\sailng\api\services\passport.j
s:250:40)
at Authenticator.bound [as callback](c:nodejssailngnode_modulessailsno
de_moduleslodashdistlodash.js:729:21)
at Object.AuthController.callback (c:\nodejs\sailng\api\controllers\AuthCont
roller.js:121:14)
at bound (c:\nodejs\sailng\node_modules\sails\node_modules\lodash\dist\lodas
h.js:729:21)
at routeTargetFnWrapper (c:\nodejs\sailng\node_modules\sails\lib\router\bind
.js:179:5)
at callbacks (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:164:37)
at param (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\route
r\index.js:138:11)
at pass (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\router
\index.js:145:5)
at nextRoute (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:100:7)
at callbacks (c:\nodejs\sailng\node_modules\sails\node_modules\express\lib\r
outer\index.js:167:11)
at c:\nodejs\sailng\node_modules\sails\lib\router\bind.js:187:7
at c:\nodejs\sailng\api\policies\passport.js:32:7
at SessionStrategy.strategy.pass (c:\nodejs\sailng\node_modules\passport\lib
\middleware\authenticate.js:318:9)
at SessionStrategy.authenticate (c:\nodejs\sailng\node_modules\passport\lib
strategies\session.js:67:10) [Error: Unknown authentication strategy "local"]

I use Windows 8 and Firefox 36.0.4 for this test

New Route for socket and glyphs

Hi Ryan,

Results of further tests

  1. I'm trying to add another view that uses soket.io and pretty much dupped messages to a todo collection. All the crud works and data looks perfect in the mongod collection but the view does not show current state like the messages view. Lines 22 thru 33 from assets/src/app/todos/index.js doesnt execute

I checked the entire project and can't see why the socket is not working.

  1. I've never used less before and haven't figured how to use the date time (from bootstrap-ui) glyphs. See the message form. Just checking if my fix is the best way as I changed references in
    assets/bower_components/angular-bootstrap/ui-bootstrap-tpls.js
    from
    span class="glyphicon glyphicon-chevron-up"
    to
    span class="fa a-chevron-up"

  2. Next up is concepts from https://github.com/fnakstad/angular-client-side-auth that use in all my projects and testing with jade templates. My eventual goal is to update https://github.com/johntom/crmMeans which was a couse I gave at the last philly code camp. This repo needs some attention so I figured that the best way to test was to replace this repo with the latest of this awesome stack.

Thanks,
John

cssFiles not load in pipeline.js

thanks for the sailng
but my css files are not compile to .tmp/public/styles like i expect

here is my pipeline css part

var cssFilesToInject = [
  'styles/my.css',
  'styles/**/*.css'
];

but the my .tmp/public/styles/ are still nothing except importer.css , how to fix it ?

Associations

The great advantage of the new version, 0.10, is the support to the associations in the models.
Could demonstrate this in your application?
Thank you very much.

Mobile chrome hard crash

Steps to reproduce.
-> Open the site on Chrome mobile, iPhone 5, iOS version 7.1.
-> Exit chrome, return to the homescreen (chrome goes to background)
-> Wait a bit (longer the better)
-> Return to chrome, refresh the page
-> Crash city

This causes a hard crash of the chrome browser and is currently a showstopper for me. I have no idea what is causing it. If anyone could confirm the above that would make me feel way less crazy.

My project is set up in a similar way to yours, I deleted all the CSS, and all the code in my angular controllers. I just have controller definitions and ng-sails is the only thing being required.

Account Creation

You probably know this, but the password character string number is set to minimum 8 yet still creates users and logs them in when password is under 8 characters. Users can post messages, but when they log out they can't log in due to passport not creating the password (cause it's under 8 characters). I would suggest having a check in place that prohibits the creation of users until all criteria is met for account creation. Maybe a beforeCreate method in the model?

Can't register a new user

I just installed SailNg and tried the example, but I didn't get far.
When I try to register a new user I get the following message:
{
"status": 500,
"message": "TypeError: Object [object Object] has no method 'done'"
}

Sails 0.10 Model.subscribe deprecated

Heads up...

debug: Deprecated:   `Model.subscribe(socket, null, ...)`
debug: See http://links.sailsjs.org/docs/config/pubsub
debug: (โŒ˜ + double-click to open link from terminal)
debug: Please use instance rooms instead (or raw sails.sockets.*() methods.)

testing..

how would one go about testing both the api side and the angular side using your boilerplate?

Invalid usage of user`publishAdd(...)`

I went through and changed all instances of .done to .exec as described in #5.

When running the sailng app and entering messages, the following error appears in the node console, but everything appears to still operate correctly (messages appear on all connected clients).

error: Invalid usage of userpublishAdd(id, alias, isAdded, [socketToOmit])``

Any ideas what this is about?

blank browser

i follow (on sails 0.10.5)
$ npm install
$ cd assets
$ bower install
$ cd ../
$ sails lift

load page, html present, no display. any ideas ?

Multiple Issues - 0.10.5

Hi,

Great project (I assume :) - I'm assuming Sails has made some breaking changes, and I'm not sure how to resolve them.

First,

warn: sails.config.express is deprecated; use sails.config.http instead.

I couldn't find sails.config.express anywhere, so I'm not sure where to fix it.
Based on balderdashy/sails#1974, it seems like a problem in config/passport.js but again, it's not obvious what needs to be changed.

In addition, once I got past that point, I opened up the browser, and had more problems.

I was getting a blank page, so I took a look in the console, and found the following errors:

Error: [$location:nobase] $location in HTML5 mode requires a tag to be present!
http://errors.angularjs.org/1.3.0/$location/nobase
at http://localhost:1337/bower_components/angular/angular.js:80:12
at $LocationProvider.$get (http://localhost:1337/bower_components/angular/angular.js:11060:15)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4152:17)
at http://localhost:1337/bower_components/angular/angular.js:3970:37
at getService (http://localhost:1337/bower_components/angular/angular.js:4111:39)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4143:13)
at http://localhost:1337/bower_components/angular/angular.js:3970:37
at getService (http://localhost:1337/bower_components/angular/angular.js:4111:39)
at Object.invoke (http://localhost:1337/bower_components/angular/angular.js:4143:13)
at http://localhost:1337/bower_components/angular/angular.js:3970:37 angular.js:11358

Error: [$compile:ctreq] Controller 'ngInclude', required by directive 'ngInclude', can't be found!
http://errors.angularjs.org/1.3.0/$compile/ctreq?p0=ngInclude&p1=ngInclude
at http://localhost:1337/bower_components/angular/angular.js:80:12
at getControllers (http://localhost:1337/bower_components/angular/angular.js:7447:19)
at nodeLinkFn (http://localhost:1337/bower_components/angular/angular.js:7627:33)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6991:13)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6994:13)
at nodeLinkFn (http://localhost:1337/bower_components/angular/angular.js:7618:24)
at compositeLinkFn (http://localhost:1337/bower_components/angular/angular.js:6991:13)
at publicLinkFn (http://localhost:1337/bower_components/angular/angular.js:6870:30)
at http://localhost:1337/bower_components/angular/angular.js:1489:27
at Scope.$eval (http://localhost:1337/bower_components/angular/angular.js:14123:28) angular.js:11358(anonymous function) angular.js:11358

Hoping you are still interested in maintaining this project, and can provide insight. I'm happy to offer my help in keeping it updated, once I get more fluent in sails. For now, I'm just a Rails guy trying to get up to speed.

Thx.

Using this frontend with a blueprint api.

As a test, I took this repo and removed all your controllers and routes code on the backend and changed the blueprint prefix to "/api".

I also added autoWatch: true in the config/blueprint.

In theory I think that should work, and it is halfway working...

Now when I write a message, it comes up in the second window (realtime), but doesn't show in the original window from where it was typed..

I get this error on the server
error: Invalid usage of userpublishAdd(id, alias, idAdded, [socketToOmit])
I found its coming from pubsub line 912.

This is kind of a specific sails problem. Maybe a bug? If someone confirms I will post it on the beta repo

testing

Hi Ryan,
I'm testing your repository as I'm planning on upgrading my apps to sails 0.10 so I'm putting my app through some test and decided to see how I might apply some your concepts. I'd like to create a few uses with credentials but I'm having some issues.

I register test with your pre-assined password and john with password 123456 but can't use those credentials to login. As I don't see the password begin stored in any format I'm not sure what I can be doing wrong.

The console reports and error after adding a new message "invalid user 'publishAdd(id,alias,idAdded.... error"

When starting the app a flicker display problem occurs.

I tried to use Mongo as the storage but can't get past the login although the messages are stored after I register a new name.

TIA
John

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.