Rooster is the ultimate solution for developers seeking complete control over their crash monitoring and response infrastructure. Built on the power of Firebase Crashlytics Firebase Cloud Functions and FCM Rooster empowers you to proactively address critical crashes and minimize user impact.
Key Features
-
Self-Hosted Firebase Functions: Take full ownership of your crash data and infrastructure by self-hosting Firebase Functions.
-
Real-time Crash and Velocity Tracking: Instantly detect fatal crashes and monitor crash velocity across your Android and iOS apps using Firebase Crashlytics.
-
VoIP Call Notifications via FCM: On-call personnel receive immediate VoIP call notifications triggered by FCM, ensuring swift response to critical issues.
-
Detailed Crash Insights: Access comprehensive crash details from Firebase Crashlytics, including stack traces, device information, and user context, to quickly identify and resolve the root cause.
-
On-Call User Management: Admins can easily add, remove, and manage on-call users, enabling and disabling their on-call status as needed for efficient issue resolution.
-
Customizable Android and iOS Apps: Generate your own branded mobile apps powered by Firebase Cloud Functions and FCM, providing a seamless crash response experience.
Benefits
-
Enhanced Data Privacy and Security: Maintain complete control over your crash data with self-hosting.
-
Faster Response Times: VoIP call notifications ensure immediate attention to critical crashes.
-
Improved App Stability: Proactively address crashes and minimize user disruption.
-
Flexible Deployment: Self-host on your preferred infrastructure or leverage Firebase's scalable cloud platform.
Ideal for
-
Mobile App Developers: Seeking a robust and customizable crash monitoring solution.
-
Enterprises with Strict Data Compliance Requirements: Requiring full control over sensitive crash data.
-
DevOps and SRE Teams: Focused on optimizing app performance and minimizing downtime.
This guide outlines the installation process on an existing Flutter project named "Rooster," utilizing Firebase for crash monitoring and user management.
Prerequisites
-
Existing Rooster Project: You have a Flutter project named "Rooster" with a working codebase.
-
Firebase CLI: Install the Firebase CLI globally using npm install -g firebase-tools.
-
FlutterFire CLI: Install the FlutterFire CLI globally using dart pub global activate flutterfire_cli.
-
Firebase Account: Ensure you're logged into the correct Firebase account using firebase login.
Steps
1. Create a New Firebase Project
-
In the Firebase console (https://console.firebase.google.com/), create a new Firebase project specifically for Rooster Pro. Let's call it "Rooster-Project".
2. Configure Firebase for Android (Mostly auto created using firebase cli)
-
In the Firebase console, navigate to your "Rooster-Project".
-
Click "Add app" and select Android.
-
Provide your Android package name (e.g., com.applogics.rooster).
-
Download the google-services.json file.
-
Place this file in the android/app directory of your Rooster project.
3. Configure Firebase for iOS (Mostly auto created using firebase cli)
-
In the Firebase console, click "Add app" and select iOS.
-
Provide your iOS bundle ID (e.g., com.applogics.rooster).
-
Download the GoogleService-Info.plist file.
-
Open your Rooster project in Xcode.
-
Drag and drop the GoogleService-Info.plist file into the Runner folder in Xcode.
4. Configure FlutterFire CLI
-
Open a terminal in your Rooster project directory.
-
Run flutterfire configure to link your Flutter project to the new "Rooster-Project".
-
Select the Firebase features you need (e.g., Crashlytics, FCM, Realtime Database) for both Android and iOS.
-
This will update your firebase_options.dart file.
5. Update Firebase Dependencies
-
In your pubspec.yaml, ensure you have the latest versions of:
firebase_core: ^2.14.0
firebase_crashlytics: ^3.2.0
firebase_messaging: ^14.6.5
firebase_database: ^10.2.0
-
Run flutter pub get to update dependencies.
6. Create Users Table in Realtime Database
-
In the Firebase console, navigate to Realtime Database.
-
Create a new table named "users".
-
Add an admin user with the following structure: use admin@example.com to login in to android or iso app. Post add other users using add users screen.
{
"adminUser": {
"email": "admin@example.com",
"name": "Admin User",
"platform": "android",
"deviceInfoRef": "",
"isOnCall": true,
"isAdmin": true,
"createdAt": {".sv": "timestamp"},
"modifiedAt": {".sv": "timestamp"}
}
}
7. Set Up Firebase Cloud Functions
-
Initialize Firebase Functions: In your Rooster project directory, run firebase init functions.
-
Select Project: Choose the "Rooster-Project" you created earlier.
-
Choose Language: TypeScript for your Cloud Functions.
-
Install Dependencies: Navigate to the functions directory and run npm install.
-
Write Cloud Functions: Implement the necessary Cloud Functions to handle crash data processing and FCM notification triggering. Refer to the Firebase documentation for guidance.
8. Deploy Cloud Functions
-
Deploy to Firebase: In the functions directory, run firebase deploy --only functions to deploy your Cloud Functions to Firebase.
9. Deploy Cloud Functions Locally (for Testing)
-
In the functions directory, run firebase emulators:start to start the local emulator suite.
-
Your Cloud Functions will now be available locally.
-
Update your Rooster app to use the local emulator endpoints for testing (refer to Firebase documentation for instructions).
10. Test Cloud Functions
-
Trigger crash events in your Android app (or simulate them).
-
Observe the logs in the emulator suite to verify that your Cloud Functions are triggered and working as expected.
Additional Steps
-
VoIP and UI Implementation: Open the flutter_callkit_incoming, https://pub.dev/packages/flutter_callkit_incoming and follow the steps.
By following these steps, you can set up Rooster project, leveraging Firebase Cloud Functions, Crashlytics, and FCM for crash monitoring and response.
-
https://docs.flutterflow.io/integrations/firebase/connect-to-firebase
-
https://codewithandrea.com/articles/flutter-firebase-flutterfire-cli/
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
-
Fork the Project
-
Create your Feature Branch (git checkout -b feature/AmazingFeature)
-
Commit your Changes (git commit -m 'Add some AmazingFeature')
-
Push to the Branch (git push origin feature/AmazingFeature)
-
Open a Pull Request
Technologies used in the project:
- Dart
- Flutter
- Firebase cloud functions
- Firebase realtime database
- TypeScript
- Node.js