PREFACE
xvi
wove together tightly. This is largely because the project was thought of as a single
thing: the website.
Many of the best practices from this book are borne of the pain of finding out the
hard way over these years. Something that might seem harmless at the time, most def-
initely easier, or sometimes even sensible, can come back to bite you later on. Don’t let
this put you off from diving in and having a go. Mistakes are there to be made, and—
in this arena at least—mistakes are a great way of learning. They say that intelligence is
“learning from your mistakes.” This is true, but you’ll be a step ahead if you can also
learn from others’ mistakes.
The web development landscape changed over the years, but I was still heavily
involved with creating—or managing the creation of—full websites and applications. I
came to appreciate that there is a real art to gluing together applications made from
different technologies. It is a skill in itself; just knowing the technologies and what
they can do is only part of the challenge.
When Node.js came onto my radar I jumped right in and embraced the idea full
on. I had done a lot of context switching between various languages, and the idea of
having a single language to focus on and master was extremely compelling. I figured
that if used in the right way it could streamline development by reducing the language
context shifting. Playing with Node I started to create my own
MVC
framework, before
discovering Express. Express solved a lot of the problems and challenges I faced when
first trying to learn Node and use it to create a website or web application. In many
ways adopting it was a no-brainer.
Naturally, behind pretty much any web application is a database. I didn’t want to
fall back on my previous go-to option of Microsoft
SQL
Server, as the cost made it
quite prohibitive to launch small personal projects. Some research led me to the lead-
ing open source No
SQL
database: Mongo
DB
. It worked natively with JavaScript! I was
more excited than I possibly should have been about a database. However Mongo
DB
was different from all of the databases I had used before. My previous experience was
all in relational databases; Mongo
DB
is a document database, and that is something
quite different, making the way you approach database design quite different as well. I
had to retrain my brain to think in this new way, and eventually it all made sense.
There was just one piece missing. JavaScript in the browser was no longer just
about enhancing functionality, it was about creating the functionality and managing
the application logic. Out of the available options I was already leaning toward
Angular
JS
. When I heard Valeri Karpov of Mongo
DB
coin the term “
MEAN
stack” that
was it. I knew that here was a next-generation stack.
I knew that the
MEAN
stack would be powerful. I knew that the
MEAN
stack would
be flexible. I knew that the
MEAN
stack would capture the imagination of developers.
Each of the individual technologies is great, but when you put them all together you
have something exceptional on your hands. This is where Getting
MEAN
comes from.
Getting the best out of the
MEAN
stack is more than just knowing the technologies, it’s
about knowing how to get those technologies working together.
Licensed to Mark Watson <nordickan@gmail.com>
www.it-ebooks.info