https://github.com/amrit-dash/coffee-mapper-web
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.
https://github.com/amrit-dash/coffee-mapper-web
firebase firebase-auth firebase-firestore firebase-hosting flutter flutter-web flutter-web-app google-maps-api
Last synced: about 1 month ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/amrit-dash/coffee-mapper-web
- Owner: amrit-dash
- License: mit
- Created: 2025-02-14T02:42:24.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-08T06:39:51.000Z (9 months ago)
- Last Synced: 2025-09-08T08:27:41.818Z (9 months ago)
- Topics: firebase, firebase-auth, firebase-firestore, firebase-hosting, flutter, flutter-web, flutter-web-app, google-maps-api
- Language: Dart
- Homepage: https://coffeemapper.web.app
- Size: 10.7 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# Coffee Mapper Web Dashboard ๐ฑโ

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.
[](https://flutter.dev/)
[](https://dart.dev)
[](https://firebase.google.com/)
[](LICENSE)
[](CONTRIBUTING.md)
[](https://about.me/amritdash)
[](https://twitter.com/amritdash)
[](https://github.com/amrit-dash/coffee-mapper-web/actions)
[Features](#-features) โข [Installation](#-getting-started) โข [Contributing](#-contributing) โข [Support](#-support)
### ๐ Live Deployments
[](https://coffeemapper.web.app)
[](https://coffee-mapper-dashboard.web.app)
Try out our [Production Environment](https://coffeemapper.web.app) or [Development Environment](https://coffee-mapper-dashboard.web.app)
## โจ Features
### ๐ Real-time Dashboard
- ๐ Live metrics and statistics
- ๐ Interactive data visualization
- ๐ฏ Comprehensive plantation overview
- ๐ฑ Progress tracking and monitoring
### ๐ฟ Plantation Management
- โ Coffee plantation tracking
- ๐ณ Shade tree management
- ๐ Area and perimeter calculations
- ๐บ๏ธ Geolocation mapping
### ๐ Data Filtering & Analysis
- ๐ Multi-level filtering (District, Block, Village, Panchayat)
- ๐ Region-based categorization
- ๐ Performance metrics
- ๐ Survival rate tracking
### ๐ฅ User Management
- ๐ Secure authentication
- ๐ฎ Role-based access control
- ๐จโ๐ผ Admin dashboard
- ๐ User activity tracking
### ๐บ๏ธ Interactive Maps
- ๐ Google Maps integration
- ๐ Polygon visualization
- ๐ฉ Boundary mapping
- ๐ Location-based insights
### ๐ธ Media Management
- ๐ผ๏ธ Image galleries
- ๐ Documentation storage
- ๐ธ Boundary images
- ๐น Progress documentation
## ๐ Getting Started
### Prerequisites
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
### ๐ API Keys and Configuration
1. **Firebase Setup**:
- Create two Firebase projects (development and production)
- Enable Authentication, Firestore, and Hosting
- Set up Firebase configuration:
```bash
# 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-name` with your Firebase hosting site name
- Update `your-region` with your preferred region (e.g., "asia-east1")
- In `.firebaserc`:
- Replace `your-project-id` with your default Firebase project ID
- Update `your-dev-project-id` and `your-prod-project-id` with your development and production project IDs
- Configure hosting targets for your sites
- Update security rules in `firestore.rules` and `storage.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
2. **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
### โก Quick Start
1. Clone the repository:
```bash
git clone https://github.com/amrit-dash/coffee-mapper-web.git
cd coffee_mapper_web
```
2. Install dependencies:
```bash
flutter pub get
```
3. Configure Firebase:
```bash
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
```
4. Set up environment variables:
```bash
cp .env.template .env
```
Update the following in your `.env` file:
```
GOOGLE_MAPS_API_KEY=your_api_key
FIREBASE_API_KEY=your_firebase_key
```
5. Run the application:
```bash
flutter run -d chrome
```
### ๐ง Environment Setup
#### Development Environment
```bash
# Install Firebase tools
npm install -g firebase-tools
# Login to Firebase
firebase login
# Initialize Firebase
firebase init
# Select features:
# - Firestore
# - Hosting
# - Authentication
```
#### Production Environment
```bash
# Deploy to production
./deploy.sh prod
# Deploy to development
./deploy.sh dev
```
๐ฑ Supported Platforms
| Platform | Support |
|----------|---------|
| Web | โ
|
| Android | ๐ง |
| iOS | ๐ง |
| Windows | โ |
| macOS | โ |
| Linux | โ |
## ๐ง Development vs Production
The application supports both development and production environments:
### ๐ ๏ธ Development
```bash
./deploy.sh dev
```
- Uses development Firebase project
- Enables debugging features
- Development-specific configurations
- Live at: [coffee-mapper-dashboard.web.app](https://coffee-mapper-dashboard.web.app)
### ๐ Production
```bash
./deploy.sh prod
```
- Uses production Firebase project
- Optimized performance
- Production-specific security rules
- Live at: [coffeemapper.web.app](https://coffeemapper.web.app)
## ๐๏ธ Project Structure
```
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
```
## ๐ Security
- ๐ 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.
## ๐ค Contributing
We love your input! Check out our [Contributing Guidelines](CONTRIBUTING.md) to get started.
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ฅ Core Team
## ๐ Acknowledgments
* ๐ฏ Flutter Team for the amazing framework
* ๐ฅ Firebase for backend services
* ๐บ๏ธ Google Maps Platform for mapping services
## ๐ง Technical Details
### ๐ Firestore Rules Configuration
```javascript
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();
}
}
}
```
### ๐ Deployment Process
#### Development Deployment
```bash
# 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
```
#### Production Deployment
```bash
# 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
```
### ๐งช Testing Guidelines
#### Unit Tests
```dart
// 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));
});
});
}
```
#### Integration Tests
```bash
# Run integration tests
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d chrome
```
#### Performance Testing
```bash
# Run performance tests
flutter run --profile --trace-skia
```
#### Test Coverage
```bash
# Generate coverage report
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
```
## ๐ Support
For support and inquiries:
- ๐ง Support Email: geospatialtech.production@gmail.com
- ๐จโ๐ป Developer Contact: amrit.dash60@gmail.com
- ๐ Links Document: [Coffee Mapper Links](https://docs.google.com/document/d/1tTvSK8hoXd7UaeSKX60f-Dl1YoWcQjqIl2ckJ6YS2qU/edit?usp=sharing)
---
Made with โค๏ธ for Koraput's Coffee Farming Community
[Website](https://coffeemapper.web.app)