Learning
Web
App Development
Semmy
Purewal
Table
of
Contents
Preface
xi1.
The Workflow
1TextEditors 1
Installing
SublimeText 2SublimeText Basics 4
Version Control 6
Installing
Git 7Unix Command-LineBasics 8
Git Basics 12
Browsers 20
Installing
Chrome 20Summary
21More Practiceand Further
Reading
21Memorization 21
SublimeText 22
EmacsandVim 22
UnixCommand Line 23
More About Git 23
GitHub 23
2. The Structure
25
Hello,
HTML! 25Tags
Versus Content 26<p> Is for
Paragraph
27Comments 28
Headings
and AnchorsandLists, OhMy!
29Generalizations 32
Using
HTML Validation toIdentify
Problems 35Amazeriffic 38
Identifying
Structure 39Visualizing
StructurewithaTree 41Implementing
theStructurewithOurWorkflow 42Structuring
theMainContent 46Structuring
the Footer 48Summary
49More Practice and Further
Reading
49Memorization 50
Tree
Diagrams
50Build the
FAQ
Page
for Amazeriffic 51MoreAboutHTML 51
3. The
Style
53
Hello,
CSS! 53Rulesets 56
Comments 57
Padding,
Border,
andMargin
57Selectors 60
Classes 61
Pseudoclasses 62
More
Complex
Selectors 63Cascading
Rules 64Inheritance 65
Layouts
with Floats 66The clear
Property
71Working
withFonts 72Resetting
Browser Inconsistencies 76Using
CSS LinttoIdentify
Potential Problems 78Interacting
andTroubleshooting
with the ChromeDeveloper
Tools 80Styling
Amazeriffic 82The Grid 86
Creating
the Columns 90Adding
andManipulating
Fonts 92A Few More Modifications 92
Summary
92More Practice and Further
Reading
93Memorization 93
CSSSelectors Practice 93
Style
theFAQ
Page
for Amazeriffic 94Cascading
Rules 95Responsiveness
andResponsive
Libraries 954. The
Interactivity
97Hello,
JavaScript!
97Our First Interactive
App
99TheStructure 100 The
Style
102 TheInteractivity
102jQuery
Generalizations 111Setting
Up
aProject
111 Comments 112 Selectors 112 DOMManipulation
112Events and
Asynchronicity
117JavaScript
Generalizations 120Interacting
withJavaScript
in the ChromeJavaScript
Console 120Variables and
Types
122Functions 122
Selection 124
Iteration 125
Arrays
127Using
JSLinttoIdentify
Potential Problems 128Adding
Interactivity
to Amazeriffic 131Getting
Started 133The Structure and
Style
133The
Interactivity
134Summary
140More Practice and Further
Reading
141Memorization 141
jQuery Plug-ins
141jQuery
Selectors 142 FizzBuzz 143Array
Practice 143Project
Euler 146Other
JavaScript
References 1465.
The
Bridge
149Hello,
JavaScript Objects!
149Representing
Playing
Cards 150Generalizations 152
Communication Between
Computers
154AJAX
155Accessing
anExternalJSON
File 155Overcoming
BrowserSecurity
Restrictions 156The get
JSON
Function 157A
JSON Array
158So What? 159
Getting Images
from Flickr 160Adding
aTags
FeaturetoAmazeriffic 163ThemapFunction 165
Adding
aTags
Tab 166Building
theUI 167Creating
anIntermediateTags
Data Structure 169Tags
asPartofOurInput
173Summary
175More Practice and Further
Reading
176Flickr Slideshow 176
Object
Practice 177OtherAPIs 180
6.
The
Server 181Setting Up
Your Environment 181Installing
VirtualBox andVagrant
182Building
YourVirtual Machine 183Connecting
toYourVirtual Machine with SSH 184Hello,
Node.js!
186Mental Models 187
Clients and Servers 187
Hosts and Guests 188
Practicalities 189
Hello,
HTTP! 189Modules and
Express
191Installing Express
with NPM 192Our First
Express
Server 192Sending
Your ClientApp
193Generalizations 195
Counting
Tweets 195Getting
Your Twitter Credentials 195Connecting
to the Twitter API 197Whats
Happening
Here? 198Storing
Counts 198Modularizing
Our Tweet Counter 201Importing
Our Module IntoExpress
201Setting
Up
aClient 202Creating
aServerfor Amazeriffic 204Setting Up
Our Directories 204Initializing
aGitRepository
204Building
the Server 204Running
the Server 205Posting
Informationtothe Server 205Summary
208More Practice and Further
Reading
209Installing Node.js
Locally
209JSHint
andCSS Lint via NPM 209Generalizing
Our Tweet CounterCode 210PokerAPI 212
7.
TheData Store
215NoSQL
VersusSQL
215Redis 216
Interacting
with the Redis Command-Line Client 216Installing
the Redis Moduleviaapackage.json
File 217Interacting
with Redis in Our Code 219Initializing
the Counts from the Redis Store 220Using
mget
to GetMultiple
Values 222MongoDB
222Interacting
with theMongoDB
Command-LineClient 223Modeling
DatawithMongoose
226Storing
AmazerifficToDos 229Summary
230More Practiceand Further
Reading
231Poker API 231
Other Database References 231
8.
The Platform
233
Cloud
Foundry
233Creating
anAccount 234Getting
YourApp Ready
forDeployment
234Deploying
OurApp
235Getting
Information About YourApps
237Updating
YourApp
239Deleting Apps
from CloudFoundry
240Dependencies
andpackage.json
240Binding
RedistoYourApp
241Summary
246More Practice
and
FurtherReading
246Poker API 246
OtherPlatforms 247
9. The
Application
249
Refactoring
Our Client 249Generalizing Meaningful Concepts
250AJAXifying
Our Tabs 253Ridding
Ourselves of Hacks 254Handling
AJAX
Errors 256Refactoring
Our Server 257Code
Organization
257HTTP
Verbs, CRUD,
andREST 259Setting
Up
Routesby
ID 260Using jQuery
for put and deleteRequests
261HTTP
Response
Codes 262Model-View-Controller 263
Adding
UserstoAmazeriffic 264Building
the UserModel 264Building
the UserController 265Setting Up
Routes 266Improving
Our ToDo ControllerActions 268Summary
270MorePractice and Further
Reading
271Removing
ToDos 271Adding
aUserAdminPage
272Views
Using
EJS andJade
273Build Another