Introduction

The Angular Firebase Survival Guide is about getting stuff done. No effort is made to explicitly cover high level programming theories or low level Angular architecture concepts – there are plenty of other books for that purpose. The focus of this book is building useful app features. Each section starts with a problem statement, then solves it with code.

Even for experienced JavaScript developers, the learning curve for Angular is quite steep. Mastering this framework is only possible by putting forth the effort to build your own features from scratch. Your journey will inevitably lead to moments of frustration - you may even dream about switching to VueJS or React - but this is just part of the learning process. Once you have Angular down, you will arrive among a rare class of developers who can build enterprise-grade realtime apps for web, mobile, and desktop.

The mission of this book is to provide a diverse collection of snippets (recipes) that demonstrate the combined power of Angular and Firebase. The format is non-linear, so when a client asks you to build a “Custom Username” feature, you can jump to section 6.1 and start coding. By the end of the book, you will know how to authenticate users, handle realtime data streams, upload files, trigger background tasks with cloud functions, process payments, and much more.

I am not sponsored by any of the brands or commercial services mentioned in this book. I recommend these tools because I am confident in their efficacy through my experience as a web development consultant.

Why Angular?

Angular can produce maintainable cross-platform JavaScript apps that deliver an awesome user experience. It’s open source, backed by Google, has excellent developer tooling via TypeScript, a large community of developers, and is being adopted by large enterprises. I see more and more Angular2+ job openings every week.

Why Firebase?

Firebase eliminates the need for managed servers, scales automatically, dramatically reduces development time, is built on Google Cloud Platform, and is free for small apps.

Firebase is a Backend-as-a-Service (BaaS) that also offers Functions-as-a-Service (FaaS). The Firebase backend will handle your database, file storage, and authentication – features that would normally take weeks to develop from scratch. Cloud functions will run background tasks and microservices in a completely isolated NodeJS environment. On top of that, Firebase provides hosting with free SSL, analytics, and cloud messaging.

Furthermore, Firebase is evolving with the latest trends in web development. In March 2017, the platform introduced Cloud Functions for Firebase. Then in October 2017, the platform introduced the Firestore Document Database. I have been blown away at the sheer pace and quality of new feature roll-outs for the platform. Needless to say, I stay very busy keeping this book updated.

Why Angular and Firebase Together?

When you’re a consultant or startup, it doesn’t really matter what languages or frameworks you know. What does matter is what you can produce, how fast you can make it, and how much it will cost. Optimizing these variables forces you to choose a technology stack that won’t disappoint. Angular does take time to learn (I almost quit), but when you master the core patterns, development time will improve rapidly. Adding Firebase to the mix virtually eliminates your backend maintenance worries and abstracts difficult aspects of app development - including user authentication, file storage, push notifications, and a realtime pub/sub database. The bottom line is that with Angular and Firebase you can roll out amazing apps quickly for your employer, your clients, or your own startup.

This Book is for Developers Who…

  • Want to build real world apps
  • Dislike programming books the size of War & Peace
  • Have basic JavaScript (TypeScript), HTML, and SCSS skills
  • Have some Angular experience – such as the demo on Angular.io
  • Have a Firebase or GCP account
  • Enjoy quick problem-solution style tutorials

Angular Firebase Starter App

To keep the recipes consistent, most of the code examples are centered around a book sharing app where users can post information about books and their authors.

The Firestarter App provides an open-source live demo that shares much of its codebase with this book.

Package Versions

Change happens fast in the web development world. The package versions used in this book are as follows:

  • Angular v6.0
  • Angular CLI v6.0
  • TypeScript v2.8
  • Firebase JS SDK v5.0
  • Firebase Functions v1.0
  • Cloud Firestore vBeta

Everything else we build from the ground up.

Watch the Videos

The book is accompanied by an active YouTube channel that produces quick tutorials on relevant Angular solutions that you can start using right away. I will reference these videos throughout the book.

https://www.youtube.com/c/AngularFirebase

Join the Angular Firebase Slack Team

My goal is to help you ship your app as quickly as possible. To facilitate this goal, I would like to invite you to join our Slack room dedicated to Angular Firebase development. We discuss ideas, best practices, share code, and help each other get our apps production ready. Get the your Slack invite link here.