Set up oboapp with real Firebase/Google Cloud Platform infrastructure for production deployment or realistic testing.
- Google Cloud Platform account
- Firebase project
- Domain name (for production deployment)
- Go to Firebase Console
- Click "Add project"
- Enter project name:
oboapp-prod(or your choice) - Enable Google Analytics (optional)
- Create project
- In Firebase Console → Build → Firestore Database
- Click Create database
- Select location:
europe-north2(or closest to users) - Start in production mode
- In Firebase Console → Build → Authentication
- Click Get started
- Enable Google sign-in provider
- Add authorized domains for your app
- In Firebase Console → Build → Messaging
- Click Get started
- Follow setup wizard
- Generate VAPID key (Settings → Cloud Messaging → Web Push certificates)
See detailed instructions: Firebase Service Account Setup
- In Firebase Console → Project Settings → Service Accounts
- Click Generate new private key
- Download JSON file (keep it secret!)
- Convert to single line:
jq -c . < service-account-key.json
- Go to Google Cloud Console
- Select your Firebase project
- Navigate to APIs & Services → Enable APIs and Services
Enable these APIs:
- ✅ Maps JavaScript API - For map display
- ✅ Geocoding API - For address to coordinates conversion
- ✅ Generative Language API - For Gemini AI (message categorization)
- In Google Cloud Console → APIs & Services → Credentials
- Click Create Credentials → API key
- Copy the key
- Click Edit API key → API restrictions
- Select Restrict key → Choose:
- Maps JavaScript API
- Geocoding API
- Add Application restrictions:
- HTTP referrers:
https://yourdomain.com/*,http://localhost:3000/*
- HTTP referrers:
- Go to Google AI Studio
- Click Create API Key
- Select your Firebase/GCP project
- Copy the key
cd ingest
firebase login
firebase use <your-project-id>
firebase deploy --only firestore:indexesWait 5-15 minutes for indexes to build. Check status in Firebase Console → Firestore → Indexes.
Critical: App will fail with cryptic errors if indexes aren't built.
# Firebase Configuration
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
# Firebase Admin SDK Service Account
FIREBASE_SERVICE_ACCOUNT_KEY={"type":"service_account",...}
# Google Maps API Key
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_maps_api_key
# Google Gemini AI
GOOGLE_AI_API_KEY=your_gemini_api_key
GOOGLE_AI_MODEL=gemini-2.5-flash-lite
# App URL (production)
NEXT_PUBLIC_APP_URL=https://yourdomain.com
# Keep mocks disabled
# MOCK_GEMINI_API=false
# MOCK_GOOGLE_GEOCODING=false
# USE_FIREBASE_EMULATORS=false# Firebase Configuration
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
# Google Maps API Key
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_maps_api_key
# Firebase Admin SDK Service Account
FIREBASE_SERVICE_ACCOUNT_KEY={"type":"service_account",...}
# Firebase Cloud Messaging (optional)
NEXT_PUBLIC_FIREBASE_VAPID_KEY=your_vapid_key
# Base URL (production)
NEXT_PUBLIC_BASE_URL=https://yourdomain.com
# Keep emulators disabled
# NEXT_PUBLIC_USE_FIREBASE_EMULATORS=falseGet Firebase config values from: Firebase Console → Project Settings → General → Your apps → Web app
cd ingest
pnpm install
pnpm crawl --source sofiyska-voda
pnpm ingest
pnpm notifycd web
pnpm install
pnpm dev # Development
pnpm build && pnpm start # ProductionThe ingest module is containerized for deployment to Google Cloud Run:
cd ingest
docker build -t gcr.io/your-project-id/oboapp-ingest .
docker push gcr.io/your-project-id/oboapp-ingest
gcloud run deploy oboapp-ingest --image gcr.io/your-project-id/oboapp-ingestSee ingest/terraform/ for infrastructure-as-code deployment.
- Connect GitHub repository to Vercel
- Configure environment variables in Vercel dashboard
- Deploy
Firebase Console → Firestore → Indexes
Status should be "Enabled" for all indexes.
Google Cloud Console → APIs & Services → Quotas
Watch for:
- Maps JavaScript API requests
- Geocoding API requests
- Gemini AI requests
Google Cloud Console → Cloud Run → Select job → Logs
Filter by error severity for issues.
Based on typical usage for Sofia, Bulgaria:
| Service | Free Tier | Typical Monthly Cost |
|---|---|---|
| Firestore | 50K reads/day | $1-5 |
| Cloud Run | 2M requests | $0-2 |
| Geocoding API | $200 credit/mo | $0-10 |
| Maps JavaScript API | $200 credit/mo | $0 |
| Gemini AI | Free tier | $0-5 |
| Total | - | $1-22/month |
Cause: Firestore security rules block client writes
Solution: All writes must go through API routes using Firebase Admin SDK
Cause: Firestore indexes not deployed or still building
Solution: Run firebase deploy --only firestore:indexes and wait
Cause: Exceeded free tier limits
Solution: Enable billing in Google Cloud Console or reduce API calls
Cause: API key restrictions too broad
Solution: Restrict Maps API key to specific HTTP referrers
- External API Mocks - Test locally without API costs
- Quick Start with Emulators - Development without cloud setup
- Contributing Guide - Submit improvements