# Agrilink Vocpro (Smart Farming Application)

A mobile application for managing and monitoring greenhouse conditions with IoT devices using Flutter.

## Overview
This application enables user to monitor greenhouse conditions and control devices like water valves via an IoT interface. The app retrieves data from various sensors (humidity, temperature, etc.) and allows manual control of devices through MQTT.

## Features
- Monitor sensor data (humidity, temperature, light intensity, etc.)
- Control IoT devices (water valves, lights)
- User authentication and profile management
- MQTT integration for real-time data communication (via Rest API)

## Technology Stack
- Flutter (Mobile Framework)
- MQTT (IoT communication)
- REST API (Backend communication)
- GitLab/GitHub for version control

## Flutter Dependency Stack

This project uses several packages to support various functionalities. Below is a list of the key dependencies:

- **[Dio](https://pub.dev/packages/dio)**: A powerful HTTP client for Dart, used for integrating with the API backend.
- **[shared_preferences](https://pub.dev/packages/shared_preferences)**: A package for storing simple data persistently across sessions (e.g., token management).
- **[intl](https://pub.dev/packages/intl)**: Provides internationalization and localization support, including date formatting and number formatting.
- **[go_router](https://pub.dev/packages/go_router)**: A declarative routing package used for managing navigation between screens.
- **[bootstrap_icons](https://pub.dev/packages/bootstrap_icons)**: A package that provides Bootstrap icons for UI components.
- **[fl_chart](https://pub.dev/packages/fl_chart)**: A powerful chart library for visualizing data in different formats, used for sensor data graphing.
- **[flutter_screenutil](https://pub.dev/packages/flutter_screenutil)**: A package to manage screen size responsiveness, ensuring the app looks good on different device resolutions.
- **[gauge_indicator](https://pub.dev/packages/gauge_indicator)**: A widget for visualizing sensor data (e.g., humidity, temperature) with gauge indicators.
- **[mqtt_client](https://pub.dev/packages/mqtt_client)**: A library used for MQTT integration, enabling real-time communication between the app and IoT devices.


## Installation Guide
1. Clone the repository:
   ```bash
   git clone https://github.com/username/smart-farming.git
   ```
2. Navigate to the project directory:
   ```bash
   cd smart-farming
   ```
3. Install dependencies:
   ```bash
   flutter pub get
   ```
   if it does't work try:
   ```bash
   flutter outdated
   //follow with
   flutter pub upgrade --major-versions
   ```
   or check your latest dart version make sure it compatible with this project
4. Run the project:
   ```bash
   flutter run
   ```

### 6. **Project Structure**
Berikan deskripsi singkat tentang struktur folder dan file penting di dalam proyek.


## Project Structure
- `lib/`: Contains the Flutter app source code.
  - `core/`: Contains all constant vaalue and data needed for the project.
  - `data/`: Conatains model and data response
  - `domain/`: logic and service of the application
  - `feature/`: Contains every feature in the app
    - `provider/`
    - `view`
    - `widget`
- `pubspec.yaml`: Project dependencies and configurations.


## Progress Report

| Date       | Type  | Description                                                                                         |
|------------|-------|-----------------------------------------------------------------------------------------------------|
| 2024-10-09 | feat  | Completed the integration of MQTT for sensor data and IoT device control.                            |
| 2024-10-02 | fix   | Implemented auto-reconnect for MQTT on app open/close.                                               |
| 2024-09-30 | feat  | Added UI for displaying soil pH level with a linear bar.                                             |
| 2024-09-27 | feat  | Finalized group display for 'Doses' in ExpansionTile for medicine dosage recommendations.            |
| 2024-09-24 | feat  | Completed sorting dialog functionality with single sorter selection capability.                      |
| 2024-09-20 | feat  | Implemented patient data creation form with validation and state management using dialogs.           |


## Contributing
1. Fork the repository.
2. Create a new branch (`git checkout -b feature/your-feature`).
3. Commit your changes (`git commit -m 'Add your feature'`).
4. Push to the branch (`git push origin feature/your-feature`).
5. Open a Pull Request.


## License
This project is licensed under the MIT License.
