Technology Stack - MERN
We have decided to build our initial Voluntari.ly using the MERN Software stack.
What is the MERN Stack?
A stack is the combination of technologies used to create a web application. Any web application will be made using multiple technologies (frameworks, libraries, databases etc).
The components of the MERN stack are as follows:
- MongoDB, a NoSQL database
- Express.js, a web application framework that runs on Node.js
- React.js, JavaScript Front End component framework that run in browser JavaScript engines
- Node.js, an execution environment for event-driven server-side and networking applications
MongoDB: A cross-platform document database
MongoDB is a NoSQL (non-relational) document-oriented database.
While conventional relational databases have a typical schema design based on columns and tables, MongoDB is schema-less. Data is stored in flexible documents with a JSON (JavaScript Object Notation)-based query language. The content, size, and number of fields in the documents can differ from one to the next. This means that the data structure to be changed over time.
Voluntari.ly platform operates around a few key entities - people, activities, opportunities, skills & badges. These are well represented by simple JSON documents and are likely to evolve over time as new features are added. Using MongoDB we don't need to spend much time developing ERD and schema diagrams, we can add new elements to the entities easily and we can deliver them quickly to an API. items can easily be mocked and we can hold initial database state and test documents in the code repository.
For the production services we can use an Fully managed MongoDB as a service on any of the 3 main cloud providers through Mongo Atlas.
In the Azure Marketplace Microsoft has released Database as a service for MongoDB.
MongoDB on:
Mac: install it and enter mongod into the command line
Windows; Open a command prompt window as administrator and type net start mongodb
To stop: net stop mongodb
Express: A back-end web application framework
Express is a web application framework for Node.js, another MERN component. Instead of writing full web server code by hand on Node.js directly, developers use Express to simplify the task of writing server code. There’s no need to repeat the same code over and over, as you would with the Node.js HTTP module.
The Express framework is designed for building robust web applications and APIs. It’s known for its fast speed and minimalist structure, with many features available as plugins.
At this stage we believe Express is sufficient for us to develop and maintain the API layer.
React: A JavaScript library for building user interfaces
React was originally created by a software engineer at Facebook, and was later open-sourced. It is maintained by Facebook, as well as a community of development companies and individual developers.
The React library can be used for creating views rendered in HTML. React views are declarative. This means that developers don’t have to worry about managing the effects of changes in the view’s state (the object that determines how components behave) or changes in the data.
Instead of relying on templates to automate the creation of repetitive HTML or DOM (Document Object Model) elements, React uses a full-featured programming language (JavaScript) to construct repetitive or conditional DOM elements.
With React, the same code can run on both the server and the browser.
React anchors the MERN stack. In a way, it’s the defining feature of the stack. It’s the one component that differentiates MERN from MEAN, another popular JavaScript stack that uses AngularJS (a front-end web application framework) instead of the React library.
We selected React for Voluntari.ly as it is mature, well known in the developer world and will allow us to build a user interface design which is a mix of static and active pages. Also most of the examples built at our first Hackfest used React so it is clearly popular among our likely contributors.
Node.js: A cross-platform JavaScript runtime environment
Node.js was initially built for Google Chrome, and later open-sourced by Google in 2008. It is built on Chrome’s V8 JavaScript engine. It’s designed to build scalable network applications, and can execute JavaScript code outside of a browser.
Node.js works without an enclosing HTML page, instead using its own module system based on CommonJS, to put together multiple JavaScript files.
Node gives us access to a large and growing component library and a functional programming paradigm.
For the estimated size of our application, the number of users and entities etc we don't have concerns about performance capacity and scalability.
The Benefits of the MERN Stack
The main advantage for developers using the MERN stack is that every line of code is written in JavaScript. This is a programming language that’s used everywhere, both for client-side code and server-side code. With one language across tiers, there’s no need for context switching.
For tech stack with multiple programming languages, developers have to figure out how to interface them together. With the JavaScript stack, developers only need to be proficient in JavaScript and JSON.
As we will be relying on a crowd of open source volunteer developers as well as occasional participants in hackathons and weekends of code we want a system that is both engaging and interesting to work in, is easy to get up and running with, can maintain good quality code and test coverage, and is well supported by build, CI/CD tools.
Hosting - Where will this all run?
We wish to remain platform agnostic. As an open source project we want to allow implementors to be able to deploy to any infrastructure and not be tied to a specific cloud hosting environment.
While we hope to run our own production instance on a service donated to us we won't design in ties to a specific service provider.
For the MVP we do not think our application is sufficiently complex to require an architecture involving things like docker containers and kubernetes. All the elements required can be pulled into a dev or production environment easily running on standard IaaS or PaaS offerings.
As we have selected MERN as the code stack all we really need is a place to run Node and Mongo DB. i.e any standard linux environment.
Also the code base should run on both windows and OSX developer machines.