Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Totally JavaScript Web Stack - Middleware, Webserver, DB suggestions?

I'm currently looking for a new web stack to build a hobby project on and would like it to be powered by JavaScript. I've had a quick look at Nitro, NarwhalJS etc. but was wondering if anyone had any solid recommendations or experience of an entire end-to-end javascript/json architecture ( jquery, middleware, standard libraries, db etc.) that they could share.

I'd prefer it to be a stack that you think is going to grow and is actively being looked after, documentation, community of nice like-minded individuals etc.

Thanks in advance.

like image 292
jdee Avatar asked Dec 04 '25 17:12

jdee


2 Answers

Caveat: This answer somewhat fails to meet your basic requirement of personal experience with the resources listed. :-)

Off-the-cuff, there's Jaxer from Aptana and Chrome Server (which, despite the name, isn't related to Google Chrome AFAIK). Speaking of Chrome, though, there's an Apache CGI module that supports server-side scripting using JavaScript via Google's V8 engine, but that doesn't help you much with DB connectivity and such.

I'll also plug Java and Rhino, which I have used a bit. Via Rhino, you can compile JavaScript into Java bytecode (which, if you're using the Sun runtime, is JIT-compiled to machine code by Hotspot). That means you can run JavaScript in any servlet container (Tomcat, Resin, etc.). The joy here is that all of the huge array of goodies available for Java is instantly available to you via JavaScript -- so, MySQL connectors, image manipulation libraries, just about anything you can imagine. It's also amazingly easy to access those resources from JavaScript via Rhino. To give you an idea:

importPackage(java.io);
var f = new FileWriter("test.txt");
f.write("Testing 1 2 3");
f.close();

...and we've just written a file on the server via JavaScript, using Java's java.io.FileWriter class. You can also execute dynamic scripts at runtime via the javax.script package, which (for JavaScript) uses Rhino under the covers, although I'm not immediately coming up with a use case for doing that. :-)

like image 165
T.J. Crowder Avatar answered Dec 07 '25 07:12

T.J. Crowder


For the database part of the stack:

Couchdb uses JSON and REST to store data in a document format. It uses PUT,DELETE for storage - I'm not sure how that would work with Javascript.

like image 21
Chris S Avatar answered Dec 07 '25 08:12

Chris S



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!