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.ts
file 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-tools
and then configure it withfirebase login
. - Run
npm install
to install the app's dependencies. - On the command line run
firebase use --add
and select the Firebase project you have created.
To run the sample app locally during development:
- Run
npm install
to install dependencies. - Run
firebase emulators:start
to start the local Firebase emulators. - Run
npm run dev
to serve the app locally using Vite This will start a server locally that servesindex.html
onhttp://localhost:5173/index.html
.
Running the app using the Firebase CLI:
- Run
npm install
to install dependencies. - Run
npm run build
to build the app using Vite. - Run
firebase emulators:start
to 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:start
command.
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.