简体   繁体   中英

The JavaScript Only Tech Stack

If I only want to use JavaScript on the client AND server side for my future web projects, how would this Javascript embracing tech stack look like? Are there any data stores/formats that are more idiomatic/JS friendly than the rest?

The idea is to use JavaScript for single page web apps where most of the rendering is done on the client.

The closest thing to a standard setup for this kind of app AFAIK is something close to this:

  • Node.js server app (often using the Express framework)
  • Backbone client app (typically with jQuery to control the interface)
  • Socket.io for communication between the two
  • Your choice of NoSQL database for persistence (there are Node.js adapters for all the common ones)

Fog Creek did a write-up of the stack they used to make Trello , which is essentially this.

(Incidentally, for clients that read a lot more than they write, I'd recommend taking a look at Server-Sent Events in lieu of Socket.io. They're a less heavy way to do one-way stream-based communication.)

There are lots of questions here, but you probably already have the answer to most of them. Not addressed is a good data layer -- look into MongoDB and Mongoose.js (a nice Node interface to MongoDB). Essentially, MongoDB is a persistent store for JSON objects, which works perfectly when you're programming with javascript. It uses javascript as its internal query language as well.

For an interesting take on this kind of setup in the real world, check out this article (I am affiliated with that company/product, but it's still a good read).

It would look like

node.js + any of the multitudes of client side javascript frameworks, jquery, sencha, yui, backbone, ember, sproutcore, etc....

服务器端的Node.js可能正是您想要的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM