This boiler plate which includes vue.js, firebase authentication and vuetify.
Demo Here: vue-auth-fire
Try Logging with the following
Email Address: test@gmail.com
Password: test@12345
At times it get very irritating when you want to start your new project which is a firebase project in which you have to set Authentication Flow EVERYTIME. You have to add Routes, Protect your routes, create a Login & Register component, Style those component and have a nice Loading animation, Validate your login/register form. and much much more.
So I have Developed a boiler plate which you can easily use in your app.
Create your project using vue-cli
IMPORTANT: You need to add
vuex
andvue-router
while setting up the project.
Also add vuetify and firebase just by entering following command one by one.
vue add vuetify
npm i firebase
This Repository is basically the src
folder.
Now you just have to replace the contents of your scr folder with the contents of this folder.
- Download and Extract this repository
- Copy all files from extracted folder and paste it in your projects
src
folder. Then click Replace
For Eg. Copy all files named
store, firebase, views etc(ALL)
from that extracted folder
- Go to Firebase Console. Add Project
- In Project Overview, click on web icon and register app
- Copy
firebaseConfig
object - Click on
Continue to Console
, then click onAuthetication
, then onSet up sign-in method
- Enable Email/password authentication
- Open
src/firebase/init.js
in your project file - Replace that
firebaseConfig
object with one you just copied
Type npm run serve
- When the user is logged in, his/her
id
,name
andemail
will be stored in the store (Vuex
). That means that information will available for entire app viagetter
- When you run this app, you will get a nice preset which can be easily read.
- On refreshing the page you will not lose the user info.
Logged in
user will belogged in
- You will also get a protected view (
Profile page
). Protected view can only be accessed when the user is logged in