Ionic 5 - Taxi Booking Platform with Firebase
  • Ionic 5 Taxi Complete Platform using Firebase - User, Driver Admin Apps
  • Why use this Starter
  • Setup and Deployment
    • Initial Dev Environment Setup
    • Running the App (Web Browser)
    • Deploying app as PWA
    • Building App on device
  • How to Use this Starter
    • Taxi Booking Complete Setup
    • Taxi User App - Setup
    • Taxi Driver App - Setup
    • Taxi Admin App - Setup
    • Testing Complete Platform
  • Platform Features
    • User App
    • Driver App
    • Admin App
  • Firebase Setup
    • New Firebase Project Setup
    • Firebase Integration Into User App
  • Extra
    • App Specific Requirements
    • Add More Features
    • FAQs
    • Firebase Setup (Ionic 4 Version)
    • Firebase Functions (Ionic 4 version)
      • Overview
      • Firebase Function in Code
      • How to Deploy Firebase Functions
Powered by GitBook
On this page
  • Prepare Firebase project for PWA
  • Convert the app into a PWA

Was this helpful?

  1. Setup and Deployment

Deploying app as PWA

Learn how to deploy any of the three apps as PWA on a free Firebase hosting

PreviousRunning the App (Web Browser)NextBuilding App on device

Last updated 5 years ago

Was this helpful?

Prepare Firebase project for PWA

For deploy the app as PWA , we will demonstrate using Firebase hosting.

First create a project on .

Now, in your project directory, run

$ npm install -g firebase-tools

This will install Firebase tools in your project. Now login into Firebase using

$ firebase login

It will redirect you to browser, and authenticate using your google account. Once you are logged in, you can run this command to attach the code to your project.

$ firebase init

It will take you through a list of options for project setup.

This will create a firebase.json file which should look like the following

{
  "hosting": {
    "public": "www",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

Convert the app into a PWA

To add this package to the app run:

$ ng add @angular/pwa

Finally, build your project into production using

$ ionic build --prod

This will create a production build of your ionic app for PWA deployment. Use Firebase to deploy the app using

$ firebase deploy --only hosting

Whenever you make any changes to the app, make sure you run ionic build --prod before deploying it again on the hosting.

The Firebase console will show the deployment like this

When deploying an app through a hosting service, be aware that HTTPS will be required to take full advantage of Service Workers and features like Geolocation etc.

The two main requirements of a PWA are a and a . While it's possible to add both of these to an app manually, the Angular team has an @angular/pwa package that can be used to automate this.

This will deploy your app on a Firebase url such as where you will see your app running perfectly.

For a more detailed step-by-step guide on PWA deployment,

For more information on PWA related option in firebase.json , check

Firebase
Service Worker
Web Manifest
https://ionic4fullapp.firebaseapp.com/
check this blog​
here