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
| Dimension | Firebase Realtime DB | Traditional REST API |
|---|---|---|
| Setup | Zero server config | Server, framework, DB, ORM |
| Queries | Limited (no joins) | Full SQL / aggregation |
| Real-time | Built-in websocket sync | Requires polling or WebSockets |
| Auth | Built-in providers | Custom implementation |
| Cost | Free tier generous, usage-based | Infrastructure costs |
See Also
- schwarzmuller-2021-react-burger-app — source repo using Firebase
- react — frontend framework
- redux — manages auth token state received from Firebase