Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Release 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dyaa committed Oct 9, 2017
1 parent fd2a3b5 commit cfe32e7
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Firebase Firestore connector for the LoopBack framework.

I needed an easy way to connect a Loopback application to [Firebase][7]'s NoSQL database [Firestore][6] so that i decided to build this connector.

#### Installation
### Installation
If you want to know how to get started with Loopback [check this][5].

To add a new data source, use the data source generator:
Expand All @@ -22,17 +22,40 @@ Then the data source generator will prompt some questions like
- Enter the connector's module name **loopback-connector-firestore**
- Install loopback-connector-firestore (Y/n) **y**

Then you should use a service account. Go to [Project Settings > Service Accounts][4] in the Cloud Platform Console. Generate a new private key and save the JSON file in the Loopback's `server` directory with file name `serviceAccountKey.json`
Then you should use a service account. Go to [Project Settings > Service Accounts][4] in the Google Cloud Platform Console. Generate a new private key and save the JSON file.

#### Inspiration
You should fill the application's datasource file which is located in `/server/datasources.json` with those details, You can find them in the downloaded JSON file from the Google Cloud Platform.

```javascrpt
"firestore": {
"name": "firestore",
"projectId": "",
"clientEmail": "",
"privateKey": "",
"databaseName": "" // Optional, Default: projectId
}
```

#### Connection properties

| Property | Type   | Description | --- |
| --- | --- | --- | --- |
| projectId | String | project_id in the JSON file | --- |
| clientEmail | String | client_email in the JSON file | --- |
| privateKey | String | private_key in the JSON file | --- |
| databaseName | String | Firebase's project id | Optional, Default: projectId | --- |

And you can actually store those private details as an Environment variables, Check [source-configuration][4]

### Inspiration
I've got inspired by the Official [MongoDB connector][3] by Loopback

#### TODO
### TODO

- Add test
- Make Service Account Key name and path an option

#### License
### License

Copylefted (c) 2017 [Dyaa Eldin Moustafa][1] Licensed under the [MIT license][2].

Expand All @@ -44,3 +67,4 @@ Copylefted (c) 2017 [Dyaa Eldin Moustafa][1] Licensed under the [MIT license][2]
[5]: http://loopback.io/getting-started/
[6]: https://firebase.google.com/products/firestore/
[7]: https://firebase.google.com
[8]: https://loopback.io/doc/en/lb3/Environment-specific-configuration.html#data-source-configuration

0 comments on commit cfe32e7

Please sign in to comment.