

Sails.js – Real-time MVC Framework for Node.js - Dekku
http://sailsjs.org/

======
mclenithan
I have had the chance to play with Sails and I really like it. Just a warning,
this is a great tool for _simple_ web apps. I wouldn't take the Sails path if
you are going to do something a little more tailored, (like Nodejs +
PostgreSQL w/ Sequelize + Redis for sessions + memcached + MongoDB for
analytics + passport w/ Oauth2 + etc.. ), I would leave that to express +
express-routes. I would definitely chose Sails for demo'ing a product idea or
personal projects I want to get up and over with as quickly as possible, and
Sails is REALLY quick.

I can't wait to see how Sails evolves, they are some damn good dev's.

------
jongold
Great stuff.

Whilst getting in to Node from Rails (& Meteor) I've found the lack of
backend, structured MVC frustrating. Apparently it's not 'Nodey' to make a big
framework like Rails, but I'd rather figure that out myself in due course
rather than using Express and having no idea what to do after the trivial
stuff you see in tutorials…

~~~
nilkn
Correct me if I'm wrong, but isn't Meteor built on top of Node? Though I
suppose it does, as far as I remember, completely hide the Node container. (Or
did I misparse your sentence?)

~~~
jongold
Yup, but it's super abstracted — I run the London Meteor meetup but still have
no idea how Fibers work :)

I've now written a couple of production apps with Meteor but it always feels
like I'm writing frontend JS with a magical backend (and a couple of server
methods) ala Parse, rather than building apps with Node.

------
mgkimsal
Not sails-specific, but

sudo npm -g install sails

Why do so many projects require sudo? Why are we writing to any area which
would require root write privileges? Why do we not default to just writing
stuff in to user home directories and patching off that?

Possibly naive question, but one which is increasingly bugging me.

~~~
progx
I think on github
[https://github.com/isaacs/npm/issues](https://github.com/isaacs/npm/issues)
is the right place to ask this, or tho add a feature request.

"-g" ist for global installations and you want a "-l" for user local
installation.

~~~
IsaacSchlueter
-l does not mean "local". -l means "\--long" and has no relevance to the install command.

Local is the default state. If you want to force non-globalness, you can do
`--no-global`

------
nahname
GET requests to create users. What could go wrong?

~~~
kennethkl
How did you manage that? o.0 Re-wiring the routes?

~~~
city41
I believe he's refering to this

    
    
        # Create a new user 
        http://localhost:1337/user/create?name=Fisslewick
        (or send an HTTP POST to http://localhost:1337/user)
    
      

From:
[http://balderdashy.github.io/sails/](http://balderdashy.github.io/sails/)

------
altcognito
The back button is broken and it doesn't appear to support HTML5 history by
default in browsers that support it. (uses hash for tracking pathing)

~~~
nicksergeant
That's really more of a concern for your front-end framework than your back-
end framework, though.

------
xutopia
It doesn't have associations between models yet but it does have amazing
branding.

~~~
1qaz2wsx3edc
I don't think you're forced to use their model layer.

~~~
lucisferre
Technically you're not forced to use Sails.js at all. I'm not sure that's the
point though.

------
bdcravens
Totally off-topic and maybe even trollish, but I noticed the cute little
illustration here:
[http://sailsjs.org/#getStarted](http://sailsjs.org/#getStarted)

Interesting that the female is skinny, with a trendy little mid-riff baring
shirt, and attractive (so far as a stylized comic character can be). One of
the male characters is a pudgy dude with glasses. It seems the norm in
characterizing girls in tech is "you can be a developer, but stay sexy - you
don't have to be a nerd!" Does this risk marginalizing normal women?

~~~
mikermcneil
One of the two designers who worked on it is a woman-- feel free to ask her:

[https://twitter.com/KallunaLovegood](https://twitter.com/KallunaLovegood)

~~~
bdcravens
Whether or not a woman did the design isn't the point. This particular design
wasn't even the point. I was questioning what seems to be a trend.

~~~
WayneDB
The person you're responding to didn't say that a woman designer was the
point.

They said you can feel free to ask her your question.

I wish you would too, because I can't stand coming into a thread about some
cool new technology and having it turn into a melodramatic women's study.

------
pg_bot
Hmm seems to be broken currently on OSX. (Not sure if sails or node is the
problem) Following the steps on getting started guide.

    
    
      brew install node
    
      sudo npm -g install sails
    
      sails new testProject
    

command not found: sails

Also from a UX standpoint I would point the user to another page where they
can continue learning about the framework after the download is finished.

Right now it states "Now, let's get Sails to do cool stuff." and leaves the
user hanging with nowhere to navigate to.

~~~
brodo
Npm should be used without sudo, like homebrew. I guess thats the problem.
They should change that.

~~~
mistercow
I don't think npm install -g works without sudo under most default
configurations.

------
lmm
I know nothing about the framework (and I don't see any examples or anything
that tells me _why_ it's any good), but that is a _beautiful_ landing page.

~~~
kbojody
It does look amazing, and maybe its just my PC but on Windows 7, the bullet
text below is almost impossible to read. Could also be my display. It looks
fine on my Nexus 4, and is _ok_ on Ubuntu.

Maybe my font aliasing is just messed up. Thin fonts have never really looked
great on windows for me.

~~~
jongold
Have you got Cleartype disabled?

------
VeejayRampay
This looks like an awesome project and the overall design is absolutely great,
kudos. One thing that amuses me though is how part of bootstrapping the Node
user base was built upon a lot of Rails-bashing, only to find out a few years
later that most of the frameworks are basically trying to recreate some form
of Rails in Javascript.

All the best to the authors nonetheless.

------
anondesign
It looks pretty well thought-out, which is a big +1 when I'm framework
shopping. However: use pushState/replaceState! Or at least fix your buggy back
button. Your hash-based navigation totally breaks the back button to a point
where I can't believe you shipped this.

~~~
anondesign
Also: don't forget to use manifest files to concatenate your compiled CSS :)

~~~
mistercow
Or you could just use LESS and @import your styles. LESS @import for other
LESS files works much like C's #include, rather than simply converting to a
CSS @import line.

~~~
anondesign
He's using rails, so he can use SASS (which personally I like better than
LESS, but they accomplish the same things). Manifest files are better though,
because with LESS's @import, you might import more files than you actually
want. I believe you also have the recursive import issue, just like C.
Manifest files give you more granularity by existing outside of the actual
stylesheet.

------
mikermcneil
Hey if anyone's curious about what this is, here's my video:
[https://www.youtube.com/watch?v=GK-
tFvpIR7c&feature=youtu.be](https://www.youtube.com/watch?v=GK-
tFvpIR7c&feature=youtu.be)

------
Zolmeister0
This Sails.js tutorial is really good:
[http://net.tutsplus.com/tutorials/javascript-ajax/working-
wi...](http://net.tutsplus.com/tutorials/javascript-ajax/working-with-data-in-
sails-js/)

------
spullara
This word real-time. I do not think it means what you think it means.

~~~
notb
But.. Socket.io is built in sooo realtime ... Right?

~~~
geuis
Yes, it is. We are mostly professionals here and understand the limitations of
technology, specifically when talking about latency and implementations
ranging from websockets to long polling. We look past these minutiae and get
to the real subject of getting data to the user as soon as possible.
Generically, this is referred to as "real time".

~~~
lucisferre
I actually wish we called this something else like say "persistent". Real-time
systems have a very specific meaning for many people and while yes we all _get
it_ , it is probably a point of distraction for a lot of people to hear this
term constantly misused.

------
lucisferre
How does sails handle assets, do you have something similar to sprockets that
can be added to this?

~~~
particlebanana
In the upcoming v0.9.0 release we are using Grunt for assets.

------
hhandoko
Off topic, but the choice of port for a Sails app is quite interesting, "1337"
[1].

[1] [http://sailsjs.org/#getStarted](http://sailsjs.org/#getStarted)

------
heldrida
Hi! I've tried a couple of days ago and after running the getting started,
noticed that none of the tutorials in the right column were available. Did
this changed ?

------
chevreuil
I'm not too versed in Node frameworks : is Sails a direct competitor to Meteor
? If so how is it different ?

~~~
progx
I did not see the difference, only that Sails has a smaller scope. With Meteor
you can change all frontend-data of connected clients "in realtime", but Sails
did not have this key feature. So iam not sure why i should use Sails, when i
can have more with meteor?

~~~
brodo
Warning, this is a rant.

I've started a Meteor.js Project 3 Weeks ago and I'm regretting it. It's an
architectural nightmare. It uses global variables for everything. One would
think the news, that this is a bad idea, would have spread since the 70's.
Unit tests are not possible in this style. You can do integration tests with
the Laika Framwork though.

The next problem is a severe case of "note invented here" syndrome. Packaging,
data access, Templating - Meteor.js has it's own. For example, they have their
own version of Handlebars which I did not realize until yesterday. It has some
documented and some undocumented differences to the original one. I had lots
of fun with some custom Handlebar helpers that I wrote. I tested them against
the original Handlebars and they passed all my unit tests. In the project
however they did not work at all.

As KaoruAoiShiho said the bindings suck terribly. Well, they don't exist
really, you just use jQuery. (Thank god, they don't roll their own version of
that.)

The elephant in the room is data access. If you're a MongoDB fan like I am
they will lure you in with the fact that you can use MongoDB directly form the
client. Don't fall for that, it's a terrible idea. It's such a terrible idea,
that they introduced 'server methods' to kind of fix all the problems with it.
Server methods are not REST. Server methods are RPC style web APIs. Welcome to
10 years ago. They dislike REST because it's stateless. (at least that's what
i've taken form this talk:
[http://www.youtube.com/watch?v=NnMqMAYmTuo](http://www.youtube.com/watch?v=NnMqMAYmTuo))
As you might have realized by now these guys just LOVE state. State and global
variables.

If you're a Haskell programmer and you are not jet curled together into a ball
and crying, id's suggest to quickly read a monad tutorial before continuing.

Dependency management is also a big problem. You can't just use nodes good old
`require` and `module`. The order in which files are loaded is determined by
their name and position in the directory structure. I shit you not.

They have also their own build tool. (who would have thought...) It watches
your files and compiles them. Which works great most of the time. You can't
have includes in your SASS/LESS/Stylus files tough. I guess the notion of
having a proper module system scares it a little. I found this thing to be the
best aspect of my whole Meteor experience. Not as good as Grunt though.

Per default, there is no routing. There is an unofficial routing package which
works good, but is by far not as feature rich as the Express one. It also
introduces some more global variables in true Meteor.js spirit.

In my opinion Meteor is good for prototyping. You can get a small app up in no
time. Just don't build anything real with it.

~~~
progx
Thx for that huge info! I only read about meteor and their informations on the
webpage, i want to use it in some weeks for a smaller project, but now i will
look closer at meteor before i use it.

------
criswell
I keep reading it as "snails". It looks like fun, though. I look forward to
playing with it.

------
throwit1979
I don't think "real time" means what you think it means.

------
xoail
So how is it different from Express.js?

~~~
c0mpute
Express isn't really much of a client side MVC framework. It is still a very
clean and simple framework.

If you want to drink the cool aid of single page apps, 'rich' client side etc,
you have to invest into some MVVC/MVC frameworks like Angular, Ember or now
Sails, which works well with Node.js apparently.

~~~
kayoone
imo Sails is a backend framework to be used with Node, while you can use
Ember/Angular/whatever on the frontend side.

~~~
c0mpute
You are right. Having not gone through what Sails was, I have mis-represented
it a bit. Its more RoR than Sinatra (Express) as others have expressed here.

