A React Native mobile app for tracking coffee prices from various depots in Karnataka, India. Built with Expo, Firebase Firestore, and TypeScript.
- Package Name:
com.master.coffeeconnect - EAS Project ID:
b5229c37-f73f-4407-a118-90083cb95221 - Backend URL: https://coffee-connect-mu.vercel.app
- Firebase Project:
coffeeconnect-2d910 - Platform: Android (React Native/Expo)
- โ Real-time coffee price display per 50kg bag
- ๐ฑ Variety-wise filtering (Arabica Parchment, Arabica Cherry)
- ๐ช Depot-wise filtering (Madikeri, Virajpete, Kushalnagar, Somvarpete, Shanivarasanthe, Sakleshpura)
- ๐ Price statistics and trends
- ๐ Interactive charts and analytics
- ๐ Multi-language support (English, Kannada)
- ๐ Push notifications for price updates
- ๐ Text-to-speech price announcements
- ๐ค AI-powered data extraction (Gemini AI)
- ๐จโ๐ผ Admin panel for price management
- ๐ Real-time updates from Firebase Firestore
- Node.js 18+ installed
- npm or yarn package manager
- Expo CLI (
npm install -g expo-cli) - EAS CLI (
npm install -g eas-cli) - Android Studio (for Android builds) or Xcode (for iOS builds)
git clone git@github.com:NextGenXplorer/Coffee_Connect.git
cd Coffee_Connectnpm installCreate a .env file in the root directory with the following structure:
# Firebase Configuration
EXPO_PUBLIC_FIREBASE_API_KEY="your-firebase-api-key"
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN="your-project.firebaseapp.com"
EXPO_PUBLIC_FIREBASE_PROJECT_ID="your-project-id"
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET="your-project.firebasestorage.app"
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="your-sender-id"
EXPO_PUBLIC_FIREBASE_APP_ID="your-app-id"
# Admin Credentials (Configure 3 admins)
EXPO_PUBLIC_ADMIN_USERNAME_1="admin1"
EXPO_PUBLIC_ADMIN_PASSWORD_1="password1"
EXPO_PUBLIC_ADMIN_ROLE_1="super_admin"
EXPO_PUBLIC_ADMIN_MARKET_1="all"
EXPO_PUBLIC_ADMIN_USERNAME_2="admin2"
EXPO_PUBLIC_ADMIN_PASSWORD_2="password2"
EXPO_PUBLIC_ADMIN_ROLE_2="super_admin"
EXPO_PUBLIC_ADMIN_MARKET_2="all"
EXPO_PUBLIC_ADMIN_USERNAME_3="admin3"
EXPO_PUBLIC_ADMIN_PASSWORD_3="password3"
EXPO_PUBLIC_ADMIN_ROLE_3="super_admin"
EXPO_PUBLIC_ADMIN_MARKET_3="all"
# Backend URL (Vercel deployment)
EXPO_PUBLIC_BACKEND_URL="https://coffee-connect-mu.vercel.app"
# Google Gemini AI (for AI data extraction)
EXPO_PUBLIC_GEMINI_API_KEY="your-gemini-api-key"Use the provided eascred.sh script to upload environment variables to EAS:
# Dry run first to verify
bash eascred.sh --env .env --dry-run
# Upload to EAS production environment
bash eascred.sh --env .envImportant Note about EXPO_PUBLIC_ variables:
- Variables prefixed with
EXPO_PUBLIC_are embedded in the compiled app - They use "sensitive" visibility in EAS (NOT "secret")
- They will be visible in plain text in your compiled app
- Never store truly secret keys in
EXPO_PUBLIC_variables - The script automatically handles this correctly
- Go to Firebase Console
- Create a new project:
coffeeconnect-2d910(or your own) - Enable Firestore Database
- Enable Cloud Messaging for push notifications
- Add an Android app with package name:
com.master.coffeeconnect - Download
google-services.jsonand place it in the root directory - Set up Firestore security rules (see below)
Create collections with the following structure:
{
breed: string, // 'CB' (Arabica Parchment) or 'BV' (Arabica Cherry)
market: string, // Depot name (Madikeri, Virajpete, etc.)
maxPrice: number, // Maximum price per 50kg bag
minPrice: number, // Minimum price per 50kg bag
pricePerKg: number, // Price used for calculations
quality: string, // 'A', 'B', 'C'
source: string, // Admin username who added this price
verified: boolean, // Admin verification status
lastUpdated: timestamp, // Firestore timestamp
expiresAt: timestamp // Auto-delete after 7 days
}{
token: string, // FCM or Expo push token
platform: string, // 'fcm' or 'expo'
createdAt: timestamp
}{
title: string,
message: string,
imageUrl: string | null,
priceData: object,
sentAt: timestamp,
totalSent: number,
totalFailed: number
}The backend is deployed on Vercel at: https://coffee-connect-mu.vercel.app
To deploy your own backend:
- Navigate to backend directory:
cd backend- Create
.envfile with Firebase service account:
PORT=3000
FIREBASE_PROJECT_ID=coffeeconnect-2d910
FIREBASE_SERVICE_ACCOUNT={"type":"service_account",...}- Deploy to Vercel:
# Install Vercel CLI
npm install -g vercel
# Deploy
vercel --prod# Start Expo development server
npm start
# Run on Android
npm run android
# Run on iOS
npm run ios
# Run on Web
npm run web# Build APK for testing
eas build --platform android --profile preview
# Build AAB for Google Play Store
eas build --platform android --profile production# Build for TestFlight/App Store
eas build --platform ios --profile productionCoffee_Connect/
โโโ App.tsx # Main app entry point
โโโ app.config.js # Expo/EAS configuration
โโโ firebase.config.ts # Firebase initialization
โโโ i18n.ts # Internationalization setup
โโโ eascred.sh # EAS environment variables script
โ
โโโ screens/ # App screens
โ โโโ HomeScreen.tsx # Main price listing screen
โ โโโ StatsScreen.tsx # Analytics and statistics
โ โโโ MarketScreen.tsx # Market-wise comparison
โ โโโ AboutScreen.tsx # About and contact info
โ โโโ NotificationsScreen.tsx # Notification history
โ โโโ LanguageSelectionScreen.tsx # Language picker (first launch)
โ โโโ AdminLoginScreen.tsx # Admin authentication
โ โโโ AdminDashboardScreen.tsx # Admin price management
โ โโโ AdminPriceFormScreen.tsx # Manual price entry form
โ โโโ AdminAIExtractScreen.tsx # AI-powered data extraction
โ
โโโ components/ # Reusable components
โ โโโ Header.tsx # Common header component
โ
โโโ utils/ # Utility functions
โ โโโ adminAuth.ts # Admin authentication logic
โ โโโ aiExtraction.ts # Gemini AI integration
โ
โโโ types/ # TypeScript type definitions
โ โโโ index.ts # Common interfaces
โ
โโโ locales/ # Translation files
โ โโโ en.json # English translations
โ โโโ kn.json # Kannada translations
โ
โโโ assets/ # App assets
โ โโโ coffee_logo.png # App icon/logo
โ โโโ ...
โ
โโโ backend/ # Node.js backend (Vercel)
โโโ server.js # Express server with push notifications
โโโ .env # Backend environment variables
โโโ package.json # Backend dependencies
- Madikeri (เฒฎเฒกเฒฟเฒเณเฒฐเฒฟ)
- Virajpete (เฒตเฒฟเฒฐเฒพเฒเฒชเณเฒเณ)
- Kushalnagar (เฒเณเฒถเฒพเฒฒเฒจเฒเฒฐ)
- Somvarpete (เฒธเณเฒฎเฒตเฒพเฒฐเฒชเณเฒเณ)
- Shanivarasanthe (เฒถเฒจเฒฟเฒตเฒพเฒฐเฒธเฒเฒคเณ)
- Sakleshpura (เฒธเฒเฒฒเณเฒถเฒชเณเฒฐ)
- CB - Arabica Parchment (เฒ เฒฐเณเฒฌเฒฟเฒเฒพ เฒชเฒพเฒฐเณเฒเณโเฒฎเณเฒเฒเณ)
- BV - Arabica Cherry (เฒ เฒฐเณเฒฌเฒฟเฒเฒพ เฒเณเฒฐเณเฒฐเฒฟ)
- Grade A - Premium quality
- Grade B - Standard quality
- Grade C - Basic quality
- super_admin: Full access to all depots
- market_admin: Access to specific depot only
- Manual Price Entry: Add prices with breed, depot, grade selection
- AI Data Extraction: Paste price data (Kannada/English), AI extracts structured data
- Price Management: Edit, delete existing prices
- Push Notifications: Automatic notifications on price updates
- Dashboard Analytics: View statistics and recent updates
- Open app and navigate to "About" screen
- Tap "Admin Panel" at the bottom
- Login with admin credentials
- Choose between Manual Entry or AI Extraction
The app uses Google Gemini AI to extract structured price data from raw text (Kannada or English).
How it works:
- Admin pastes depot price data (e.g., from WhatsApp, SMS)
- AI automatically identifies:
- Depot name
- Date
- Coffee varieties (Parchment/Cherry)
- Prices (Max and Min per 50kg bag)
- Admin reviews and confirms extracted data
- Prices are saved to Firebase
Supported Input Formats:
- Kannada text with coffee prices
- English text with coffee prices
- Mixed Kannada-English text
- Price tables and lists
The app supports two notification systems:
- FCM (Firebase Cloud Messaging): For Android native push
- Expo Push Notifications: Fallback for Expo Go
Notification Triggers:
- New price added by admin
- Price update for specific depot/variety
Backend Integration:
- Node.js server on Vercel
- Sends notifications to all registered tokens
- Includes price details and depot information
- Supports rich notifications with images
The app supports:
- English (en)
- Kannada (kn) - เฒเฒจเณเฒจเฒก
Translation files: locales/en.json and locales/kn.json
Language Selection:
- First launch: Language picker screen
- Settings: Change language anytime from About screen
- Persistent: Language preference saved in AsyncStorage
- React Native - Cross-platform mobile framework
- Expo (SDK 54) - Development platform
- TypeScript - Type-safe JavaScript
- Firebase Firestore - Real-time NoSQL database
- Firebase Cloud Messaging - Push notifications
- Google Gemini AI - AI data extraction
- React Navigation - Navigation library
- i18next - Internationalization framework
- Expo Speech - Text-to-speech
- AsyncStorage - Local data persistence
- Express.js - Backend server (Node.js)
- Vercel - Serverless deployment
This app was migrated from Reshme Info (silk/cocoon price tracking) to Coffee Connect:
- โ
Package name:
com.reshmeinfoโcom.master.coffeeconnect - โ App name: Reshme Info โ Coffee Connect
- โ
Collection:
cocoonPricesโcoffeePrices - โ Markets: Silk markets โ Coffee depots
- โ Breeds: CB/BV (silk) โ CB/BV (coffee varieties)
- โ Price unit: Per kg โ Per 50kg bag
- โ Icons: Leaf โ Coffee bean
- โ Backend: reshme-info.vercel.app โ coffee-connect-mu.vercel.app
- โ EAS Project: New project initialized
- โ Firebase: New project setup
- โ All translations updated
- โ AI extraction retrained for coffee data
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the 0BSD License - see the LICENSE file for details.
- NextGenXplorer - GitHub
- Email: nxgextra@gmail.com
- GitHub Issues: Report a bug
- WhatsApp Channel: Join
- Instagram: @nexgenxplorerr
- Coffee farmers and depot managers for price information
- Firebase for backend infrastructure
- Google Gemini AI for data extraction capabilities
- Expo team for the amazing development platform
Made with โค๏ธ for coffee farmers and traders in Karnataka
๐ค Documentation generated with Claude Code