-
Create a firebase project.
-
Add a web application to it. Ref: https://firebase.google.com/docs/projects/learn-more#setting_up_a_firebase_project_and_adding_apps
-
Obtain the config file for your app. Ref: https://support.google.com/firebase/answer/7015592
-
Create a file
firebase.js
undersrc/
. Copy contents fromfirebase.example.js
and replace the keys with the keys obtained from firebase.
In the project directory run: yarn start
Open http://localhost:3000 to view it in the browser.
npm install -g firebase-tools
- Install firebase cli tools.firebase login
- log in to the firebase console.- Go to
.firebaserc
- add your project names in place of indus-6c25e.indus-demo
is alias can also be replaced. firebase.json
is already configured to use functions, firestore and hosting.
firebase deploy --only functions
- Deploy cloud functions.firebase deploy --only functions:function_name
- Deploy specific cloud function.
yarn build
-
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
firebase serve --only hosting
- Serves the build folder in local.
firebase deploy
- Deploys the app to firebase.
Reference: https://dev.to/sama/deploying-a-react-app-to-firebase-2lda (Deploying a react app to firebase.)