Learning Node.js for Mobile Application Development
eBook - ePub

Learning Node.js for Mobile Application Development

  1. 248 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Learning Node.js for Mobile Application Development

Book details
Book preview
Table of contents
Citations

About This Book

Make use of Node.js to learn the development of a simple yet scalable cross-platform mobile application

About This Book

  • Use Node.js to satisfy the core backend requirements of modern apps, including user management, security, data access, and real-time data communication
  • Build practical real-world mobile applications, which will give you the necessary knowledge to build your very own mobile solutions
  • Step-by-step development of projects using Ionic Framework as the frontend and Node.js for the backend supported by a MongoDB database

Who This Book Is For

This book is intended for web developers of all levels of expertise who want to deep dive into cross-platform mobile application development without going through the pains of understanding the languages and native frameworks that form an integral part of developing for different mobile platforms.

This book is also for you if you are a developer who wants to capitalize on the MobileFirst strategy and so are going to use JavaScript for your complete stack.

What You Will Learn

  • Develop an API from scratch
  • Set up a MongoDB Database as part of your mobile application backend
  • Deploy a cross-platform mobile application from the command line
  • Incorporate features within your mobile application that use native phone features such as a gyroscope, GPS, and accelerometer
  • Implement mobile applications that use web-enabled APIs
  • Build a mobile application with real-time chat messaging features
  • Develop a secure mobile application that is capable of functioning with real-time data

In Detail

Node.js is a massively popular JavaScript library that lets you use JavaScript to easily program scalable network applications and web services. People approaching Node.js for the first time are often attracted by its efficiency, scalability, and the fact that it's based on JavaScript, the language of the Web, which means that developers can use the same language to write backend code. Also, it's increasingly being seen as a "modern" replacement for PHP in web development, which relies on fast-paced data exchange. The growing community and the large amount of available modules makes Node.js one of the most attractive development environments.

This book takes a step-wise and incremental approach toward developing cross-platform mobile technologies using existing web technologies. This will allow you to truly understand and become proficient in developing cross-platform mobile applications with Node.js, Ionic Framework, and MongoDB.

The book starts off by introducing all the necessary requirements and knowledge to build a mobile application with a companion web service. It covers the ability to create an API from scratch and implement a comprehensive user database that will give you the opportunity to offer a mobile application with a personalized experience.

Midway through the book, you will learn the basic processes to create a successful mobile application. You will also gain higher-level knowledge, allowing you to develop a functional and secure mobile application to ensure a seamless user experience for end users.

Finally, the book ends with more advanced projects, which will bring together all the knowledge and expertise developed in the previous chapters to create a practical and functional mobile-application that has useful real-world features.

Style and approach

This book is an easy-to-follow guide that takes a step-wise approach in giving expertise and knowledge to help you truly understand what is needed to create a memorable user experience for end users. Each topic is placed in the context of the bigger picture, that is, to create cross-platform mobile applications using existing technologies.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Learning Node.js for Mobile Application Development by Stefan Buttigieg, Milorad Jevdjenic in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Services & APIs. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781785280498
Edition
1

Learning Node.js for Mobile Application Development


Table of Contents

Learning Node.js for Mobile Application Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Setting Up Your Workspace
The Node.js backend
Installing Node.js on different systems
Windows
Linux
Ubuntu/Debian
Fedora/RHEL/CentOS
Verifying your installation
Mac OS X
Verifying your installation
Setting up the Ionic framework and Cordova for Mac OS X
Setting up the Ionic framework and Cordova for Windows
Setting up the platform dependencies
Installing Java
Setting up Android Studio for Android, Mac, and Windows
Setting up the Android Software Development Kit
Setting up your physical Android device for development
Enabling Developer options
Enabling USB debugging
Trusting a computer with installed IDE using secure USB debugging (devices with Android 4.4.2)
Setting up the Environment Variables on Windows 7 and higher
Setting up the Environment Variables for iOS on Mac OS X
Installing the iOS SDK
MongoDB
Installation of MongoDB on different Operating System
Windows
Linux
Ubuntu
Fedora/RHEL/CentOS
Starting MongoDB
Mac OS X
Connecting to MongoDB
Windows
Linux and OS X
Summary
2. Configuring Persistence with MongoDB
Learning outcomes of MongoDB
An introduction to MongoDB
Documents
Collections
Databases
An example – a product order database
Connecting to MongoDB
Linux and Mac OS X
Windows
Creating a database
Creating our collections
Creating relations between documents
Querying MongoDB
Searching by ID
Searching by property value
Advanced queries
Connecting MongoDB and Node.js
Setting up a basic project
Connecting to MongoDB
Summary
3. Creating an API
Learning outcomes of the RESTful API
RESTing easy
It's all hypermedia
GET
GET all
GET by ID
POST
PUT
DELETE
Building a RESTful API with Node.js
Setting up the RESTful API
The HTTP module
Dissecting the HTTP server
Returning JSON
Implementing our GET handlers
Implementing a router
Implementing our POST handlers
Implementing the DELETE and PUT handlers
Testing the API
Moving forward
Summary
4. Securing Your Backend
Understanding the outcomes of token-based authentication
The theoretical bit
A small token of trust
Playing your role
Putting it all together
Implementation
Adding the new collections
Adding an authentication module
Creating functions to register and help users log in
Registering users
Enabling users to log in
Extending our API
OAuth
Time-stamped access tokens
Hashing passwords
Summary
5. Real-Time Data and WebSockets
Polling
WebSockets
Using WebSockets in Node.js
Setting up our project
Installing socket.io
Creating a chat interface
A basic file server
An alternate chat
The efficient serving of static files
Summary
6. Introducing Ionic
Setting up your Ionic web account
Creating your first Ionic application
Checking out your Ionic applications with Ionic View
Installing Ionic View on Android
Installing Ionic View on iOS
Testing your application on the iOS Ionic View App
Testing your application on Android
Sharing your application with collaborators
Going further
Summary
7. Building User Interfaces
The structure of an Ionic project
Introducing AngularJS
The structure of an Angular app
Modules
Modules within modules within modules
Services, controllers, and other beasts
The Angular MVC pattern
The view
The controller
The model
Putting it all together
Modifying an Ionic project
Modifying the header
Modifying the tab colour, icons, and names
Modifying our pages
Adding a new tab
Creating a new controller
Creating a view
Adding a state for the new tab
Testing the newly created tab
Going further
Summary
8. Making Our App Interactive
Creating a new project
Creating a basic MVC project
Creating the view
Creating the list view
Creating the controller
Connecting the view and controller
Testing the connection
Creating the model
Services
Creating services
Creating a factory
Accessing the device data
Accessing native services
ngCordova
Adding Cordova contacts to our factory
Building for native devices
Android
Emulator
A physical device
The list view revisited
Summary
9. Accessing Native Phone Features
Creating the project
Creating the basic app structure
Integrating Google Maps into the app
Angular directives
Creating directives
Restricting directives
Scope isolation
DOM manipulation
Putting it all together
Adding geolocation via GPS
Summary
10. Working with APIs
Setting up Parse
Setting up the Ionic project
Connecting Parse to our project
Defining app states
Creating controllers and templates
Testing our application
Summary
11. Working with Security
An overview of client-side security
Client-side security is a convenience
The basic components of client-side security
Building a secure app
Starting off
A basic authentication service
The login function
The isAuthenticated function
The getCurrent function
Implementing route authentication
Summary
12. Working with Real-Time Data
A refresher – WebSockets
Getting the lay of the land
What we will need
Creating the server
Building the chat app
Setting up the basic app structure
The input section
The message view
The ChatService function
Adding WebSockets to the mix
Updating the chat view
Going further
Summary
13. Building an Advanced Chat App
We need some room!
Namespaces
Creating a multiroom chat application
Configuring the basic layout
Building the server
Summary
14. Creating an E-Commerce Application Using the Ionic Framework
Designing our application
Creating an Ionic project
Implementing our designs
Setting up the product API
Connecting the product API to our Ionic app
Summary
Index

Learning Node.js for Mobile Application Development

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or tr...

Table of contents

  1. Learning Node.js for Mobile Application Development