App Store
iOS
Android

Fanshop

FlutterBLoCNestJSMongoDBStripeSumsubShipEngineAfterShipVertexFirebaseGoogle Cloud FunctionsPuppeteer
Fanshop

Fanshop is an e-commerce platform built for influencers — letting them sell branded merchandise directly to their audiences on iOS and Android.

The platform had to solve three hard problems simultaneously: payments that work across borders, shipping that integrates with multiple carriers, and tax compliance for EU and US orders. Each of these is a full product problem on its own.

Payments run through Stripe, including multi-vendor payouts so influencer sellers receive their earnings automatically. KYC verification via Sumsub ensures seller identity compliance before payouts are enabled. Shipping uses ShipEngine for label creation and rate shopping across carriers, with AfterShip handling post-purchase tracking notifications. Tax calculation runs through Vertex/Taxamo, applying the correct VAT or sales tax based on the buyer’s jurisdiction.

Three Firebase Cloud Functions extend the backend without bloating the main API: one generates Sumsub KYC tokens, one renders invoice PDFs via headless Chrome, and one removes product photo backgrounds using ML — keeping the main NestJS service focused on business logic.

Highlights

  • Full Stripe payment flows including multi-vendor payouts for influencer sellers
  • KYC identity verification via Sumsub — serverless Cloud Function bridge
  • Multi-carrier shipping with ShipEngine (label creation, rate calculation) and AfterShip (tracking)
  • EU/US tax compliance via Vertex/Taxamo for cross-border order routing
  • AI-powered background removal for product photos via ImgLy ML Cloud Function
  • Automated PDF invoice generation via headless Chrome (Puppeteer) Cloud Function
Technical details

Architecture

Flutter app (iOS + Android) with multi-flavor builds (prod/staging/dev) communicating with a NestJS REST API. Three Firebase Cloud Functions handle KYC token generation, PDF rendering, and background removal — each protected by API key. All Cloud Functions deployed on Google Cloud europe-west3 with environment-specific Firebase projects.

**Mobile:** Flutter with BLoC state management. Firebase Auth (email, Google, Apple). Multiple app flavors per environment. Segment analytics. Stripe SDK for in-app payment flows.

**Backend:** NestJS/TypeScript REST API on port 8080 (`/api/v1`). MongoDB Atlas as primary store. Orchestrates the two utility Cloud Functions (PDF + background removal) via `x-api-key` authenticated HTTP calls.

**Cloud Functions (Firebase/GCP):**
- `fanshop-sumsub` — Express serverless function. Generates Sumsub access tokens for KYC flows and queries verification results. Called directly from the Flutter app.
- `function-htmlToPDF` — Puppeteer (headless Chrome) renders invoice HTML URLs to PDF. Protected by `x-api-key`.
- `function-removeBackgroundNode` — ImgLy `@imgly/background-removal-node` ML model removes product photo backgrounds. Protected by `x-api-key`.

**Third-party integrations:** Stripe (payments + payouts), Sumsub (KYC), ShipEngine (shipping labels + rates), AfterShip (shipment tracking), Vertex/Taxamo (tax calculation), Google + Apple social login.