Firebase Setup
Asset Information Centre uses Firebase as its backend. This guide walks through creating and connecting a Firebase project.
Create a Firebase project
- Visit Firebase Console
- Click Add project
- Enter project name (e.g.
asset-management-prod) - Enable or disable Google Analytics (optional)
- Click Create project
Enable Authentication
- Build → Authentication → Get started
- Sign-in method tab:
- Enable Email/Password (required)
- Optionally enable Google, Microsoft, or OpenID Connect for SSO
- Settings → Authorized domains — add your production domain when deploying
Create Firestore database
- Build → Firestore Database → Create database
- Choose region closest to your users (e.g.
asia-south1for India) - Start in test mode for development, then deploy rules before production
Register web application
- Project Settings → General → Your apps → Web (
</>) - Register app nickname:
Asset Information Centre - Copy the
firebaseConfigobject values into.env:
| Firebase config key | Environment variable |
|---|---|
apiKey | VITE_FIREBASE_API_KEY |
authDomain | VITE_FIREBASE_AUTH_DOMAIN |
projectId | VITE_FIREBASE_PROJECT_ID |
storageBucket | VITE_FIREBASE_STORAGE_BUCKET |
messagingSenderId | VITE_FIREBASE_MESSAGING_SENDER_ID |
appId | VITE_FIREBASE_APP_ID |
measurementId | VITE_FIREBASE_MEASUREMENT_ID (optional) |
In-app configuration
Super Admin can update Firebase config without editing files:
- Log in as Super Admin
- Settings → Platform → Firebase Backend Setup
- Enter config values → Save & Reload
The dev server writes values to .env automatically.
Initialize Firebase CLI
npm install -g firebase-tools
firebase login
firebase use --add
# Select your project ID
Link local project to Firebase:
firebase init
Select:
- Firestore (use existing
firestore.rules) - Hosting (public directory:
dist)
Deploy rules
firebase deploy --only firestore:rules
Critical for:
- Role permission matrix saves
- Site map designer settings
- User management restrictions
Security checklist
- Firestore rules deployed (not test mode in production)
- Only Super Admin has
settings.manageby default - Authorized domains configured for production URL
- API keys restricted in Google Cloud Console (optional but recommended)