https://github.com/morellexf13/json-to-firebase
🔥 Import entire collections to your firestore database using JSON files
https://github.com/morellexf13/json-to-firebase
database firebase firestore
Last synced: 2 months ago
JSON representation
🔥 Import entire collections to your firestore database using JSON files
- Host: GitHub
- URL: https://github.com/morellexf13/json-to-firebase
- Owner: morellexf13
- Created: 2024-04-15T12:20:17.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T12:44:29.000Z (about 2 years ago)
- Last Synced: 2025-06-07T11:45:25.578Z (about 1 year ago)
- Topics: database, firebase, firestore
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
🔥
JSON to Firebase
Import entire collections to your firestore database using JSON files
## How to use it?
1- Create a **.env** file and add **FIREBASE_DATABASE_URL={YOUR DATABASE URL}**. You can obtain that value here:
https://console.firebase.google.com/u/2/project/{YOUR PROJECT ID}/settings/serviceaccounts/adminsdk
2- On the same page generate a new private key file using the button. Save that file in the root of this project with the name **service_key.json**
3- Make sure to move your json collections to the files folder following the same name as your collection. i.e. users.json and using this sample:
```json
[{
"name": "John Doe",
"email": "john@doe.com"
}]
```
4- Run the following command to install node dependencies
```bash
npm install
```
5- Import your collection to the firestore database using the following command:
```bash
node uploader.js
```