Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stephanepericat/nuxt-firebase-demo


https://github.com/stephanepericat/nuxt-firebase-demo

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# nuxt-firebase-demo

This demo app demonstrates how to use Firebase authentication in a [Nuxt.js](https://nuxtjs.org/) application.

## Configuring the demo app

Create your project in the [Firebase
Console](https://console.firebase.google.com).

[Add Firebase to your app](https://firebase.google.com/docs/web/setup).

Enable the **Google** sign-in provider in the
**Authentication > SIGN-IN METHOD** tab.

In the root folder (`/`), create a `firebase.init.js` file.

Copy and paste the Web snippet code configuration found in the console to the `firebase.init.js` file.
You can find the snippet by clicking the "Web setup" button in the Firebase Console
Authentication page.

Ensure the application authorized domain is also whitelisted. `localhost` should already be set
as an authorized OAuth domain.

Since the application is using the Firebase Admin SDK, service account credentials will be
required. Learn more on how to [add the Firebase Admin SDK to your
server](https://firebase.google.com/docs/admin/setup).

After you generate a new private key, save it in the `/server` folder as
`serviceAccountKeys.json`.
Make sure to keep these credentials secret and never expose them in public.

## Running the demo app

To run the demo app, run:
```bash
npm run dev
```

This will launch a local server using port 3000.
To access the app, go to [http://localhost:3000/login](http://localhost:3000/login)