@singpath/rules
v1.1.1
Published
Firebase Rules for Singpath.com DB
Downloads
4
Readme
firebase-rules
Rules and migration scripts for Singpath Firbase db.
Requirements
- node 4+; you can use something like nvm to install multiple node version.
- one or more Firebase project. If it will be used in production, you should have at production and a staging db
Setup
We will rely firebase-tools to upload data.
setup a new npm project and install dependencies:
```shell npm install -g firebase-tools npm install -g @singpath/singpath-rules ```
setup a Firebase project in the current directory (it should like to your staging DB):
```shell npm init firebase init firebase login ```
edit firebase.json to add the "rules" entry:
```json { "firebase": "singpath-dev", "rules": "rules.json", "public": "public", "ignore": [ "firebase.json", "**/.*", "**/node_modules/**" ] } ```
upload rules and seed data to your Firebase DB.
``` singpath-rules init-db ```
Building json rules
firebase-tools
(see below) will support bolt rules directly sometime in the
future, but for now we need them in the current json encoded form.
To compile the rules:
singpath-rules compile
You will find the rules in rules.json
.
Uploading rules
./node_modules/.bin/singpath-rules upload-rules
Use the -f
to switch the Firebase DB to upload to and -a
to set the secret.
Development
See CONTRIBUTING.md.