This question already has answers here:
Is there a JavaScript MVC (micro-)framework? [closed]
(30 answers)
Closed 10 years ago.
I'd like to build an app in JavaScript that follows the MVC pattern using a framework that is packed with features like Ruby on Rails. I know Rails fairly well and having a "JavaScript port" of it would be nice. (When I say "JavaScript Port" I don't mean literally, just something similar.) I want to use JavaScript both on the client side and server side. I'm sure that unlike Rails, the client-side will be much heavier and that's fine. I imagine the server-side of it would run on Node but I'm open to other ideas.
My question is basically, what's the closest JavaScript framework to Ruby on Rails? If there is not one solution, what combination?
In 2012 was Railway Node.JS MVC framework based on ExpressJS, fully ExpressJS-compatible. It allowed you to build web applications in a similar manner as in Ruby On Rails.
In nowadays there is good frameworks like CompoundJS and Sails.JS
Server Side (for Node):
Geddy is very "railsy" http://geddyjs.org/
Client side:
Ember.js: http://emberjs.com/. There is also Rails integration gem. Yehuda Katz and Tom Dale are the main developers, you can know them from Ruby world :)
I would check out Meteor.js. It's JS on client and server side (using Node.js) and rather than an MVC framework, it binds your models to your views using web sockets so that changes to the server get pushed down to the client and the page is updated instantaneously.
Because it uses the reactive model rather than MVC, it's not quite like RoR, but the frameworks do have productivity and developer friendliness in common. Meteor uses smart packages (like RubyGems) that can seamlessly add functionality to your app, you can get something working very quickly, and you can deploy in the snap of a finger if you choose to put it up on meteor.com (and deploying to your own server is not much different than deploying any other app).
in the client side in the last few months I used Joosy - http://joosy.ws
It is super easy to integrate in rails (it is designed for RoR, and you can still continue using RoR as a backend).
from their website:
..is a javascript framework. Being a harmonious extensions to Rails it introduces everything you like about this framework right to your browser. Ready conventions set, extensive CoffeeScript, HAML support, Helpers, seamless backend integration, automatic code generation and more..
There is also an interesting comparison with BackboneJs and EmberJs here: http://guides.joosy.ws/guides/basics/joosy-vs-x.html
You can look at Backbone. This is developped by ROR developers I believe, it's not a MVC but an MV.
http://backbonejs.org
I haven't used Tower.js but it advertises itself as something similar to what you are looking for:
Built on top of Node's Connect and Express, modeled after Ruby on
Rails. Built for the client and server from the ground up.
http://towerjs.org/
Related
I'm trying to write a program that is composed of two parts. The logic part that I prefer to write in C# language because it's object oriented and more important it's the language witch I know the best among objective languages, and the graphic part witch I want to write it with Html, Css and JavaScript and again because they're the most familiar graphical languages witch I can use. Now my question is that how can I transfer data between a C# console app and a JavaScript browser app.
Any help will be appreciated.
Edit:
I must clarify that I just need C# console app and not a web app or web api, and therefor this part is not a backend project. And I need to run these two program separately and want them to communicate with each other.
What you describe should be a full stack application to be honest
With ASP.NET you create your C# backend, setup controllers which handle the interaction between backend code and the front end, and then on the front end you can utilize both Razor markup for HTML templating alongside standard Javascript.
With Blazor web apps, you can take it a step further and have your backend code compile to web assembly and execute directly on the client engine, but it also integrates javascript interop as well. Just be mindful about whether you want a client side or server side Blazor app, as each do things a certain way and are meant for different use cases
What you describe though, sounds more precisely like you want a seperate javascript app, which should be in communication with an ASP.NET Web API. This way you create your backend and api endpoints, which the javascript app can then make requests against. You can start your research for that with MS's tutorial here
The dotNet command line tools can generate solutions for all of these, an ASP.NET fullstack web app, ASP.NET Web API solution, as well as the various blazor app options. And of course, the standard IDE's like Visual Studio and Rider can create these solutions as well
If you're looking to have direct interop, blazor might be what you're looking for.
https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-6.0
I'm very new to the Java Script world , I use Laravel already for my backend but when it came to the websockets part I kinda got messy , because when I looked for websockets I have read that they all are depending on Node JS for real time apps like chat apps but also I have seen a tutorial making a chat app in Vue Js & laravel echo only without using node js ,
now the messy part for me is , If I want to learn socket.io (for example) should I learn Node Js first ? And is Vue js an alternative for the socketio ?
and How about the ajax ? isn't it able to do the same performance ?
I'm sorry but It's kinda messy for me , I have looked for that but it is still messy for me , thanks for advance
If I want to learn socket.io (for example) should I learn Node Js first?
Yes. Since Socket.IO is a Node.js package, it's kind of a pre-requisite to learn Node. It's one of the easiest tools to learn though, so don't be intimidated.
And is Vue js an alternative for the socketio?
No. Vue.js is front-end framework, which means it's used to build the part of the website you actually see. Socket.io is a package (or framework) that enables bi-directional communication between the front-end and the back-end of your application. You can use it for example to build a chat application.
How about the ajax ? isn't it able to do the same performance?
No. Ajax is short for Asynchronous JavaScript And XML. Which basically means that you use Ajax requests from the front-end to the back-end. The difference here is that Websockets/Socket.IO gives you the bi-directional communication that Ajax lacks. You don't need Socket.IO for all communication though
I agree with everything exposed in the accepted answer except that Vuejs isn't an alternative. It is true that vuejs is a javascript framework to create frontends, but, if you have a nodejs server with a socketio server, you need a client (frontend) which must be able to communicate through socketio. You can see this by yourself here, this is one of the most common vue wrappers library to use socketio from vuejs. I hope this could help
currently I'm working on this project (https://github.com/Giegling/addressbook) and for the backend I use Node.js with Express framework, for the frontend Angularjs. Is it possible to "translate" the backend to Haskell without touching the frontend? If it's possible, which framework should I use? (Yesod, scotty...)
Thanks
Your server simply exposes a HTTP API to your angular app. You can implement that functionality in any web framework (or even without a framework) in pretty much any language.
Yesod is probably the most popular and well documented Haskell framework (personal opinion), so I guess you can start with that.
I am quite a novice when it comes to web application development. The projects that I have done thus far have purely been Client Side and Jquery powered.
Recently I made a discovery that Javascript has an MVC framework (http://backbonejs.org/)
This really excites me as about 90% of my experience to date has been with Javascript, so the possibility of using an MVC framework within a familiar coding language is actually quite awesome.
After some more reading and probing I discovered a local storage adapter for backbone:
http://documentcloud.github.com/backbone/docs/backbone-localstorage.html
Basically if I have understood this correctly - it will store and retrieve data in cookies
So the above framework (backbone) and addin (local storage) will allow web applications to operate in a "server-less" environment.
Before I get crucified by any techies - I do understand that this is a very generous, generic and simplified statement - but I am just trying to find out a few things at this point:
Is my understanding of the framework correct?
Has anyone had any development experience with the above?
Where can I get novice level tutorials on developing MVC Web applications that use Backbone.js
Looking forward to the discussion and your answers
Is my understanding of the framework correct?
First off there are several "mvc" like frameworks for Javascript besides for Backbone.js (assuming you consider backbone.js an mvc framework, take at look at this SO question as well as the official documentation) for example Ember.js, Knockout.js, JavascriptMVC. That said local Storage is a feature of HTML5 and isn't specific to backbone.js (so the browser would need to support it, here's a SO question with some more info on localStorage), what the backbone.js localStorage adapter does is saves the backbone.js data to localStorage instead of the server.
Has anyone had any development experience with the above?
Yes (you can take a look at the questions tagged with backbone.js here on SO for starters...).
Where can I get novice level tutorials on developing MVC Web
applications that use Backbone.js
Have a look at this site for some backbone.js tutorials.
This question already has answers here:
Is there a JavaScript MVC (micro-)framework? [closed]
(30 answers)
Closed 10 years ago.
I have some experience in Ruby on Rails and I want to keep the MVC way to go in my client side Javascript project.
There is any Rails-like framework for Javascript? It should have the following features:
MVC
Easy integration with REST web services
Javascript-driven templating system
Models and validations
Testing framework
A solid documentation is a must!
I discovered backbone.js today. It's worth a look. It appears to be a lightweight abstract MVC system and uses underscore.js and jQuery
As for client side testing this isn't included. There are many standalone unit testing libraries out there.
Just add in any client side testing library you want. With these 4 you really shouldn't need anything else.
There are more heavyweight alternatives like SproutCore or Cappuccino#
Also see a large thread here on the topic by people in the know
I think node.js is worthy a mention aswell in case you want to delegate some of your framework to the server but keep it in javascript. You'll have to look into some of the big libraries running on node though.
Try http://emberjs.com/. It's very ambitious Javascript framework with cool things like UI Bindings and Auto-updating templates. It plays well with jQuery ;)
Javascript MVC is pretty full-featured and has a lot of good testing tools included: http://javascriptmvc.com/
Check out this answer for more info:
Is there a JavaScript MVC (micro-)framework?