General Documentation

  1. Home
  2. Docs
  3. General Documentation
  4. Importing Data Seed to Firestore

Importing Data Seed to Firestore

If you purchased a product which has a DataSeed folder included in the archive, it means you can automatically import the .json files included in it into your own Firebase Firestore, to save time during setup (as the alternative is to manually add each item, with all its fields). Among the main products which include Data Seed we can list:

  • Store Locator App
  • Universal Listings App
  • Real Estate App
  • UberEats Clone
  • Restaurant App Template
  • Appointments App

You can import all of our test data into your own Firebase automatically. This would save you a lot of time, since you don’t need to add each entity manually. You can edit the fields later, to add your own photos, names, locations, etc.

  1. Locate DataSeed folder included in your download
  2. Clone this Github repo (this is a script that lets you import and export json data into Firestore)
  3. In Firebase Console -> Project Settings -> Service Accounts -> Generate a Node Private Key -> Download it -> Rename it to “serviceAccountKey.json” and place it into the firestore-import-export folder food delivery firebase
  4. Place all the .json data seed files into the firestore-import-export folder (these are the files included in the downloaded archive, under the DataSeed folder)
  5. Within the firestore-import-export folder, run the following three command for each of the .json files:
    node import.js name_of_json_file.json

This will create a new Firestore table for each of the .json files included in the data seed. Running this script will also populate the table with all the items and their correct fields. That’s it. Now all the data is there, and your app should be usable. Re-run the React Native mobile app, and make sure that all the mock data is there. To add your own data, simply open the json files from DataSeed and modify them directly, with your own photo URLs, titles, descriptions, locations, etc. Make sure you copy the files again into the script folder, and re-run the script on all the files, every time you want to modify something. You can also directly modify this data into Firebase Console. Take a look at the Firestore structure in your Firebase Console, and make sure it looks like this: ubereats clone firebase