The mobile app client for the Forest Guard AI model built for the AI4Good Hackathon organized by AICommons and moderated by Superfluid.io.
# Forest Guard
The mobile app client for the Forest Guard AI Model built and deployed by Team LISA for the AI4Good Hackathon organized by AI Commons and moderated by Superfluid.io.
> ### The purpose of the app is to receive notifications triggered by the cloud functions upon data sent to Firestore by the Raspberry Pi running the AI Model.
## How It Works
The Keras model deployed on the Raspberry Pi detects audio and make predictions. It sends the data (`{type: "1"}`) for a Firestore collection (`activities`). The cloud function is then triggered with either sends notification to the mobile devices or does nothing based on the `type`.
```
"1" => Illegal Activity (Chainsaw, etc)
"2" => Human Activities
" " => Irrelevant activity (birds chipping, wind, etc)
```
## Requirements
* Flutter for building the application.
* Google Maps API Key to the Map.
* Tomtom API Key for Map routes.
* Firebase Project for the database and hosting cloud functions.
* Firebase CLI for setting up, testing and deploying the cloud functions (which trigger notifications).
## Set Up (Firebase for Flutter)
1. Follow this to set up Firebase for Flutter. Remember to add your `google-services.json` (for android) and `GoogleService-Info.plist` for (iOS).
2. Replace `android:value` of this meta tag within the ` ` tag inside the `android/app/src/main/AndroidManifest.xml` with your Google Maps API Key.
```xml
```
## Set Up (Cloud Functions)
1. Run `firebase login` to connect your google account with the Firebase CLI. (Be sure to use the same account used for the Firebase Project as they will be sharing the same database)
2. After installing the Firebase CLI, run `firebase init functions` from the project root. Follow the instructions to complete the initialization. (Note: the function script was written in **JavaScript** not TypeScript).
If you get an NPM permission or access denied error, run `cd functions && sudo npm install`.
3. Run `firebase deploy --only functions` to deploy the script to …