Skip to content
Christopher Haugen edited this page Nov 7, 2017 · 21 revisions

Welcome to GOATstack!

Technologies used to build the GOATstack

Main Technologies

The GOATstack is the aggregate of:

  • zero to many databases
  • a server
  • APIs for server-client & 3rd party communication
  • a front end

Within each of the above points comes several packages/libraries/frameworks; each was chosen with one or all of the following in mind: development QOL, security, scale-ability, speed, stability, and consistency.

The GOATstack has been built to give you an organized and efficient way to start developing secure web apps for a variety of use cases with scale-ability and efficiency in mind. Expanding upon the ideas of MeanJS and AngularFullstack.

Let's dive in!

Databases

MongoDB

MongoDB is an open sourced database which uses a flexible document data model, similar to JSON. Instead of using tables and rows, MongoDB uses key-value pairs to achieve fast, and efficient querying capabilities. This flexibility allows development teams to evolve the data model rapidly as their application requirements change.

Sharding can be troublesome at times, however, if the amount of nodes in your project is relatively stable this is a non issue, and should not detract from the value provided by this Document DB

MongoDB uses WiredTiger as their default storage engine. WiredTiger uses MultiVersion Concurrency Control (MVCC) and will continue to mature over time which will give meaningful gains to the end user.

Read the MongoDB documentaion in order to get a better understanding to how this document database can benefit your team!

MongoDB Architecture

The architecture, and core concepts behind MongoDB

Apache Cassandra

Apache Cassandra is a NoSQL database which scales linearly and boasts 100% up-time. This database is should be considered when scalability and availability are of importance to your project.

With zero fault tolerance this database is a good choice for handling mission critical data. Another positive is that Apache Cassandra can scale in real time to meet the traffic demands of your application ramping up to keep up in the busy season or during unexpected spikes in traffic without breaking a sweat. Apache Cassandra can also scale down during slow periods so you don't have to pay for unused resources.

If an enterprise solution is necessary then DataStax Enterprise should be taken into consideration.

SQL databases

If the websites data-set is medium in size, and scale-ability is not an issue then SQL solutions are a viable choice.

SQL databases offer valuable functionality such as joins and ACID compliance

The SQL databases we offer through the GOATstack generator are as follows PostgreSQL

  • MySql
  • MariaDB
  • SQLite
  • MSSQL

Is your database not on here?

That is fine, integrating your preferred database with the stack is just as easy as any other Node.js project, and if you feel like contributing you can submit a pull request with your additions!

Server

NodeJS

Node.js is a javascript server that is runtime built and runs on Chrome's V8 Javascript engine

We chose Node.js for two reasons:

  1. Node.js uses something called the event-driven model; it is a non-blocking I/O model, which is depicted below.
  2. Node.js uses npm, which is the largest package ecosystem in the world. This means there are countless open sourced libraries your team can capitaliize on to accomplish your goals and realize your visions.
The EventDriven model

Read the Node.js documentation in order to get a better understanding on how to utilize this server to make your website lightweight and efficient.

APIs

Express.js

Express.js is a web application framework for NodeJS. This framework comes with a robust set of HTTP utility's and middleware aimed at helping you develop stable, efficient, and predictable API's quickly and easily. This framework takes the focus off of boilerplate code, and let's the developer focus on more important design aspects such as data flows.

Read the Express.js documentation in order to get a better understanding on how to responsibly manage and direct data from one point to another in a secure and efficient manner.

Express Middleware Pattern

Above is a visual representation of the HTTP data-flow which gets filtered, altered, and/or sanitized before it reaches the main task created by you.

Front End

Angular

Angular is a front end framework which aims to close the gap between native application and website.

Read the Angular documentation in order to get a better understanding on how to create a seamless user experience which feels more like a native app.

Angular2 Architecture

Angular focuses on a modular design pattern which utilizes modules and components to organize the client code. This increases predictability and ease of testing at the expense of flexibility. This is accomplished by their eight main building blocks which are defined in the above info-graphic; click on the image to learn more.

Integrated Libraries and Modules

Redux LogoImmutable LogoSocketIO LogoMongoose LogoPassport LogoJasmine LogoKarma LogoProtractor Logo


GOAT includes the Redux architechture, Immutable data structuring, SocketIO, Mongoose, Passport, Jasmine, Karma, and Protractor out of the box. These extra libraries have been added to address common boilerplate needs; such as server and client testing, user login, authentication, and communication between client and server, etc.

Redux

What it does: "Redux is a state management library with minimal API but completely predictable behavior, so it is possible to implement logging, hot reloading, time travel, universal apps, record and replay, without any buy-in from the developer." - Redux

Why we use it: Redux is an invaluable tool which makes client components scale seamlessly in Angular2. Redux accomplishes this by restructuring the flow of data in Angular2 applications; Instead of Angular2's many-to-many component relationships Redux creates a focal point (the store) which changes the flow of data to many-to-one and then one-to-many. Instead of data flowing from parent to child, grand-child, and great-grand-child components and vice-versa through hard coded @input and @output decorators which make it hard to reuse comoponents Redux acts as a middleman. All components that nee to consume data will now receive this data from the store. Any Components which update data will now send this updated data to the store as well.

Immutable

What it does: "Immutable data cannot be changed once created, leading to much simpler application development, no defensive copying, and enabling advanced memoization and change detection techniques with simple logic. Persistent data presents a mutative API which does not update the data in-place, but instead always yields new updated data." - Immutable

Why we use it: With Immutable data we can be confident in the behavior of our application. Predictability leads to better modelling, and less unintentional hard to identify bugs. With Immutibility we can also take better control over data leaks, and have an easier time managing the heap

SocketIO

What it does: "Socket.IO enables real-time bidirectional event-based communication. It works on every platform, browser or device, focusing equally on reliability and speed." - Socket IO

Why we use it: Socket IO takes the web one step closer to the territory of native applications. It gives our users the capability of seeing update information on the website without the need to reload the page. It also gives users the ability to interact with other users in real time, utilizing technologies like live chat.

Mongoose

What it does: "Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box." - Mongoose

Why we use it: Mongoose is a framework that makes modeling MongoDB Documents a breeze. Mongoose handles a majority of the boilerplate needed in schema design letting the developer concentrate on more important concepts.

Passport

What it does: "Passport is authentication middleware for Node.js. Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application. A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more." - Passport

Why we use it: We decided to use Passport due to its modular architecture its sole purpose is authentication, and it seperates all other concerns delegating them to the application. This makes Passport maintainable, and keeps code clean. Also, passport has a variety of over 300 different authentication strategies, meaning developers will not be limited on how they authenticate their users.

Jasmine

What it does: "Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests." - Jasmine

Why we use it: Jasmine is fast, and has no third party dependencies. This means there is less varience between stack implementations when compared to a framework like Mocha which could utilize any assertion library. The increased predictability of a static assertion library without compromise to performance or functionality made Jasmine more stable in our eyes.

Karma

What it does: Karma is a test runner used for unit testing. Created by the Angular team it is "essentially a tool which spawns a web server that executes source code against test code for each of the browsers connected. The results of each test against each browser are examined and displayed via the command line to the developer such that they can see which browsers and tests passed or failed." -Karma

Why we use it: Karma was developed by the Angular team specifically for Angular unit testing. Karma also seamelessly integrates with the Jasmine testing framework. Since both Karma and Protractor use Jasmine this lets us test the whole stack with a single framework, making the developer's workflow more consistent.

Protractor

What it does: "Protractor is an end-to-end test framework for AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would." -Protractor

Why we use it: We chose Protractor for E2E testing because it allows the developer to test Angular-specific elements in an efficient manner out of the box. Less set-up work and more concise code means more concentration on developing and testing what matters, and less time wasted on tedious boilerplate code. On a side note both Protractor and Karma use Jasmine this lets us test the whole stack with a single framework, making the developer's workflow more consistent.