A Flutter mobile application for the M.A.S.H. (Mushroom Automation with Smart Hydro-environment) system that enables mushroom growers to monitor environmental conditions in real-time, control IoT devices remotely, receive critical alerts, and manage cultivation cyclesβall with full offline capability.
- Email/password login with Firebase Authentication
- Biometric authentication support
- Auto-login with saved credentials
- Session management and token refresh
- Live temperature, humidity, and COβ readings
- Visual indicators with color-coded status
- Historical data charts
- Device online/offline status
- Pull-to-refresh functionality
- Firebase Cloud Messaging integration
- Critical alert notifications
- Environmental threshold warnings
- Device offline notifications
- In-app notification center
- SQLite local database for caching
- Background sync when connectivity restored
- Queue system for pending actions
- Offline indicator in UI
- Conflict resolution strategy
- Framework: Flutter 3.24+ with Dart 3.5+
- State Management: Provider pattern
- Authentication: Firebase Auth + JWT fallback
- Real-time Data: WebSocket + Firebase Realtime Database
- Local Database: SQLite with sqflite
- HTTP Client: Dio with interceptors
- UI Design: Material 3 design system
lib/
βββ main.dart
βββ app.dart
βββ core/
β βββ config/
β βββ constants/
β βββ network/
β βββ utils/
βββ data/
β βββ datasources/
β βββ models/
β βββ repositories/
βββ domain/
β βββ entities/
β βββ repositories/
βββ presentation/
β βββ providers/
β βββ screens/
β βββ widgets/
βββ services/
- Flutter SDK 3.24 or higher
- Dart SDK 3.5 or higher
- Android Studio / VS Code
- Firebase project setup
-
Clone the repository
git clone https://github.com/PP-Namias/MASH-Grower-Mobile.git cd MASH-Grower-Mobile -
Install dependencies
flutter pub get
-
Configure Firebase
- Create a Firebase project
- Add Android/iOS apps to the project
- Download configuration files:
android/app/google-services.json(Android)ios/Runner/GoogleService-Info.plist(iOS)
-
Configure environment variables
- Copy
.env.exampleto.env - Update API endpoints and Firebase configuration
- Copy
-
Run the app
flutter run
Android APK:
flutter build apk --releaseiOS IPA:
flutter build ios --releaseThe app integrates with the M.A.S.H. backend API:
- Base URL:
https://mash-backend.onrender.com/api/v1 - WebSocket:
wss://mash-backend.onrender.com/ws - Authentication: JWT tokens with Firebase Auth
- Real-time: WebSocket for live sensor data
POST /auth/exchange- Exchange Firebase token for JWTGET /devices- Get user's devicesGET /sensors/data/:deviceId/latest- Latest sensor readingsGET /alerts- Get user alertsGET /notifications- Get notifications
The app uses SQLite for offline storage with the following tables:
users- User informationdevices- IoT device datasensor_readings- Sensor data with sync statusalerts- Alert notificationsnotifications- General notificationssync_queue- Pending sync operations
The app uses Provider for state management with the following providers:
AuthProvider- Authentication stateSensorProvider- Sensor data managementDeviceProvider- Device managementNotificationProvider- Notification handlingThemeProvider- Theme management
The app is designed to work offline with the following features:
- Data Caching: All data is cached in SQLite
- Background Sync: Automatic sync when online
- Queue System: Pending operations are queued
- Conflict Resolution: Smart conflict resolution for data sync
- Offline Indicators: Clear UI indicators for offline state
flutter testflutter test integration_test/flutter test test/widget_test.dart- Build release APK/AAB
- Upload to Google Play Console
- Configure app signing
- Submit for review
- Build release IPA
- Upload to App Store Connect
- Configure app metadata
- Submit for review
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Contact the development team
- Check the documentation
- Advanced analytics dashboard
- Machine learning predictions
- Multi-language support
- Dark mode improvements
- Performance optimizations
- Additional sensor types
- Export functionality
- Backup and restore
MASH Grow Mobile App - Smart mushroom growing made simple! π