Book Image

Hands-on Full Stack Development with Angular 5 and Firebase

By : Uttam Agarwal
Book Image

Hands-on Full Stack Development with Angular 5 and Firebase

By: Uttam Agarwal

Overview of this book

<p>This book is a complete package for you to build real-time web applications. You will build an end-to-end social networking web application from development to production with Angular as the frontend and Firebase as the backend.</p> <p>You will create an application called Friends with authentication, friends, and chat features. During the process, you’ll use Firebase authentication to register new users and Firebase database to store your extra user data. You’ll take a look at how to store and retrieve your user's images from Firebase storage. Then, you’ll create a real-time chat module with the Firebase database. Next, you’ll secure your database using Firebase security, make your application live with Firebase hosting, and develop your application with analytics.</p> <p>Moving on, you’ll take a look at how to create web pages using bootstrap with HTML, CSS, and TypeScript. You will use the angularfire2 library API in Angular services to interact with Firebase and write unit tests using the Jasmine framework that will help you to write a production-ready application. You’ll also discover various debugging techniques to troubleshoot any bug in your application. Finally, you’ll make your application Progressive Web Applications compliant.</p> <p>By the end of this book, you’ll be able to confidently build any complex application.</p>
Table of Contents (20 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Coding standard guidelines


Coding standard are common patterns we follow while writing our application. This makes our code consistent across application. This is quite useful when multiple developers are working on the same application. A few coding standards are as follows:

  • Naming Conventions: It is extremely important to have consistent naming conventions for our filename, class name, and so on. This is essential from the maintainability and readability point of view.  This also helps in understanding the code faster, and debugging becomes easier.
    • Filename: The recommended pattern for a filename in Angular is feature.type.ts. For example, the name of the authentication component file is authentication.component.ts.
    • Class name: The class name follows the camel case and takes the name from the filename. For example, the class name for the authentication component file is AuthenticationComponent
    • Method and properties name: We follow camel case to name our class method and properties. We don't prefix private variables with an underscore.
    • Selector nameThe selector name in a component is hyphenated, and all characters are in lowercase. The name of our login component is shown here:
      selector: 'app-friends-login'
       Pipe name Pipes are named after their features. For example, the currency pipe name is 'currency', as follows:
      name: 'currency'
  • Constant The constant is the final variable that is declared using the  const keyword, and the constant value is assigned once. Constant variables are declared in uppercase, as follows:
    export const USER_DETAILS_CHILD = 'user-details';
  • Members sequence:  All member variables are declared first, followed by the method. Private members are named after public members.