Node.js By Example

Learn to use Node.js by creating a fully functional social network
Preview in Mapt

Node.js By Example

Krasimir Tsonev

1 customer reviews
Learn to use Node.js by creating a fully functional social network
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Node.js By Example Book Cover
Node.js By Example
$ 35.99
$ 25.20
Node.js: Creating Applications from Scratch Book Cover
Node.js: Creating Applications from Scratch
$ 124.99
$ 106.25
Buy 2 for $35.00
Save $125.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781784395711
Paperback220 pages

Book Description

Node.js is a JavaScript-driven technology, which means that developers can use the same language to write backend code. Its growing community and the large amount of available modules make Node.js one of the most attractive development environments.

Node.js By Example covers Node.js fundamentals and teaches you how to use its technology to architect a project. It shows you how to manage an application's assets and how to implement the Model-View-Controller pattern. The next few chapters demonstrate how to develop the features of your social network. It also empowers you to communicate with a database, including storing, retrieving, and deleting data. The book ends by discussing the most popular ways to test your user interface in an efficient way.

Table of Contents

Chapter 1: Node.js Fundamentals
Understanding the Node.js architecture
Installing Node.js
Defining and using modules
Managing and distributing packages
Introducing built-in modules
Summary
Chapter 2: Architecting the Project
Introducing the basic layers of the application
The task runner and building system
Discovering Gulp
Test-driven development
The Model-View-Controller pattern
Introducing the REST API concept
Summary
Chapter 3: Managing Assets
Serving files with Node.js
CSS preprocessing
Packing client-side JavaScript
Delivering HTML templates
Summary
Chapter 4: Developing the Model-View-Controller Layers
Evolving the current setup
Implementing the router
Introducing Ractive.js
Constructing the entry point of the application
Defining a controller
Managing our views
Creating a model
Summary
Chapter 5: Managing Users
Working with the MongoDB database
Extending the code from the previous chapter
Registering a new user
User authentication with sessions
Managing a user's profile
Summary
Chapter 6: Adding Friendship Capabilities
Finding friends
Marking users as friends
Displaying the linked users on the Profile page
Summary
Chapter 7: Posting Content
Posting and storing text
Showing the user's feed
Posting files
Summary
Chapter 8: Creating Pages and Events
Refactoring the API
Adding a form to create pages
Creating a record in the database
Showing the currently added pages
Showing a specific page
Posting a comment to a page
Showing the comments
Managing events attached to a particular page
Summary
Chapter 9: Tagging, Sharing, and Liking
Selecting friends and sending their IDs to the backend
Storing the tagged users and displaying them in the user's feed
Liking posts and counting the number of likes
Showing the number of likes
Summary
Chapter 10: Adding Real-time Chat
Getting to know WebSockets
Bringing Socket.IO to the project
Preparing the UI of the chat area
Exchanging messages between the client and the server
Sending messages to the user's friends only
Customizing the output of the chat
Summary
Chapter 11: Testing the User Interface
Introducing the basic testing toolset
Preparing our project to run tests
Running our test with PhantomJS
Testing user registration
Testing with DalekJS
Summary

What You Will Learn

  • Get to know the fundamentals of Node.js
  • Understand why architecting is important and what the planning of a typical Node.js application looks like
  • Successfully manage every web application asset such as CSS, JavaScript, or image files
  • Implement the Model-View-Controller pattern in the context of a Node.js application
  • Communicate with a database, including storing, retrieving, and deleting data
  • Implement more complex features such as creating social network pages, tagging, sharing, and liking posts
  • Create a real-time chat capability for users of the social network
  • Explore how to test the user interface of your web application

Authors

Table of Contents

Chapter 1: Node.js Fundamentals
Understanding the Node.js architecture
Installing Node.js
Defining and using modules
Managing and distributing packages
Introducing built-in modules
Summary
Chapter 2: Architecting the Project
Introducing the basic layers of the application
The task runner and building system
Discovering Gulp
Test-driven development
The Model-View-Controller pattern
Introducing the REST API concept
Summary
Chapter 3: Managing Assets
Serving files with Node.js
CSS preprocessing
Packing client-side JavaScript
Delivering HTML templates
Summary
Chapter 4: Developing the Model-View-Controller Layers
Evolving the current setup
Implementing the router
Introducing Ractive.js
Constructing the entry point of the application
Defining a controller
Managing our views
Creating a model
Summary
Chapter 5: Managing Users
Working with the MongoDB database
Extending the code from the previous chapter
Registering a new user
User authentication with sessions
Managing a user's profile
Summary
Chapter 6: Adding Friendship Capabilities
Finding friends
Marking users as friends
Displaying the linked users on the Profile page
Summary
Chapter 7: Posting Content
Posting and storing text
Showing the user's feed
Posting files
Summary
Chapter 8: Creating Pages and Events
Refactoring the API
Adding a form to create pages
Creating a record in the database
Showing the currently added pages
Showing a specific page
Posting a comment to a page
Showing the comments
Managing events attached to a particular page
Summary
Chapter 9: Tagging, Sharing, and Liking
Selecting friends and sending their IDs to the backend
Storing the tagged users and displaying them in the user's feed
Liking posts and counting the number of likes
Showing the number of likes
Summary
Chapter 10: Adding Real-time Chat
Getting to know WebSockets
Bringing Socket.IO to the project
Preparing the UI of the chat area
Exchanging messages between the client and the server
Sending messages to the user's friends only
Customizing the output of the chat
Summary
Chapter 11: Testing the User Interface
Introducing the basic testing toolset
Preparing our project to run tests
Running our test with PhantomJS
Testing user registration
Testing with DalekJS
Summary

Book Details

ISBN 139781784395711
Paperback220 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Node.js Design Patterns Book Cover
Node.js Design Patterns
$ 29.99
$ 6.00
AngularJS Web Application Development Blueprints Book Cover
AngularJS Web Application Development Blueprints
$ 29.99
$ 21.00
MEAN Web Development Book Cover
MEAN Web Development
$ 29.99
$ 3.00
AngularJS by Example Book Cover
AngularJS by Example
$ 24.99
$ 17.50
AngularJS Web Application Development Cookbook Book Cover
AngularJS Web Application Development Cookbook
$ 29.99
$ 6.00