Mobile commerce / fintech
Live Commerce Marketplace
Solo-built a production Flutter marketplace with real-time live streaming, auction bidding, and a full financial ledger — from buyer checkout through seller settlement and payout — for a regional e-commerce client.
Context
A regional e-commerce client needed a social commerce platform where sellers could list products, stream live shows, run real-time auctions, and receive wallet-based settlements — all in one app. No existing codebase existed. The product needed to reach production on both iOS and Android with a matching web client.
Constraints
- The entire product — mobile app, backend, and web version — had to be built and shipped by one engineer.
- Financial flows (top-up, checkout, settlement, payout, reversal) required correctness guarantees that a typical CRUD approach could not provide.
- Live streaming and auction state had to stay consistent across hundreds of concurrent mobile clients without a dedicated real-time backend.
- The app needed Arabic and English support with multi-environment release flavors from day one.
Approach
I designed a feature-first Flutter architecture with Riverpod state management, typed Supabase repositories, and AutoRoute navigation guards. Financial flows were modeled as an explicit ledger with processing → settlement → payout lifecycle, implemented in TypeScript Edge Functions. Live streaming used Agora RTC for video with Supabase Realtime channels for auction state synchronization across viewers.
Key decisions
- Chose Supabase as the backend platform to own auth, Postgres schema, RLS policies, storage, and edge functions from one place — avoiding a separate backend service that one engineer could not maintain.
- Modeled wallet transactions as an append-only ledger rather than balance mutations, so reversals and audits stayed clean without touching settled records.
- Kept auction bid state in Supabase Realtime rather than Agora data channels, so auction logic remained server-authoritative and auditable.
Tradeoffs and risks
- Accepted Supabase Realtime latency (~100–200ms) for auction bids instead of a lower-latency custom WebSocket server, trading absolute speed for operational simplicity on a solo build.
- Deferred automated test coverage (9 test files in ~149k LoC) to hit the launch deadline, with the plan to add coverage to the settlement and reversal paths post-launch.
- Used Supabase Edge Functions for all financial logic despite cold-start constraints, to avoid managing a separate Node.js service.
Outcomes
- Shipped a full production Flutter app (~149k lines of hand-written code, 1,015 files under lib/) on iOS and Android within 6 months as a solo engineer.
- Shipped a parallel Next.js web version of the same platform.
- Financial ledger handled buyer payments, seller settlement cron, referral commissions, and transaction reversals without data integrity issues in production.
- Live streaming and real-time auction flows ran stably across concurrent viewers using Agora RTC + Supabase Realtime.
Artifacts
Architecture overview
Feature-first module structure, data flow, and Supabase integration patterns.
Available on requestPayment lifecycle doc
Ledger model covering buyer checkout, seller settlement, payout, and reversal flows.
Available on requestAuction streaming architecture
Agora RTC + Supabase Realtime coordination model for live auction state.
Available on requestTechnology