A comprehensive web dashboard application built with Flutter for tracking and managing coffee plantations in Koraput. The application provides real-time monitoring, data visualization, and management tools for coffee plantation initiatives.
- 📈 Live metrics and statistics
- 📊 Interactive data visualization
- 🎯 Comprehensive plantation overview
- 📱 Progress tracking and monitoring
- ☕ Coffee plantation tracking
- 🌳 Shade tree management
- 📏 Area and perimeter calculations
- 🗺️ Geolocation mapping
- 🔍 Multi-level filtering (District, Block, Village, Panchayat)
- 📑 Region-based categorization
- 📊 Performance metrics
- 📈 Survival rate tracking
- 🔐 Secure authentication
- 👮 Role-based access control
- 👨💼 Admin dashboard
- 📝 User activity tracking
- 🌍 Google Maps integration
- 📍 Polygon visualization
- 🚩 Boundary mapping
- 📌 Location-based insights
- 🖼️ Image galleries
- 📄 Documentation storage
- 📸 Boundary images
- 📹 Progress documentation
Before you begin, ensure you have the following installed:
- Flutter SDK (^3.5.4)
- Dart SDK (^3.0.0)
- Firebase CLI
- A Google Maps API key
- Git
-
Firebase Setup:
- Create two Firebase projects (development and production)
- Enable Authentication, Firestore, and Hosting
- Set up Firebase configuration:
# Copy template files cp .github/templates/firebase.json.template firebase.json cp .github/templates/firestore.rules.template firestore.rules cp .github/templates/storage.rules.template storage.rules cp .github/templates/firestore.indexes.json.template firestore.indexes.json cp .github/templates/.firebaserc.template .firebaserc - Update the configuration files:
- In
firebase.json:- Replace
your-site-namewith your Firebase hosting site name - Update
your-regionwith your preferred region (e.g., "asia-east1")
- Replace
- In
.firebaserc:- Replace
your-project-idwith your default Firebase project ID - Update
your-dev-project-idandyour-prod-project-idwith your development and production project IDs - Configure hosting targets for your sites
- Replace
- Update security rules in
firestore.rulesandstorage.rules:- Replace the default open access rules with your security requirements
- Uncomment and modify the example secured rules as needed
- In
firestore.indexes.json:- Replace the example index with your required Firestore indexes
- Add additional indexes as needed for your queries
- In
-
Google Maps Setup:
- Create a Google Cloud Project
- Enable Maps JavaScript API
- Create API key with appropriate restrictions
- Add the key to your environment configuration
-
Clone the repository:
git clone https://github.com/amrit-dash/coffee-mapper-web.git cd coffee_mapper_web -
Install dependencies:
flutter pub get
-
Configure Firebase:
cp lib/config/firebase_options_dev.template.dart lib/config/firebase_options_dev.dart cp lib/config/firebase_options_prod.template.dart lib/config/firebase_options_prod.dart
-
Set up environment variables:
cp .env.template .env
Update the following in your
.envfile:GOOGLE_MAPS_API_KEY=your_api_key FIREBASE_API_KEY=your_firebase_key -
Run the application:
flutter run -d chrome
# Install Firebase tools
npm install -g firebase-tools
# Login to Firebase
firebase login
# Initialize Firebase
firebase init
# Select features:
# - Firestore
# - Hosting
# - Authentication# Deploy to production
./deploy.sh prod
# Deploy to development
./deploy.sh dev📱 Supported Platforms
| Platform | Support |
|---|---|
| Web | ✅ |
| Android | 🚧 |
| iOS | 🚧 |
| Windows | ❌ |
| macOS | ❌ |
| Linux | ❌ |
The application supports both development and production environments:
./deploy.sh dev- Uses development Firebase project
- Enables debugging features
- Development-specific configurations
- Live at: coffee-mapper-dashboard.web.app
./deploy.sh prod- Uses production Firebase project
- Optimized performance
- Production-specific security rules
- Live at: coffeemapper.web.app
lib/
├── config/ # ⚙️ Configuration files
├── models/ # 📦 Data models
├── screens/ # 📱 Application screens
├── services/ # 🔧 Business logic and API services
├── utils/ # 🛠️ Utility functions
└── widgets/ # 🎨 Reusable UI components
├── dialogs/ # 💬 Dialog components
├── forms/ # 📝 Form components
├── layout/ # 🎯 Layout components
├── map/ # 🗺️ Map-related components
└── tables/ # 📊 Data table components
- 🔐 Firebase Authentication for user management
- 🔑 Secure API key handling
- 🛡️ Environment-specific security rules
- 🔒 Data access control
- 🔄 Regular security updates
⚠️ Important Security Note: The template files in.github/templates/contain open access rules for demonstration purposes only. Never use these rules in production. Always implement proper security rules based on your application's requirements before deploying.
We love your input! Check out our Contributing Guidelines to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
- 🎯 Flutter Team for the amazing framework
- 🔥 Firebase for backend services
- 🗺️ Google Maps Platform for mapping services
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Common functions
function isAuthenticated() {
return request.auth != null;
}
function isAdmin() {
return isAuthenticated() &&
get(/databases/$(database)/documents/admins/$(request.auth.uid)).data != null;
}
// Collection access rules
match /plantations/{document=**} {
allow read: if isAuthenticated();
allow write: if isAdmin();
}
match /metrics/{document=**} {
allow read: if isAuthenticated();
allow write: if isAdmin();
}
match /users/{userId} {
allow read: if isAuthenticated() && (request.auth.uid == userId || isAdmin());
allow write: if isAdmin();
}
}
}# 1. Build the web app
flutter build web --web-renderer canvaskit --release --dart-define=ENVIRONMENT=development
# 2. Deploy to Firebase Hosting (Development)
firebase use development
firebase deploy --only hosting
# Alternative: Use deployment script
./deploy.sh dev# 1. Build the web app with optimizations
flutter build web --web-renderer canvaskit --release --dart-define=ENVIRONMENT=production
# 2. Deploy to Firebase Hosting (Production)
firebase use production
firebase deploy --only hosting
# Alternative: Use deployment script
./deploy.sh prod// Example test structure
void main() {
group('Plantation Service Tests', () {
late PlantationService plantationService;
setUp(() {
plantationService = PlantationService();
});
test('should calculate area correctly', () {
final coordinates = [
LatLng(0, 0),
LatLng(0, 1),
LatLng(1, 1),
LatLng(1, 0),
];
final area = plantationService.calculateArea(coordinates);
expect(area, closeTo(111.32, 0.01));
});
});
}# Run integration tests
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d chrome# Run performance tests
flutter run --profile --trace-skia# Generate coverage report
flutter test --coverage
genhtml coverage/lcov.info -o coverage/htmlFor support and inquiries:
- 📧 Support Email: geospatialtech.production@gmail.com
- 👨💻 Developer Contact: amrit.dash60@gmail.com
- 📚 Links Document: Coffee Mapper Links
Made with ❤️ for Koraput's Coffee Farming Community

