Firebase

Firebase is Google’s Backend-as-a-Service (BaaS) platform, providing hosted backend infrastructure (database, authentication, hosting, cloud functions, storage) that frontend applications can use directly without managing servers.


Firebase in the burgerApp

The Burger Builder uses two Firebase services:

Realtime Database

A cloud-hosted JSON database accessed via REST. The axios-orders.js module creates an Axios instance pointing to:

https://react-burger-app-66329-default-rtdb.firebaseio.com/

Order objects are stored and fetched directly from this URL. Firebase Realtime Database rules control read/write permissions (authenticated users only, in production configuration).

Authentication (Identity Toolkit)

Firebase Auth is called via the Identity Toolkit REST API (not the Firebase SDK) using direct axios.post() calls:

  • Sign-up: POST /identitytoolkit/v3/relyingparty/signupNewUser?key=…
  • Sign-in: POST /identitytoolkit/v3/relyingparty/verifyPassword?key=…

Successful auth returns an idToken, localId, and expiresIn. The app stores these in localStorage and manages session expiry client-side with setTimeout.


Firebase vs Traditional Backend

DimensionFirebase Realtime DBTraditional REST API
SetupZero server configServer, framework, DB, ORM
QueriesLimited (no joins)Full SQL / aggregation
Real-timeBuilt-in websocket syncRequires polling or WebSockets
AuthBuilt-in providersCustom implementation
CostFree tier generous, usage-basedInfrastructure costs

See Also