Full Stack JavaScript: Learn Backbone.js, Node.js, and MongoDB. Apress

Second Edition

Azat Mardan


e-book shop
e-book shop
Purchase Now !
Just with Paypal



Book Details
 Price
 3.00 USD
 Pages
 315 p
 File Size
 4,740 KB
 File Type
 PDF format
 ISBN-13 (electronic) 
 ISBN-13 (pbk)
 978-1-4842-3718-2
 978-1-4842-3717-5
 Copyright   
 2018 by Azat Mardan 

About the Author
Azat Mardan has over 18 years of experience
in web, mobile, and software development.
With a Bachelor’s degree in Informatics and a Master of Science degree in Information
Systems Technology, Azat possesses deep academic knowledge as well as extensive
practical experience. Azat is an experienced software engineer, author, and educator. He
has published 16 books and counting. Currently, Azat works as a Software
Engineering Leader at Indeed.com, the number one job search site. Before
Azat worked as a Technology Fellow at Capital One Financial Corporation,
a top 10 USA bank. Even before that, Azat was a Team Lead at DocuSign,
where his team rebuilt 50 million user products (DocuSign web app) using
the tech stack of Node.js, Express.js, Backbone.js, CoffeeScript, Jade, Stylus, and Redis.

Recently, he worked as a senior engineer at the curated social media
news aggregator web site, Storify.com (now part of Adobe), which
is used by BBC, NBC, CNN, the White House, and others. Storify runs
everything on Node.js unlike other companies. It’s the maintainer of the
open source library jade browser.

Before that, Azat worked as a CTO/Cofounder at Gizmo—an enterprise
cloud platform for mobile marketing campaigns, and has undertaken the
prestigious 500 Startups business accelerator program.
Azat also has past experience developing mission-critical applications
for government agencies in Washington, DC, including the National
Institutes of Health, the National Center for Biotechnology Information,
and the Federal Deposit Insurance Corporation, as well as for Lockheed Martin.

Azat is a frequent attendee at Bay Area tech meet-ups and hackathons
(AngelHack hackathon ’12 finalist with team FashionMetric.com, which
went on to raise venture capital from Mark Cuban and TechStars).
In addition, Azat teaches technical classes at General Assembly, Hack
Reactor, pariSOMA, and Marakana (acquired by Twitter) to much acclaim.
In his spare time, he writes about technology on his blog: Webapplog.
com, which was a number one in “express.js tutorial” Google search results
for some time.

Azat is also the author of Pro Express.js, Practical Node.js, Node Program
(http://nodeprogram.com/) and others. Azat is the creator of open
source Node.js projects, including ExpressWorks, mongoui, and HackHall.
You can reach Azat and say hi using one of these methods:
Twitter: @azatmardan https://twitter.com/azatmardan - Azat
loves getting “Hi” on Twitter

Preface
I’m writing this as I’m sitting at the San Francisco airport waiting for
my flight to Portland, Oregon, for the biggest Node.js conference. I’ll be
speaking there about Node.js. It’s scary and funny at the same time to
think that I started to learn Node only three years ago. Yes, I remember
how I decided that the best way to learn is to teach others. For this reason I
started teaching my first Node classes and writing this book. The book was
mostly for me, so I could remember how to push Heroku or how to create
Node servers that talk to MongoDB. It was called Rapid Prototyping with
JS back then. Three years sped away; I published a few more Node books
as well as released several Node apps in production; and in 2014, Apress
approached me wanting to publish an updated edition under a new title.
I can't believe this is the second editon of the book. It's 2018 and a lot of
thing changes. I am glad for the evolution of JavaScript and innovation in
the Node.js space.

The main reason I bet my time and energy on JavaScript and Node
in the first place is that I felt both intuitively and logically the potential of
the full stack JavaScript. The one language to rule the whole stack across
all the layers. Logically I understood the code reuse, expressiveness, and
performance advantages of Node.js and the ever-increasing importance
of front-end development with MVC-like frameworks such as Backbone.
Intuitively, I just freaking fell in love with JavaScript both on the browser
and on the server.

Yes, I used JavaScript for many years but it was more pain than fun.
Not anymore. I was able to get a sense of what’s going on at the front end
while at the same time getting all the power and flexibility on the server.
My brain started to think 5, maybe 10 times faster than before because I
started to remember all the obscure methods from Array or String objects.
I stopped having Mozilla Developer Network or Google open next to my
code editor. And what a relief when you don’t need to wait for the compiler
each time that you want to test something really quickly.

The airline crew announced my boarding. I need to get on the plane,
but I hope this easy, beginner-friendly manual will open the world of
full stack JavaScript and cloud computing. Jump on board this amazing
technology with me.

Table of Contents
About the Author .................................................................................xi
Acknowledgments .............................................................................xiii
Preface ...............................................................................................xv
Introduction ......................................................................................xvii
Part I: Quick Start
Chapter 1: Basics
Front-End Definitions ............................................................................................4
Web Request Cycle ..........................................................................................5
Mobile Development ........................................................................................6
HyperText Markup Language ...........................................................................8
Cascading Style Sheets .................................................................................12
JavaScript ......................................................................................................14
Agile Methodologies ............................................................................................27
Scrum ............................................................................................................27
Test-Driven Development ..............................................................................29
Continuous Deployment and Integration .......................................................29
Pair Programming .........................................................................................30
Back-End Definitions ..........................................................................................31
Node.js ...........................................................................................................31
NoSQL and MongoDB ....................................................................................33
Cloud Computing ...........................................................................................33
HTTP Requests and Responses .....................................................................34
RESTful API ....................................................................................................35
Summary ............................................................................................................37
Chapter 2: Setup
Local Setup .........................................................................................................40
Development Folder ......................................................................................40
Browsers .......................................................................................................42
IDEs and Text Editors .....................................................................................43
Version Control Systems ................................................................................45
Local HTTP Servers .............................................................................................46
Database: MongoDB ......................................................................................47
Required Components ...................................................................................52
Node.js Installation ........................................................................................52
Browser JavaScript Libraries ........................................................................54
Less App ........................................................................................................55
Cloud Setup .........................................................................................................55
SSH Keys .......................................................................................................55
GitHub .................................................................................................................58
Microsoft Azure ...................................................................................................59
Heroku ................................................................................................................61
Summary ............................................................................................................63
Part II: Front-End Prototyping
Chapter 3: Getting Data from Backend Using jQuery and Parse
Definitions ...........................................................................................................68
JavaScript Object Notation ............................................................................68
AJAX ..............................................................................................................70
Cross-Domain Calls .......................................................................................71
jQuery Functions .................................................................................................72
Bootstrap ............................................................................................................74
Less .....................................................................................................................79
Less Variables ................................................................................................79
Less Mix-ins ..................................................................................................80
Less Operations .............................................................................................82
An Example Using a Third-Party API (OpenWeatherMap) and jQuery ..................84
Parse ...................................................................................................................96
Message Board with Parse Overview ...............................................................107
Message Board with Parse: REST API and jQuery Version ..........................109
Pushing to GitHub ........................................................................................119
Deployment to Microsoft Azure .........................................................................121
Deployment of Weather App to Heroku .............................................................122
Updating and Deleting Messages .....................................................................125
Summary ..........................................................................................................126
Chapter 4: Intro to Backbone.js
Setting Up a Backbone.js App from Scratch .....................................................128
Backbone.js Dependencies ...............................................................................128
Working with Backbone.js Collections ..............................................................133
Backbone.js Event Binding ................................................................................141
Backbone.js Views and Subviews with Underscore.js ......................................147
Refactoring Backbone.js Code ..........................................................................159
AMD and Require.js for Backbone.js Development ...........................................168
Require.js for Backbone.js Production ..............................................................179
Super Simple Backbone.js Starter Kit ...............................................................185
Summary ..........................................................................................................185
Chapter 5: Backbone.js and Parse
Message Board with Parse: JavaScript SDK and Backbone.js Version .............188
Taking Message Board Further .........................................................................208
Summary ..........................................................................................................209
Part III: Back-End Prototyping
Chapter 6: Intro to Node.js
Building “Hello World” in Node.js ......................................................................214
Node.js Core Modules .......................................................................................216
http ..............................................................................................................216
util ...............................................................................................................217
querystring ..................................................................................................218
url ................................................................................................................218
fs .................................................................................................................218
npm Node.js Package Manager ........................................................................219
Deploying “Hello World” to PaaS .......................................................................222
Deploying to Microsoft Azure ............................................................................222
Deploying to Heroku ..........................................................................................223
Message Board with Node.js: Memory Store Version ..................................225
Unit Testing Node.js .....................................................................................225
Summary ..........................................................................................................237
Chapter 7: Intro to MongoDB
MongoDB Shell ..................................................................................................240
BSON Object ID .................................................................................................242
MongoDB Native Driver .....................................................................................243
MongoDB on Heroku: MongoLab .......................................................................246
Message Board: MongoDB Version ...................................................................252
Summary ..........................................................................................................256
Chapter 8: Putting Frontend and Backend Together
Adding CORS for Different-Domain Deployment ...............................................258
Message Board UI .............................................................................................260
Message Board API ...........................................................................................268
Deployment to Heroku ......................................................................................274
Same-Domain Deployment Server ....................................................................275
Deployment to Amazon Web Services ...............................................................282
Summary ..........................................................................................................287
Chapter 9: Conclusion
Appendix: Further Reading
Free JavaScript and Node Resources ...............................................................291
Good JavaScript Books .....................................................................................292
Good Node.js Books ..........................................................................................292
Interactive Online Classes and Courses ............................................................293
Startup Books and Blogs ...................................................................................293
Index .................................................................................................295

Bookscreen
e-books shop

Introduction
The kind of programming that C provides will probably
remain similar absolutely or slowly decline in usage, but relatively,
JavaScript or its variants, or XML, will continue to
become more central.
— Dennis Ritchie

In this introduction, we cover:
• Reasons behind full stack JavaScript development in
general and for the writing of this book
• What to expect and what not to expect, and what are
the prerequisites
• Suggestions on how to use the book and examples
• Explanation of the book’s notation format
Full Stack JavaScript is a hands-on book that introduces you to
rapid software prototyping using the latest cutting-edge web and mobile
technologies including Node.js, MongoDB, Twitter Bootstrap, LESS,
jQuery, Parse.com, Heroku, and others.

Why This Book?
This book was borne out of frustration. I have been in software engineering for
many years, and when I started learning Node.js and Backbone.js, I learned
the hard way that their official documentation and the Internet lack good
quick start guides and examples. Needless to say, it was virtually impossible to
find all of the tutorials for JS-related modern technologies in one place.

The best way to learn is to do, right? Therefore, I used the approach
of small, simple examples (that is, quick start guides) to expose myself to
the new cool tech. After I was done with the basic apps, I needed some
references and organization. I started to write this manual mostly for
myself, so I could understand the concepts better and refer to the samples
later. Then StartupMonthly and I taught a few two-day intensive classes
on the same subject—helping experienced developers to jump-start
their careers with only-one-language development, that is, JavaScript.

The manual we used was updated and iterated many times based on the
feedback received. The end result is this book.
Previous Post Next Post