The Firebase Database quickstart demonstrates how to connect to the Firebase Realtime Database and to send and retrieve data through a simple social blogging app. It will interoperate with the iOS and Android database quickstarts.
Read more about Firebase Database
- Create your project on the Firebase Console. Copy your Firebase config object (from the "Add Firebase to your web app" dialog), and paste it in the
config.tsfile in the database directory. - Enable the Google sign-in provider in the Authentication > SIGN-IN METHOD tab.
- You must have the Firebase CLI installed. If you don't have it install it with
npm install -g firebase-toolsand then configure it withfirebase login. - Run
npm installto install the app's dependencies. - On the command line run
firebase use --addand select the Firebase project you have created.
To run the sample app locally during development:
- Run
npm installto install dependencies. - Run
firebase emulators:startto start the local Firebase emulators. - Run
npm run devto serve the app locally using Vite This will start a server locally that servesindex.htmlonhttp://localhost:5173/index.html.
Running the app using the Firebase CLI:
- Run
npm installto install dependencies. - Run
npm run buildto build the app using Vite. - Run
firebase emulators:startto start the local Firebase emulators. - In your terminal output, you will see the "Hosting" URL. By default, it will be
127.0.0.1:5002, though it may be different for you. - Navigate in your browser to the URL output by the
firebase emulators:startcommand.
To deploy the sample app to production:
- Run
firebase deploy. This will deploy the sample app tohttps://<project_id>.firebaseapp.com.
© Google, 2016. Licensed under an Apache-2 license.