{"id":27646325,"url":"https://github.com/paishanmadusha/firebase-ml-text-recognition-app","last_synced_at":"2026-05-01T16:34:45.199Z","repository":{"id":288899813,"uuid":"964678883","full_name":"PAIshanMadusha/firebase-ml-text-recognition-app","owner":"PAIshanMadusha","description":"Text Recognition is a Flutter application that uses Firebase ML Kit to recognize and extract text from images. Users can capture or upload images to extract text using machine learning. Additionally, a premium feature enabled via Stripe-powered subscription payments allows users to view their previous text captures.","archived":false,"fork":false,"pushed_at":"2025-04-20T09:32:26.000Z","size":337,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T01:18:12.401Z","etag":null,"topics":["anonymous","dart","firebase","firebase-storage","firestore","flutter","flutter-dotenv","http","image-picker","machine-learning","payment-gateway","premium","provider","stripe","stripe-api","stripe-payments"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PAIshanMadusha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-11T15:53:20.000Z","updated_at":"2025-04-20T09:32:29.000Z","dependencies_parsed_at":"2025-04-22T01:00:55.271Z","dependency_job_id":null,"html_url":"https://github.com/PAIshanMadusha/firebase-ml-text-recognition-app","commit_stats":null,"previous_names":["paishanmadusha/firebase-ml-text-recognition-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PAIshanMadusha/firebase-ml-text-recognition-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIshanMadusha%2Ffirebase-ml-text-recognition-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIshanMadusha%2Ffirebase-ml-text-recognition-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIshanMadusha%2Ffirebase-ml-text-recognition-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIshanMadusha%2Ffirebase-ml-text-recognition-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PAIshanMadusha","download_url":"https://codeload.github.com/PAIshanMadusha/firebase-ml-text-recognition-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PAIshanMadusha%2Ffirebase-ml-text-recognition-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32505106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anonymous","dart","firebase","firebase-storage","firestore","flutter","flutter-dotenv","http","image-picker","machine-learning","payment-gateway","premium","provider","stripe","stripe-api","stripe-payments"],"created_at":"2025-04-24T01:18:11.513Z","updated_at":"2026-05-01T16:34:45.193Z","avatar_url":"https://github.com/PAIshanMadusha.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 Firebase ML Text Recognition App\n\nA Flutter application that uses **Firebase Machine Learning Kit** for **text recognition** from images. Users can capture or upload images through the app to extract text using Firebase ML Kit. Additionally, a **premium feature** allows users to view their previously captured text, enabled via **Stripe-powered subscription payments**.\n\n---\n\n## ✨ Features:\n\n### 📸 Text Recognition:\n- Select an image from the gallery or take a new photo.\n- Detect and extract text using Google Machine Learning Kit's Text Recognition.\n- Copy captured text to the clipboard easily.\n\n### 📝 Captured History (Premium):\n- Premium users can view previously captured text alongside images.\n- Each user's data is stored privately using Firebase.\n\n### 💳 Stripe Integration:\n- Monthly recurring subscriptions using the **Stripe API**.\n- Users can upgrade to premium and unlock additional features.\n\n### 👤 Anonymous Authentication:\n- Firebase Auth is used to generate a unique anonymous user ID.\n- User data (including captures) are stored per user in Firestore.\n\n### 🔐 Secure Storage:\n- Images stored in **Firebase Storage**.\n- Captured text stored in **Cloud Firestore** linked to user IDs.\n\n### 🎨 UI Enhancements:\n- Splash screen animation using **Lottie**.\n- Clean UI design with **Google Fonts** and **SVG assets**.\n\n### 📡 Stripe API Endpoints Used:\n\nThe following [Stripe API](https://docs.stripe.com/api) endpoints were used to implement subscription-based payments:\n\n| Purpose                                            | Endpoint                                                            |\n|----------------------------------------------------|---------------------------------------------------------------------|\n| ✅ Create a new customer on Stripe                 | `https://api.stripe.com/v1/customers`                              |\n| ✅ Prepare to collect payment details              | `https://api.stripe.com/v1/setup_intents`                          |\n| ✅ Attach a payment method to a specific customer  | `https://api.stripe.com/v1/customers/[customerId]/payment_methods` |\n| ✅ Create a subscription for a customer            | `https://api.stripe.com/v1/subscriptions`                          |\n\n---\n\n## 🛠️ Technologies Used:\nThe following core technologies are used in this project:\n\n- **Flutter** : UI toolkit for building natively compiled applications for mobile.\n- **Dart** : Programming language used with Flutter.\n- **Firebase ML Kit** : For on-device text recognition (Optical Character Recognition (OCR)).\n- **Firebase Authentication** : Anonymous authentication to track user data securely.\n- **Cloud Firestore** : NoSQL cloud database to store captured text and metadata.\n- **Firebase Storage** : To store captured images securely.\n- **Stripe API** : Handles payment processing and subscriptions.\n\n---\n\n## 🛠 Dependencies:\nThe following technologies are used in this project:\n\n| Package                        | Description                                      |\n|--------------------------------|--------------------------------------------------|\n| firebase_core                  | Firebase core initialization                     |\n| firebase_auth                  | Anonymous authentication                         |\n| firebase_storage               | Store captured images                            |\n| cloud_firestore                | Store captured text and metadata                 |\n| image_picker                   | Pick images from gallery or camera               |\n| google_mlkit_text_recognition  | ML text recognition from images                  |\n| google_fonts                   | Custom fonts integration                         |\n| flutter_stripe                 | Stripe API integration for subscription handling |\n| flutter_dotenv                 | Load environment variables (e.g., API keys)      |\n| http                           | HTTP client for Stripe API requests              |\n| provider                       | State management (e.g., premium status)          |\n| flutter_svg                    | SVG image rendering                              |\n| lottie                         | Splash screen animation                          |\n\n---\n\n## 🚀 How to Run the Project:\n1. Clone the repository:\n\n```sh\nhttps://github.com/PAIshanMadusha/firebase-ml-text-recognition-app.git\n```\n2. Navigate to the project directory:\n\n```sh\ncd firebase-ml-text-recognition-app\n```\n3. Install dependencies:\n\n```sh\nflutter pub get\n```\n## 📥 Set up Firebase:\n   \n### 📝 To use Firebase services in this project, follow these steps:\n\n- Create a Firebase project at [Firebase Console](https://console.firebase.google.com/).\n- After creating your Firebase project, you need to configure the following services, Go to the **Build** section in Firebase and:\n- Enable [**Authentication**](https://github.com/PAIshanMadusha/basic-firebase-authentication.git) → **Sign-in method** → **Anonymous**.\n- Enable **Cloud Firestore** (start in **test mode** for development).\n- Enable **Firebase Storage** (also start in **test mode**).\n- Enable **Machine Learning** → **Text Recognition**.\n- Then, connect your Flutter project to Firebase.\n- For this project, I used the FlutterFire CLI to do that. You should follow the same process to avoid errors.\n  \n### ⚠️ Not familiar with the FlutterFire CLI?\n\n- I’ve written a detailed [Medium](https://medium.com/@ishanmadusha) article explaining the step-by-step process to connect Firebase to Flutter using the CLI with screenshots to guide \n  you through it. **📖 Read my article on Medium here:** [Link](https://medium.com/@ishanmadusha/using-firebase-cli-to-easily-connect-firebase-with-your-flutter-app-927e0021bc44)\n- So, follow the above steps and add Firebase to your Flutter project using the FlutterFire CLI.\n\n## 💳 Configure Stripe:\n\nTo enable premium features in the app, Stripe is used to handle subscription payments. Follow these steps to configure Stripe:\n\n### 🔧 Create a Stripe Account:\n- Go to [Stripe](https://stripe.com/) and create an account if you don't have one, and select test mode.\n\n### 🔐 Get Your Stripe API Keys:\n- Navigate to your Stripe Dashboard → **Developers → API Keys**\n- Copy your **Publishable key** and **Secret key**\n\n### ⚙️ Set Up Environment Variables:\n- Create a `.env` file in the root directory of your Flutter project.\n- Add your Stripe keys:\n```env\nSECRET_KEY = \"[Your-Secret-Key]\"\nPUBLISHABLE_KEY =\"[Your-Publishable-Key]\"\n```\n- Replace `[Your-...-Keys]` with your actual API keys from Stripe.\n\n### ⚠️ Important:\n\n- The `priceId` used in this project (`price_1REmVySHefmHhg9lhKnukC5O`) is specific to the original developer’s Stripe account.  \n- It appears in the following file and lines:\n  - `\\lib\\services\\stripe\\stripe_service.dart` → **Line 58** and **Line 136**\n- If you're cloning or reusing this project, **you must create your own Stripe product and price**, and **replace this ID** with your own.\n\n### 🛠️ How to Create Your Own Stripe Price ID:\n\n- Go to your Stripe Dashboard.\n- On the left sidebar, click **Product Catalog**.\n- Click **+ Add product**.\n- Fill in the **required product details** (name, description, etc.).\n- Under **Pricing**, choose **Recurring** and set your amount and interval (e.g., monthly).\n- Click **Add product** to save.\n- After the product is created, click on it to view the **Price ID**.\n- Copy the Price ID and replace the hardcoded one at **Line 58** and **Line 136** in `stripe_service.dart`.\n\n### ✅ Now you can run the app. Make sure there are no errors:\n   ```bash\n   flutter run\n   ```\n\n## 📸 System Screenshots:\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/5af38ec8-764a-410e-bbac-92e59dd6477e\" alt=\"Screenshot 1\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://github.com/user-attachments/assets/d535eed7-cffb-403a-8ee6-cfc66e302f9e\" alt=\"Screenshot 2\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://github.com/user-attachments/assets/051a3eb8-13ed-470f-99b2-489303330a57\" alt=\"Screenshot 3\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n\u003cbr\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/5123989a-0ee1-4a34-a22d-da96db9fdd9e\" alt=\"Screenshot 1\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://github.com/user-attachments/assets/6eecb4a8-588b-4d4e-b794-22bbc9237905\" alt=\"Screenshot 2\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://github.com/user-attachments/assets/b0b1a0b5-fd79-438f-97a1-b8c424f4583e\" alt=\"Screenshot 3\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"https://github.com/user-attachments/assets/a076e324-7d0f-4e0e-bf07-1f4410a4c8d3\" alt=\"Screenshot 4\" width=\"175\"\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n\n---\n\n## 👤 About This Project:\n\nA Flutter app that uses Firebase ML Kit to extract text from images, with a premium feature (via Stripe subscription) to view captured history, built to enhance my Flutter and Firebase skills.\n\n### 👨‍💻 Created by: \n**Ishan Madhusha**  \nGitHub: [PAIshanMadusha](https://github.com/PAIshanMadusha)\n\nFeel free to explore my work and get in touch if you'd like to collaborate! 🚀\n\n---\n\n## 📝 License:  \nThis project is open-source and available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaishanmadusha%2Ffirebase-ml-text-recognition-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaishanmadusha%2Ffirebase-ml-text-recognition-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaishanmadusha%2Ffirebase-ml-text-recognition-app/lists"}