-
Notifications
You must be signed in to change notification settings - Fork 0
Backend
Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser. It allows the developer to easily build fast and scalable network applications.
From various forms of research, we decided to use a Node.js server to handle our back end as we have experience in using it and wanted to learn more. It also creates a client/server relationship to for security and allows us to easily update just the server down the line rather than the whole application.
Node.js will be used to handle all file uploads and downloads to our Google Cloud database. It will also be used to upload, edit and delete user and group data from our MongoDB database. There are several other reasons why we chose to use Node.js, which are listed below.
- Fast, scalable, non-blocking, lightweight server applications. It allows for quick response times for requests which would be vital for out application. In tests it was found that Node.js runs 7 times faster than PHP, and can handle double the amount of requests per second on average.
- Support for MongoDB and Google Cloud which we will be using. We originally intended to use firebase but Node.js support was depreciated so we decided to change to Google Cloud storage.
- Stream module makes it easier to work with large files.
- Access to over 450,000 npm modules.
- Not suitable for heavy computational back end processes (E.g. Fibonacci computation), because any incoming requests will be blocked while the thread is occupied with the computation. As our application will handle just post, put, delete and get requests for the various forms of data this will suit perfectly.
- It's also not suitable for a applications with a relational database in behind. This is as relational DB tools for Node.js are still rather underdeveloped, compared to the competition such as Ruby on Rails, Django, or ASP.Net. It can be done but it's just not ideal, however for us it will work well as we are using MongoDB and Google Cloud which have npm modules for Node.js.
Is a web framework that let's you structure a web application to handle multiple different HTTP requests at a specific URL. Express is a minimal, open source and flexible Node.js web app framework designed to make developing websites, web apps, & API's much easier.
$ npm install express --save
Multer is a node.js middleware for handling multipart/form-data, which is primarily used for uploading files. It is written on top of busboy for maximum efficiency.
$ npm install --save multer
Mongoose provides a straight-forward, schema-based solution to model your application data and connect to your MongoDB database. It includes built-in type casting, validation, query building, business logic hooks and more.
$ npm install mongoose