Backend for Web + Mobile Apps
Firebase is a Backend-as-a-Service (BaaS) by Google used for authentication, database, hosting, and real-time apps.
- Authentication (Login/Signup) - Firestore Database - Realtime Database - Hosting - Cloud Functions - Storage (files/images)
Supports: - Email/Password - Google Login - Phone OTP
import { initializeApp } from "firebase/app";
const firebaseConfig = {
apiKey: "YOUR_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT"
};
const app = initializeApp(firebaseConfig);
import { getFirestore, addDoc, collection } from "firebase/firestore";
const db = getFirestore(app);
await addDoc(collection(db, "users"), {
name: "Sasank",
role: "Developer"
});
- Live data sync - Chat apps - Live notifications
Commands: npm install -g firebase-tools firebase login firebase init firebase deploy
Used for: - Images - Videos - Files
Build a: - Login + Signup system - Save user data in Firestore - Show realtime updates