10 ms·
Tower.js - JavaScript Framework for Node.js modeled after Ruby on Rails
- jsavimbi 15y agoLooks interesting. I will download and have a look.
- mutewinter 15y agoGitHub Repo - https://github.com/viatropos/tower https://github.com/viatropos/tower Source for towerjs.org (written with Tower.js) - https://github.com/viatropos/towerjs.org https://github.com/viatropos/towerjs.org
- Kiro 15y agoNice and finally a Node.js framework I will be able to understand.
- mcantelon 15y agoAnother Rails-inspired Node framework built on Express: http://railwayjs.com/ http://railwayjs.com/
- zzzmarcus 15y agoLooks like it may have been abandoned. Last commit was 5 months ago. https://github.com/anatoliychakkaev/railwayjs.com/commits/master https://github.com/anatoliychakkaev/railwayjs.com/commits/ma...
- mcantelon 15y agoThat is the repo for the project's website, not the prohject itself. Here's the project repo: https://github.com/1602/express-on-railway https://github.com/1602/express-on-railway
- fauzias 15y agoIt is not, it was moved to this repository https://github.com/1602/express-on-railway https://github.com/1602/express-on-railway for some reason.
- thetrendycyborg 15y agoThe best part about this in my opinion is that the controller system works on both the client and server. I've been waiting for this, was planning on building it myself if no one figured that out. I hope this grows. I'd love to contribute too.
- rgbrgb 15y agoUnfortunate naming conflict... http://towerjs.com/ http://towerjs.com/
- eldude 15y agoThanks for the efforts and the framework. Unfortunately, I cannot properly appreciate it for the following reason: Please don't call something JavaScript if it's actually all in CoffeeScript (even if it's just the documentation). A lot of us have not bothered to learn CoffeeScript and a good many of them have no intention of doing so. My time was wasted following a link that says "JavaScript", a language I know well, only to discover it was in CofeeScript, a language I have not bothered to learn, nor do I plan to anytime soon. I would down vote this if I could merely for the mislabeling. If you love CoffeeScript enough to use it as you obviously have, own it, advertise it openly and stop being in denial that CoffeeScript as a written language is different from JavaScript as so many CoffeeScripters seem wont to do.
- krmmalik 15y agoIt was the coffeescript that put me off too. I dont have anything against CS, i just dont want the additional overhead of having to learn it
- franze 15y agolearning is the overhead with the best return on investment.
- zalew 15y agonot everybody wants to jump into learning solutions that solve other people problems, prefer to learn the ones that solve theirs. if someone doesn't need coffeescript, there's no ROI.
- pooriaazimi 15y agoBut you really don't need to learn CS... It's just a slightly different syntax that you can learn literally in 20 minutes, but makes your code more robust and clean (eg; no more comparing against "undefined" and then nil, just put a ? after variable name - it saves you time and you don't accidentally forget about it. It makes your code better) Nobody would argue about his comment if CS wasn't such an easy language to learn. If you know PHP, you can learn writing in ASP.net in a week, but if you know JavaScript, you can sing in CoffeeScript in an hour.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- jaredhanson 15y agoLocomotive is another option writing MVC web applications in Node, using the familiar structure from Rails: http://locomotivejs.org/ http://locomotivejs.org/ It's strictly focused on the backend, and remains strongly view and database agnostic.
- matt2000 15y agoWould some node.js experts mind weighing in here with pros and cons of this framework as they see it? I'm too new to node to really understand the tradeoffs here. Thanks!
- adamrmcd 15y agoSecond. While I'm no expert, I did attend a Node.js Bootcamp this past weekend. One of the topics brought up was Coffeescript and how unwieldily it can be, especially if you mix it with straight-up Javascript, and by extension jQuery. While avoiding any new FUD, and since Tower.js is Coffeescript and jQuery top heavy, wouldn't this inevitably lead to conflicts? (Side note, at the bootcamp the framework recommended was Express.)
- chc 15y agoI have no clue what these people were talking about. Unwieldy how? What kind of conflicts? CoffeeScript is totally compatible with JavaScript — in fact, it bends over so far backwards to be compatible with JavaScript that it falls way short of its potential. This all sounds like FUD from some antihipster who just likes to hate on new things. (Which is not to say he or she isn't a smart person overall — everybody has some area where they're irrational.)
- jashkenas 15y agoThen I'm sorry to inform you that some FUD did indeed rub off on you at your Node.js Bootcamp... CoffeeScript semantics are just JavaScript semantics, which means that CoffeeScript can seamlessly use any JavaScript library, and vice versa, without any special effort needing to be made. This is perhaps the most significant difference between CoffeeScript and most other compile-to-JS languages (https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS https://github.com/jashkenas/coffee-script/wiki/List-of-lang...). The one feature that you might find yourself relying on in a project like Tower.js is easy access to the prototypal inheritance found in CoffeeScript's "class" keyword ... but you can easily have your library expose that as a helper function.
- 15y ago
- juliennakache 15y agoIs there any way to share models with the client and the server ? I'm not sure a pure MVC (or a Model2) is the best way to architect node web applications. The config part looks great, I'll read that more carefully tonight.
- yawnt 15y agoi don't see why you should force someone to use coffeescript though
- phleet 15y agoWhile I agree with some others here that calling it a JavaScript framework is a bit of a stretch, there are legitimate reasons to do this in coffeescript as opposed to javascript. In particular, the Rails-y way of doing things requires particular concise classical OO abstractions that are difficult to provide in a pure prototypal JavaScript way without introducing your own class library (which there are far, far too many of). For example, if you look at the definition of the App.User here: http://towerjs.org/models http://towerjs.org/models, trying to do the same kind of thing where you can quickly declare a class that extends a base class and adding things to it can become quite awkward. You'd have to manually construct the prototype chain (or use the library-specific class DSL) and have to repeat the class name in order to call the "field" method there. TL;DR Rails uses mixins and classical OO extensively, CoffeeScript facilitates this, JavaScript makes it difficult.
- trustfundbaby 15y agoThank you for taking the time to explain that, I hadn't even thought about it like that, the venom in some of the other responses to people who are skeptical of coffeescript is really alarming.
- alttab 15y agoI'm admittingly a little ignorant when it comes to node, but isn't making it more like Rails a step in the wrong direction?
- thetrendycyborg 15y agoNode isn't an application framework, it's an event-driven javascript-based server. This is totally an acceptable way to handle it, so long as it takes advantages of Node's event-based system.
- techwraith 15y agoGeddy is another framework for node that is "rails-like" - the models work on the client side too. http://geddyjs.org http://geddyjs.org
- franze 15y agoam i the only who is not excited by any "RoR"-like framework? i like node because it lets me build small standalone programs/apps which i can link together to act like on big project. i - for one's part - found that having one master-overlord framework kills a lot of the joy of programming. ok, there is the "it's much more manageable" argument, but well, my experience is that big apps on RoR need much more maintenance work then similar programs on much uglier stacks (i.e. webprojects using LAMP) said that - after reading some of the docs - i will probably give towerjs a try.
- ascendant 15y agoThe bulk of today's web devs are coming from Rails and it's nice to have that hand-holding when you're trying to cross that chasm. Besides, a lot of the concepts that RoR were built on are sound (i.e. don't reinvent the wheel every time you make a new project), even if Rails has become as bloated as the technologies it replaced (J2EE, .NET).
- pak 15y ago>The bulk of today's web devs are coming from Rails Ahem, you're exaggerating there just a little bit. There are probably around a dozen web frameworks that are competing for the spotlight right now. With Zend, CI, Django, Symfony, Struts, Cake, etc. all equally if not more popular it's hard to say Rails has the "bulk" of today's web devs. I wouldn't even go as far as saying that the bulk of today's web devs appreciate MVC.
- tylerlarson 15y agoWho cares how many people use these frameworks, most of them are using the same MVC structure and are just stealing features from each other. Some of the Node people like things small but when applications get bigger putting things into an MVC structure often makes your code more organized. Until someone comes up with a better idea that takes off this is how things will be done and I think it's great that Node has a few choices now to do this.
- cmatthieu 15y agoHas anyone tried deploying a tower.js app to Nodester yet? Let me know if you need a hosting coupon - chris@nodester.com
- drumdance 15y agoI have an API in rails that I'd like to move to Node without having to re-write all the ActiveRecord code as SQL. Am I right to assume this is a good tool for that?
- thelastnode 15y agoRegarding the Coffeescript-Javascript difference, Coffeescript and Javascript can be used transparently in node. Once require('coffee-script') is run, the module replaces the require function with one that can load both Coffeescript and Javascript. This means that if there is a file ./lib/foo.coffee, the following code in bar.js will work: require('coffee-script'); var foo = require('./lib/foo'); Yes, some people may not like Coffeescript anywhere in their project, but this functionality makes it easy to add Coffeescript to an existing Javascript project or use Coffeescript modules as a blackbox in a Javascript project.
- eldude 15y agoThat's pretty cool. I didn't know that worked so seemlessly. Nonetheless, in order to use a library, you must either read the documentation or the source. The biggest issue is that most CoffeeScript projects document with CoffeeScript. Technically, you could read the compiled source, but that's usually a non-starter unless I truly need your project. Otherwise, I'm more likely to find someone else that's solved the same problem, but has written their docs / source in JavaScript.
- stephth 15y agoWhere/how do events fit within this framework? Couldn't find any explanation of it on the project page (or here...).
- chadhietala 15y agoThis looks good. I've messed around with Railways http://railwayjs.com/ http://railwayjs.com/ but some parts are funky and the docs haven't been updated since they opened the project. Also looked at Matador http://obvious.github.com/matador/ http://obvious.github.com/matador/ and actually was re-writing it in coffeescript to use CS' classes instead of the Klass plugin, but lacked docs. Zappa http://zappajs.org/ http://zappajs.org/ is written CS but really isn't an MVC. This looks well documented and it's in CS which I like. +1
- tjholowaychuk 15y agomoar rails? moar coffeescript?
- copremesis 15y agoTitle update: Tower.coffee - CoffeeScript Framework ...
- moe 15y agoWho cares? There is express, geddy, railwayjs, djangode, drty, Locomotive, spludo and probably a few others that I missed. All of them are modeled after rails/django. The last thing the node-ecosystem needs is yet another half-baked rails-clone. This may come across harsh but I really don't understand why people keep beating that dead horse instead of tackling the node-vision: Build a framework that spans client/server. Make it good. Start by not pouring your time into yet another rails-clone...
- thenduks 15y agoI disagree that node doesn't need more projects like this. And I disagree that express/geddy/etc are 'modeled after rails/django'. But, a framework that spans client/server could be really interesting. Have you seen Derby? http://derbyjs.com/ http://derbyjs.com/
- chc 15y agoFor anyone turned off by the CoffeeScriptiness of the page, here's a bookmarklet that will compile the CoffeeScript into JavaScript: javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22http://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.6.1%22,function($,L)%7B$.getScript(%22http://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.2.0/coffee-script.min.js%22,function()%7Bvar%20a;a=$(%22code.coffeescript%22);a.each(function()%7Bvar%20a;a=$(this).text();return%20$(this).text(CoffeeScript.compile(a,%7Bbare:!0%7D))%7D);return%20a.each(function()%7Breturn%20prettyPrint(this)%7D)%7D);%7D); Aside from CoffeeScript's __hasProp and __extends boilerplate at the top of each code sample, it's pretty readable if anyone's interested. I still think it ought to decide whether it wants to be a CoffeeScript or JavaScript framework, though.
- tyok 15y agoWhy don't you put the link to the source code[1] on the website? I have to actually search it via google. [1] https://github.com/viatropos/tower https://github.com/viatropos/tower
- thenduks 15y agoLink is on the upper right of the page. 'Fork me on GitHub'.
- VeejayRampay 15y agoSo I see the rage is all about dissing Rails as often as possible these days, more often than not in the Node community. Yet Tower is a virtual copy and paste of the popular Ruby web framework and it's pure awesome. There is something of a schizophrenic behavior at work here. I am a Rails dev, I love the framework for all its strengths and would choose to live with its (relative) shortcomings any day but I think there's something not healthy about how it seems that a new (web framwork|language|paradigm|whatevs) always has to (kill|take a dump on) the competition to claim the spotlights. The two technologies can co-exist without a problem, there are many pieces of software to fill that gap without having to reinvent the wheel where Rails does the job just fine. And to anyone saying Rails has become "bloated", quit the catchphrases-based rhetoric already, a Rails project is nothing more than a set of conventions and classes, the developer (that's you) has a choice of tools every step of the way, so if your app is bloated, stop producing bloated code or hopelessly waiting for a silver bullet, IT IS NOT HAPPENING. NEVER. NODE WON'T BE IT EITHER. Three years from now, some clever dude will come up with a new fresh concept, Node will suddenly be so 2012 but deep down you'll know. You'll know it's the same old caper below the latest layer of paint and glitter. Props to the people who worked hard on Java frameworks who make tons of people happy in the heavy infrastructure enterprise realm, props to the people behind PHP and associated frameworks, props to Rails dev for pushing the envelope and making me enjoy programming again and props to Ryan Dahl, Google and Joyent for making Node happen and shaking the bottle once again. It does NOT have to be X VS Y VS Z.
- nathan_f77 15y agoThis looks amazing.
- nawariata 15y agoI "like" how there are currently 96 comments in this thread and not even one touches the subject, discussing merits of tower.js.
- ksec 15y agoI thought of the same as well, would really like some constructive discussion on the differences.
- clyfe 15y agoI had a similar endeavor having it built on top of Express.js ecosystem: https://github.com/umbrellacorporation/umbrella/ https://github.com/umbrellacorporation/umbrella/
- elliottkember 15y agoI got really excited about this, thinking it was a Rails-style front-end framework. It's still really cool as a server-side framework, but I'm totally hankering for a full Rails stack in the browser. I've used Backbone and played with Spine - I just can't help but feel as though they could go all the way. I wonder whether that's viable?
- amalag 15y agoThis has turned into a debate on coffeescript. Would love to get more explanation from a Rails developer point of view about how the integrated javascript client/server model works.