npm install
npm run serve
npm run build
npm run lint
- Fork this repository.
- Create a repository where you want to host your static files. If you want to access your website using url like
<username>.github.io
like mine bikashnpanda.github.io, create the repository on same name. - Create
firebase
project and obtain config file. Click Here - Now go to
/src/firebase/index.js
section in the cloned repo. Replace theconst FIREBASE_CONFIG = {}
section with the config obtained in the previous step.
Goto Firestore Database
-> Rules
And add the following lines,
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true
}
}
}
-
Install node-firestore-import-export globally by using the command
npm install -g node-firestore-import-export
-
Create a new private key from firebase project.
- Goto
Project Settings
->Service Accounts
in firebase console. - Click on
Generate new private key
. Save the file and note down the file location and name.
- Goto
-
To export existing databases from Firebase, replace the filename and the path in the following command and run in the terminal.
firestore-export --accountCredentials <location>/<filename> --backupFile data.json
e.g. firestore-export --accountCredentials fb-key.json --backupFile data.json
- To import JSON file to the firebase DB use the following command. Please ensure the JSON file is valid.
firestore-import --accountCredentials path/to/credentials/file.json --backupFile /backups/data.json
e.g. firestore-import --accountCredentials fb-key.json --backupFile data.json
You can download the sample JSON file from here