davidroyer / nuxt2-ssr-firebase

Nuxt2 Universal App with SSR via Firebase Functions and Firebase Hosting
https://nuxt2ssrfire.firebaseapp.com
50 stars 11 forks source link
firebase firebase-functions nuxt nuxt-edge nuxt2 nuxtjs ssr vue

Nuxt.js Universal App with SSR via Firebase Functions and Firebase Hosting - Nuxt 2 Version

Host a Nuxt Universal app or site by combining Nuxt.js with Firebase Cloud Functions and Hosting.

Live Preview


Pre-Setup: Before Installing Any Dependencies

  1. Obtain a Firebase Project ID to use for this project. See Overiew Here

  2. Inside this directory, locate the file .firebaserc.sample, and do the following:


Setup

We will now get everything setup and deployed in 3 commands:

Note: All of these commands are ran from the root directory

  1. Install Dependencies in all necessary directories in 1 command
yarn setup
# OR
npm run setup
  1. Build The Project
yarn build
# OR
npm run build
  1. Deploy To Firebase
yarn deploy
# OR
npm run deploy

Your site should now be live!


Development

There are 2 development options.

1. Without Firebase Functions

This will be like a normal Nuxt development experienced.

yarn dev

2. With Firebase Functions

This uses Firebase's local development tools to test our project

yarn serve

Firebase Project Setup

  1. Create a Firebase Project using the Firebase Console.

  2. Obtain the Firebase Project ID

Features

Things to know...