Easily create admin dashboards for your Firebase powered apps. For example, you can create a merchant dashboard for uploading items on an e-commerce site which uses Firebase as the backend.
- dashboard: contains a react based app which will be served using
Firebase hosting. It hits a Firebase cloud function
api
defined insidefunctions
folder. - functions: contains an
api
cloud function which is basically an Express based API for your app. Your write all your protected business logic here.
-
Put your Firebase project's name in
.firebaserc
. -
Set a secret key for JWT token on Firebase.
firebase functions:config:set auth.secret="<YOUR_SECRET>"
-
Cd to
functions
folder and runyarn install
-
For every admin user, run the npm script
yarn run passwdgen <username> <password>
and follow further instructions.
-
Cd to
dashboard
folder and runyarn install
-
In
dashboard/src/globals.js
file, set your local and production cloud functions endpoints in API_URL. To get these values, run:for local
firebase serve --only functions
for production
firebase deploy
- Download your project's service account key
.json
file and export it in your environment variable.set GOOGLE_APPLICATION_CREDENTIALS=<path_to_json_file>/serviceAccountKey.json
- Get a copy of Firebase environment variables set on the server, for running the functions locally. From
functions
folder, runfirebase functions:config:get > .runtimeconfig.json
- Run the functions locally
firebase serve --only functions
- Cd to
dashboard
folder and runyarn start
Run deploy.sh
.
Please open a new issue in case you are facing some problem or write to me at [email protected].