NG Snakeoil: A Technology Walkthrough
NodeJS
If you aren’t confused by the previous pages you’d definitely be lost with this one.
NodeJS is a development tool for creating server side JavaScript code (Server side means the software is running on another computer).
Node.js is an open-source, cross-platform JavaScript run-time environment for executing JavaScript code server-side. Historically, JavaScript was used primarily for client-side scripting, in which scripts written in JavaScript are embedded in a webpage’s HTML, to be run client-side by a JavaScript engine in the user’s web browser. Node.js enables JavaScript to be used for server-side scripting, and runs scripts server-side to produce dynamic web page content before the page is sent to the user’s web browser. Consequently, Node.js has become one of the foundational elements of the “JavaScript everywhere” paradigm,[4] allowing web application development to unify around a single programming language, rather than rely on a different language for writing server side scripts.
The SnakeoilOS WebApp is developed using NodeJS, so you would assume the application is running on the SnakeoilOS machine. That is not the case at all. All the SnakeoilOS web files are stored on the SnakeoilOS computer. But when you connect to the SnakeoilOS machine from a browser (e.g. Chrome, Safari, Firefox), the software is copied from the SnakeoilOS to your browser (this can be on your PC, MAC, tablet, mobile phone etc) and then the software is actually running on your device and not the SnakeoilOS PC.
This is called client-side scripting, and this is a big change from SnakeoilOS 0.1.x (100% server-side).
So why use NodeJS (meant for server-side) to develop something for client-side? When developing the SnakeoilOS on NodeJS, the server-side part actually generates the JavaScript code and sends it to the browser to execute on the client side.
This whole approach is counter-intuitive, but it works out really well in practice.
NodeJS is only used for development. Every SnakeoilOS release contains only client-side Javascript code.