# Firebase Configuration # Copy this file to .env and replace with your actual Firebase credentials # Get these values from Firebase Console: # 1. Go to https://console.firebase.google.com/ # 2. Select your project # 3. Go to Project Settings > General > Your apps # 4. Select your web app or create one # 5. Copy the configuration values EXPO_PUBLIC_FIREBASE_API_KEY=your-api-key-here EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project-id.firebaseapp.com EXPO_PUBLIC_FIREBASE_PROJECT_ID=your-project-id-here EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project-id.appspot.com EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-sender-id-here EXPO_PUBLIC_FIREBASE_APP_ID=your-app-id-here # ======================================== # Admin Panel Configuration # ======================================== # Configure multiple admin accounts with different roles and market access # Each admin account needs username, password, role, and market access # Super Admin (Full Access to All Markets) ADMIN_USERNAME_1=super_admin ADMIN_PASSWORD_1=your-super-admin-password ADMIN_ROLE_1=super_admin ADMIN_MARKET_1=all # Market Administrators (Specific Market Access) # Ramanagara Market Admin ADMIN_USERNAME_2=admin_ramanagara ADMIN_PASSWORD_2=your-ramanagara-admin-password ADMIN_ROLE_2=market_admin ADMIN_MARKET_2=Ramanagara # Kollegala Market Admin ADMIN_USERNAME_3=admin_kollegala ADMIN_PASSWORD_3=your-kollegala-admin-password ADMIN_ROLE_3=market_admin ADMIN_MARKET_3=Kollegala # Kanakapura Market Admin ADMIN_USERNAME_4=admin_kanakapura ADMIN_PASSWORD_4=your-kanakapura-admin-password ADMIN_ROLE_4=market_admin ADMIN_MARKET_4=Kanakapura # Siddalagatta Market Admin ADMIN_USERNAME_5=admin_siddalagatta ADMIN_PASSWORD_5=your-siddalagatta-admin-password ADMIN_ROLE_5=market_admin ADMIN_MARKET_5=Siddalagatta # Kolar Market Admin ADMIN_USERNAME_6=admin_kolar ADMIN_PASSWORD_6=your-kolar-admin-password ADMIN_ROLE_6=market_admin ADMIN_MARKET_6=Kolar # Additional Admin Accounts (Optional) # You can add up to 10 admin accounts by following the pattern: # ADMIN_USERNAME_X=username # ADMIN_PASSWORD_X=password # ADMIN_ROLE_X=super_admin|market_admin # ADMIN_MARKET_X=market_name|all # ======================================== # Admin Panel Security Notes # ======================================== # 1. Use strong passwords with special characters, numbers, and mixed case # 2. Role Types: # - super_admin: Full access to all markets and administrative functions # - market_admin: Access only to specified market data # 3. Market Access: # - Use "all" for super_admin role to access all markets # - Use specific market names (Ramanagara, Kollegala, etc.) for market_admin # 4. Session Duration: 8 hours (configured in adminAuth.ts) # 5. Failed Login Protection: 3 attempts max, then 5-minute lockout # ======================================== # Password Security Recommendations # ======================================== # - Minimum 12 characters # - Include uppercase and lowercase letters # - Include numbers and special characters # - Avoid common words or patterns # - Use unique passwords for each admin account # # Example strong password format: # AppName@Year!Market (e.g., Reshme@2025!Rama) # ======================================== # Firebase Security Setup Required # ======================================== # After setting up your environment variables, you need to: # 1. Update Firestore Security Rules: # - Copy rules from firestore.rules.admin # - Deploy to Firebase Console > Firestore > Rules # 2. Optional: Enable Firebase Authentication for enhanced security # 3. Test admin panel access in development mode # ======================================== # Development vs Production # ======================================== # Development: # - Admin panel access via shield icon (🛡️) in top-right corner # - Fallback hardcoded credentials available for testing # # Production: # - Shield icon automatically hidden # - Only environment variable credentials accepted # - Consider additional security measures (IP restrictions, etc.) # ======================================== # Troubleshooting # ======================================== # Common Issues: # 1. "Invalid credentials" - Check username/password spelling # 2. "Permission denied" - Verify Firestore rules are updated # 3. "Session expired" - Sessions last 8 hours, login again # 4. "Market access denied" - Check ADMIN_MARKET_X configuration # # For support: Check ADMIN_PANEL_README.md for detailed documentation # ======================================== # AI Provider Configuration (Multi-Provider System) # ======================================== # The app uses multiple AI providers with automatic fallback. # When one provider hits rate limits, it automatically tries the next. # Configure as many providers as you want for maximum reliability. # Provider Priority: Gemini → Groq → OpenRouter # ---------------------------------------- # 1. Google Gemini (Primary) # ---------------------------------------- # Get your API key from: https://makersuite.google.com/app/apikey # Free tier: 60 requests/minute EXPO_PUBLIC_GEMINI_API_KEY=your-gemini-api-key-here EXPO_PUBLIC_GEMINI_ADMIN_API_KEY=your-gemini-admin-api-key-here # ---------------------------------------- # 2. Groq (Fast, Generous Free Tier) # ---------------------------------------- # Get your API key from: https://console.groq.com/keys # Free tier: 30 requests/minute, very fast inference EXPO_PUBLIC_GROQ_API_KEY=your-groq-api-key-here # ---------------------------------------- # 3. OpenRouter (Access to Many Models) # ---------------------------------------- # Get your API key from: https://openrouter.ai/keys # Pay-per-use with free tier models available EXPO_PUBLIC_OPENROUTER_API_KEY=your-openrouter-api-key-here # ======================================== # AI Provider Benefits # ======================================== # Gemini: Best for Kannada text, good extraction quality # Groq: Fastest response times, good for high-volume usage # OpenRouter: Access to multiple models, good fallback option # # Recommendation: Configure all three for maximum reliability