Delivered remotely for a business based in Leeds, United Kingdom. Names withheld by agreement.
Project Overview
Digital greetings often fail at the exact moment that matters most: the reveal. When a user sends a gift card accompanied by a personal message, slow webview wrappers, clipped animations, or delayed payment confirmations turn a celebratory gesture into a broken link. We engineered a cross-platform social gifting mobile application using Flutter, designed around tactile envelope-opening choreography, personal voice or video keepsakes, and instant recipient messaging.
Operating from a single Dart codebase targeting both iOS and Android, the platform pairs a high-frame-rate client composer with a strongly consistent backend ledger. Senders can pick an illustrated card template, attach an optional digital voucher funded through native mobile wallets, record a media clip, and schedule delivery down to the recipient's local morning. Once unlocked, the gift transitions smoothly into an ongoing private thread where friends or family can reply without switching apps.
Business Bottleneck
The product vision exposed three engineering hazards common to consumer gifting platforms:
- Visual drift across device tiers: Early web-based greeting prototypes suffered from inconsistent font metrics, audio-video desynchronization, and dropped frames during envelope-opening animations on mid-range Android handsets.
- Payment-to-fulfillment race conditions: If a user closed the app immediately after authorizing Apple Pay or Google Pay, client-triggered fulfillment calls risked either stranding a paid order without a gift link or issuing duplicate voucher codes on retry.
- Unbounded media payloads: Uncompressed smartphone video attachments stalled uploads on commuter networks, leading senders to abandon gifts mid-composition.
Architectural Strategy
To eliminate visual inconsistency without doubling mobile headcount, we committed to Flutter as the sole client framework, isolating platform differences strictly to payment sheets, push permissions, and hardware media codecs. Every greeting card is represented as a declarative JSON manifest referencing vector animation layers, safe text bounding boxes, and color palettes rather than baked video files.
On the server side, we separated financial truth from conversational responsiveness. A Node.js orchestration service backed by PostgreSQL acts as the authoritative state machine for drafts, Stripe PaymentIntents, voucher allocations, and scheduled release timestamps. Cloud Firestore handles real-time thank-you chat threads and delivery read states once a gift becomes active.
Core Capabilities
- Layered Greeting Composer: Senders customize typography, color themes, and sticker accents over vector animations rendered at native refresh rates, previewing the exact recipient unwrap experience before checkout.
- Time-Locked Delivery Scheduling: Gifts can be dispatched immediately or queued for a future date and hour anchored to the recipient's timezone, with sender reminders prior to release.
- Digital Voucher Attachment: Senders attach merchant-backed gift balances via native wallet checkout, generating single-use redemption tokens revealed only after the card is unwrapped.
- Deferred Deep-Link Onboarding: Recipients who do not yet have the app tap a signed gift URL that routes through app-store installation while preserving the gift token for automatic retrieval on first launch.
- Embedded Keepsake Messaging: Each delivered gift spawns a dedicated thread supporting text, emoji reactions, and compressed media replies, plus moderation reporting hooks for trust-and-safety review.
Technical Architecture
The mobile client separates presentation widgets from Riverpod state controllers and platform channels, ensuring animation ticks never wait on network I/O. Heavy assets such as card vector bundles are cached locally on first fetch and verified by content hash so repeat previews open instantaneously.
Flow: Composer draft -> Signed media upload to object storage -> Stripe PaymentIntent authorization -> Verified webhook updates PostgreSQL ledger -> Scheduler releases gift at target UTC instant -> Push notification & deep link launch Flutter unwrap view -> Firestore thread opens for replies.
Every mutation crossing from the mobile app to the backend carries a client-generated UUID idempotency key. If a flaky train connection forces a retry during draft finalization or voucher reservation, the API returns the original committed state rather than creating duplicate gift records.
Technology Stack
| Category | Technology detail |
|---|---|
| Mobile framework | Flutter with a shared Dart codebase for iOS and Android |
| State management | Riverpod with immutable state containers and async notifiers |
| Card rendering & animation | Lottie vector animations layered with Flutter CustomPainter and Rive transitions |
| Media capture & processing | Native camera/audio plugins with client-side video transcoding before upload |
| Backend orchestration | Node.js and TypeScript REST API with webhook event workers |
| Transactional ledger | PostgreSQL enforcing idempotent payment and voucher state transitions |
| Real-time messaging | Cloud Firestore threads synchronized with optimistic local writes |
| Payments | Stripe PaymentIntents with Apple Pay and Google Pay sheet integration |
| Push & deep linking | Firebase Cloud Messaging paired with Universal Links and App Links |
| Observability | Firebase Crashlytics, structured webhook logs, and delivery dead-letter queues |
Engineering Trade-offs & Solutions
| Architectural Dilemma | Chosen Solution & Rationale |
|---|---|
| Declarative card manifests vs. server-rendered video cards | Shipped lightweight vector/Lottie manifests rendered client-side in Flutter, keeping card downloads tiny and allowing interactive tap-to-open gestures that static video cannot support. |
| Client-side fulfillment trigger vs. webhook-driven state machine | Restricted voucher allocation and gift activation strictly to verified Stripe webhooks inside a PostgreSQL transaction, eliminating orphaned payments when users background the app mid-checkout. |
| Single NoSQL backend vs. dual PostgreSQL + Firestore store | Kept monetary ledgers and unique voucher constraints in PostgreSQL while delegating live chat listeners to Firestore, playing to each engine's strengths without custom socket scaling. |
| Full-resolution video uploads vs. on-device transcoding | Enforced bounded client-side H.264 compression prior to signed-URL upload, trading a brief local encoding step for reliable completion on weak mobile links. |
Security & Reliability
Gift URLs rely on high-entropy, non-sequential tokens paired with server-side claim verification so enumerating links cannot expose private greetings or unredeemed voucher codes. Voucher redemption credentials remain encrypted at rest and are decrypted only after the recipient authenticates and completes the claim endpoint.
Webhook consumers validate cryptographic signatures on every inbound Stripe and voucher-provider callback before processing. Failed downstream notifications—such as transient Firebase push errors or email relay timeouts—land in a retry queue with exponential backoff and dead-letter alerting so operations staff can inspect and replay stuck deliveries cleanly.
Media uploaded by senders passes through asynchronous content-moderation scanning and MIME-type validation on object storage ingestion. Recipients can block senders or report abusive threads directly from the unwrap view, immediately hiding offensive attachments while preserving audit snapshots for moderators.
Performance & Scale
Greeting card packs are distributed via CDN with immutable cache headers keyed by template version, preventing repeated downloads when users browse the catalog. Inside Flutter, image and Lottie composition pre-warming occurs lazily while the user scrolls the feed, avoiding frame drops during swipe transitions.
During seasonal gifting peaks—such as winter holidays or cultural celebration mornings—scheduled gift releases can spike concurrently. The release dispatcher partitions pending UTC delivery windows across idempotent worker leases and batches push payloads through Firebase Cloud Messaging, keeping database lock contention flat even when thousands of scheduled cards unlock within the same minute.
Operational Outcomes
Consolidating iOS and Android delivery into Flutter eliminated cross-platform UI regressions and allowed new card formats and seasonal themes to reach all users simultaneously. Separating transactional settlement from real-time messaging gave the product team a resilient financial audit trail alongside responsive social chat, turning one-off digital vouchers into durable, shareable keepsakes that work reliably across fluctuating mobile networks.