ArponStore: Crafting a Next-Generation Flutter & Firebase E-Commerce Ecosystem

Introduction In today’s hyper-competitive digital marketplace, a successful e-commerce platform must deliver not only a smooth shopping experience but also robust administration tools for vendors and administrators. ArponStore is an ambitious project designed to showcase how Flutter and Firebase can work together to create a fully-featured, scalable, and secure e-commerce ecosystem. This article dives into every architectural decision, implementation detail, and code snippet that makes ArponStore tick.
Why Flutter + Firebase? Flutter: Unified, High-Performance UI Single Codebase for Mobile, Web, and Desktop Flutter’s “write once, run anywhere” philosophy matters when you want to reach Android, iOS, and web users simultaneously without maintaining multiple codebases. Under the hood, Flutter’s rendering engine (Skia) paints every pixel, ensuring consistent visuals across platforms.
Expressive Widgets & Hot Reload Flutter’s widget hierarchy allows you to compose complex UIs from simple building blocks. With hot reload, you can tweak UI layouts or business logic and see changes instantly—accelerating development cycles and debugging.
High FPS & Custom Animations By default, Flutter renders at 60+ FPS (or even 120 FPS on compatible devices). Custom animations (using AnimationController, Tween, and packages like rive) give ArponStore a polished, engaging feel that sets it apart.
Firebase: Scalable, Serverless Backend Authentication Firebase Authentication supports email/password, Google Sign-In, phone-based auth, and more. Out-of-the-box user management with token-based sessions reduces boilerplate and enhances security.
Cloud Firestore A NoSQL document database with real-time listeners provides instant UI updates whenever data changes. Offline persistence is automatic—customers can browse previously loaded products even if connectivity drops.
Cloud Storage Product images, user avatars, and receipt PDFs are stored in Firebase Cloud Storage. With built-in rules for image size and format validation, you don’t need a separate media server.
Cloud Functions Firebase Cloud Functions serve as a serverless backend layer. They handle payment webhooks (e.g., Stripe), send push notifications on order status changes, and perform scheduled tasks like cleaning up old carts.
🌟 Key Features of ArponStore ArponStore isn’t just another shopping app—it’s a complete ecosystem comprising three separate but interconnected applications.
- Customer App Browse Products
Dynamic Product Listings: Firestore snapshot listeners update the product grid in real time whenever a vendor adds, edits, or removes items.
Advanced Search & Filters: Full-text search using Firestore indexing plus category, price range, and rating filters.
Detailed Product Views: High-resolution images loaded from Cloud Storage, product descriptions, user reviews, and related items carousel.
Cart & Order Management
Synchronized Carts: Cart contents stored in both local storage (Hive) and Firestore. If a user logs in from a second device, their cart stays in sync.
Secure Checkout: Stripe integration via Cloud Functions. When the customer confirms payment, a Cloud Function verifies the transaction, creates an order document, and decrements inventory.
Live Order Tracking: Order status (e.g., “Processing,” “Shipped,” “Out for Delivery,” “Delivered”) stored as a Firestore field. A listener updates the UI in real time.
Wishlist & Profile
Favorites: Users can add products to their wishlist. Wishlists live in a “wishlists” subcollection under each user in Firestore.
User Profile: Users can update name, email, profile picture (stored in Cloud Storage), addresses, and saved payment methods. Biometric login (Fingerprint/Face ID) is enabled via local secure storage.
Responsive Design
Designed with Flutter’s adaptive widgets (LayoutBuilder, MediaQuery) to ensure a smooth experience on phones, tablets, and web browsers.
Breakpoints adjust grid columns: 2 columns on narrow screens, 4–5 columns on tablets/desktops.
- Vendor Portal Role-Based Access Control
Each vendor has a unique UID in the “vendors” collection. Firestore security rules allow only documents where vendorId == currentUserId to be modified or read.
Vendors sign in through the same Firebase Auth but see a different landing screen—one that lists their inventory instead of the product catalog.
Inventory Management
Add/Edit Products: Vendors upload images to Cloud Storage. A Cloud Function generates optimized thumbnails (200×200, 400×400) and stores URLs in Firestore.
Stock Threshold Alerts: If inventory for any product falls below a threshold (configurable per vendor), a Cloud Function triggers an email/SMS notification via Twilio.
Sales & Analytics
Vendors see a dashboard built with charts (Recharts inside a React-based admin portal) showing sales trends, top-selling items, and geographic breakdowns.
Data for analytics is aggregated nightly by a scheduled Cloud Function that writes summary documents to a “vendor-analytics” collection.
Instant Notifications
When an order is placed, a Cloud Function sends a FCM push notification to the vendor’s device with order details. The vendor can then “Accept” or “Reject” the order, triggering state changes that the customer sees in real time.
- Admin Panel Secure Dashboard
Built with Flutter Web and protected by an additional layer of Firebase Custom Claims. Admins must have customClaim: “admin” in their ID token.
Two-factor authentication is enforced via email OTP.
Product & Order Oversight
Full CRUD on every product in the marketplace, across all vendors. Admins can remove products that violate policies.
Order management queue: Admins can reroute orders to different vendors if stock shortages occur.
User Management
View all registered customers and vendors.
Ban/Unban accounts, reset passwords, or grant temporary “vendor” privileges to existing customers.
Rich Analytics & Reporting
A dedicated analytics screen built with Recharts shows total GMV (Gross Merchandise Value), daily active users (DAU), monthly revenue, and other KPIs.
CSV export of sales data uses a Cloud Function that queries Firestore, compiles a CSV, saves it to Cloud Storage, and returns a downloadable URL.
Content Moderation
AI-powered moderation: A Cloud Function uses Google Cloud Vision’s SafeSearch API to detect inappropriate product images. Flagged items are queued for human review.
🏗️ Architectural & Technical Highlights State Management: BLoC + Riverpod Customer App
BLoC for authentication flow, cart operations, and order placement. Each BLoC streams state changes to UI widgets.
Riverpod for global services: Firestore repositories, local Hive box instances, and network connectivity listeners.
Vendor Portal & Admin Panel
Riverpod exclusively. Providers expose Firestore queries (e.g., a StreamProvider for vendor products), configuration settings, and utility classes for cloud functions.
Splitting UI logic from business logic: UI widgets only watch providers, no direct Firestore calls in the view code.
Offline Support with Hive Why Hive?
Lightweight, pure Dart key-value database.
Fast reads/writes—ideal for caching product lists and cart items.
No native dependencies, so it works smoothly on Flutter Web as well.
Implementation
On app startup, check for connectivity using the connectivity_plus package. If offline, load productsCacheBox.get(“allProducts”) and display cached data.
When online, fetch from Firestore and overwrite productsCacheBox.put(“allProducts”, fetchedList) so the cache stays fresh.
Real-Time Sync with Firestore Listeners Snapshot Listeners
In the customer app, the product grid widget subscribes to productsCollection.orderBy(“createdAt”, descending: true).snapshots(). UI rebuilds whenever a product is added, updated, or deleted.
In the vendor portal, vendor-specific queries filter by vendorId, so each vendor only sees their own inventory in real time.
Batch Writes & Transactions
Checkout: A Cloud Function triggers a Firestore transaction to decrement stock counts for each line item. If any item’s quantity falls below zero, the transaction aborts and the customer sees an “Out of Stock” error.
Serverless Logic with Cloud Functions Payment Processing
A onCall function named createPaymentIntent receives cart details and total amount. It calls Stripe’s API to generate a payment intent, returns the client secret to the app.
An onFinalizeOrder function triggers after Firestore writes an “orders” document. It verifies payment status, sends confirmation emails (via SendGrid), and updates vendor dashboard metrics.
Notification Workflows
FCM Push: When order.status changes to “Shipped,” a onUpdate Cloud Function sends a push notification to the customer’s device token stored in Firestore.
Email Alerts: If a vendor’s product stock falls below a threshold, inventoryWatcher (a scheduled Cloud Function) queries all products, filters low-stock items, and emails the vendor via Nodemailer.
CI/CD Pipeline with GitHub Actions & Firebase Hosting Continuous Integration
On every PR to main, GitHub Actions runs flutter analyze, flutter test, and builds APK/IPA artifacts.
Linting rules enforce naming conventions: BLoC classes end with Bloc, providers end with Provider, and each widget file has a corresponding test file.
Continuous Deployment
Merges to main trigger a deployment job:
Build Flutter Web (flutter build web --release).
Deploy Web build to Firebase Hosting (firebase deploy --only hosting).
Package mobile apps using codemagic.yaml integration to produce signed APK and IPA, then upload to internal distribution channels.
🛠️ Getting Started If you’re interested in building your own e-commerce platform or contributing to ArponStore, follow these steps:
Clone the Repository
bash Copy Edit git clone https://github.com/akhlak007/arpon_store.git cd arpon_store Install Dependencies
bash Copy Edit flutter pub get Configure Firebase
Add google-services.json (Android) and/or GoogleService-Info.plist (iOS) to the respective platform folders.
In the Firebase Console:
Enable Authentication (Email/Google/Phone).
Create Firestore database in “Production Mode.”
Enable Cloud Storage and set up security rules.
Deploy initial Cloud Functions (firebase deploy --only functions).
Generate firebase_options.dart using the FlutterFire CLI:
bash Copy Edit flutterfire configure Set Up Payments
Sign up for a Stripe account.
Retrieve your Publishable Key and Secret Key.
In lib/config/stripe_config.dart, set:
dart Copy Edit const String stripePublishableKey = "pk_test_XXXXXXXXXXXX"; const String stripeSecretKey = "sk_test_XXXXXXXXXXXX"; (Optional) Use environment variables for extra security:
bash Copy Edit export STRIPE_PUBLISHABLE_KEY="pk_test_XXXXXXXXXXXX" export STRIPE_SECRET_KEY="sk_test_XXXXXXXXXXXX" Run the App
iOS/Android
bash Copy Edit flutter run Web
bash Copy Edit flutter run -d chrome Vendor & Admin Setup
In the Firebase Console, manually create user accounts with customClaims: { role: "vendor" } or role: "admin".
Alternatively, register a normal user and use a Cloud Function to assign roles programmatically:
js Copy Edit // Example Node.js Cloud Function exports.assignVendorRole = functions.https.onCall(async (data, context) => { const uid = data.uid; await admin.auth().setCustomUserClaims(uid, { role: "vendor" }); return { message: "Vendor role assigned." }; }); Log in with the vendor or admin account in the corresponding Flutter app variant.
✨ What Sets ArponStore Apart? End-to-End Solution
Customers, vendors, and admins each have dedicated interfaces tailored to their workflows. No one-size-fits-all “admin” checklist—each portal is purpose-built.
Modern Stack
Built with Flutter 3.x, Dart null-safety, Riverpod 2.x/BLoC 8.x, and Firebase v9+. Takes full advantage of the latest improvements in developer productivity and performance.
Scalable & Secure
Real-time data sync ensures that every user sees the freshest inventory, order status, and analytics.
Firestore security rules enforce granular access: customers can only read public product data, vendors can only manage their own inventory, and admins have global oversight.
Offline-First Experience
With Hive caching, users can browse products even when on unreliable networks. Any cart updates made offline sync automatically when connectivity returns.
Open Source & Extensible
The entire codebase is hosted on GitHub under an MIT license.
Modular architecture means you can swap out payment providers, integrate new third-party services, or re-theme the UI with minimal effort.
🎯 Final Thoughts Building a successful e-commerce platform today is about more than just listing products—it’s about delivering a cohesive, engaging, and trustworthy experience for everyone involved. ArponStore demonstrates how Flutter and Firebase can empower developers to bring this vision to life, whether you’re launching a startup, building a portfolio project, or learning modern app architecture.
Customers appreciate real-time inventory, smooth navigation, and secure payments.
Vendors benefit from instant order notifications, transparent analytics, and simple inventory controls.
Admins gain a birds-eye view of platform health, user management tools, and content moderation capabilities.
👉 Try It Yourself Live Demo: arponstore-92938.web.app Explore the full shopping experience right in your browser or on your phone.
Source Code: github.com/akhlak007/arpon_store Dive into the code, learn from the architecture, or contribute your own features!
If you have feedback, questions, or want to collaborate, feel free to open an issue on GitHub or reach out via a pull request. Happy coding and happy shopping!
Subscribe to my newsletter
Read articles from MD AKHLAK UD JAMAN directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
