DEV Community


Vue.js Firestore example - Vue.js CRUD serverless with Firebase Cloud Firestore

loizenai profile image loizenai ・3 min read

Vue.js Firestore example - Vue.js CRUD serverless with Firebase Cloud Firestore

Cloud Firestore helps us store data in the cloud. It supports offline mode so our app will work fine (write, read, listen to, and query data) whether device has internet connection or not, it automatically fetches changes from our database to Firebase Server. We can structure data in our ways to improve querying and fetching capabilities. This tutorial shows you a Vue.js app that can do Firebase Firestore CRUD Operations.

Related Post: Vue.js CRUD example – a simple Note App

Vue.js Firestore example Overview


Our Vue App can help us write new Notes, then it displays a list of Notes and each Note page (containing title and content) can be modified easily. This App also supports offline mode - we can create/update/delete Note without internet connection.


And, of course, this App interacts with Firebase Firestore as backend infrastructure:



Project Structure


We have 3 components:

  • App.vue holds all of the other components.
  • NotesList.vue contains all of notes in a List with + Note button.
  • Note.vue display a single Note in the List that allows us to create new Note or edit current Note.


  • Vue CLI 3.0.1
  • Vue 2.5.17
  • Firebase SDK for Javascript 5.4.2


    Setup Vue Project

    Install vue-cli

    For use Vue CLI anywhere, run command: npm install -g vue-cli

    Init Project

    Point cmd to the folder you want to save Project folder, run command: npm create vue-note-app

You will see 2 options, choose default:


Install Firebase SDK

Run command: npm install firebase
Once the process is done, you can see firebase in package.json:

"dependencies": {
  "firebase": "^5.4.2",
  "vue": "^2.5.17"

More at:

Discussion (0)

Forem Open with the Forem app