# Rumor - Setup Guide

This project consists of two parts:
1.  **rumor_core**: A Rust library handling the peer-to-peer epidemic routing.
2.  **rumor_app**: A Flutter application for the UI.

They are connected using `flutter_rust_bridge`.

## Prerequisites

1.  **Rust**: Install from [rustup.rs](https://rustup.rs).
2.  **Flutter**: Install from [flutter.dev](https://flutter.dev).
3.  **Codegen Tool**:
    ```bash
    cargo install flutter_rust_bridge_codegen
    ```

## Connecting Rust and Flutter

Before running the app, you must generate the binding code.

1.  Open a terminal in `S04_Rumor` folder.
2.  Run the following command to generate the Dart and Rust glue code:

    ```bash
    flutter_rust_bridge_codegen ^
        --rust-input rumor_core/src/api.rs ^
        --dart-output rumor_app/lib/bridge_generated.dart ^
        --c-output rumor_app/ios/Runner/bridge_generated.h
    ```

3.  **Uncomment the Real Service**:
    *   Open `rumor_app/lib/services/rumor_service.dart`.
    *   Comment out `MockRumorService`.
    *   Uncomment `RealRumorService`.
    *   Change `RumorProvider` in `rumor_app/lib/providers/rumor_provider.dart` to use `RealRumorService`.

## Running

1.  Navigate to `rumor_app`:
    ```bash
    cd rumor_app
    flutter run
    ```

## Troubleshooting

*   **Android**: If you get linker errors, ensure NDK is installed.
*   **iOS**: You might need to strip architectures or setup Xcode properly.
*   **Windows**: Ensure Visual Studio C++ tools are installed.
