Muhammad Tabarak - Home
Custom Web App Development

Curved Lab

Creator & Influencer Campaign Monetization Platform

Project ResultEngineered transactional financial settlements and automated multi-platform social metrics with zero write conflicts.
Tech StackNext.js 16, React 19, TypeScript
Deployment ScopeFull-stack monorepo: 3 Next.js micro-frontends, Express.js API, MongoDB ACID ledger, and Stripe Connect.
Curved Lab

Curved is an enterprise creator and influencer campaign monetization platform engineered as an npm workspaces monorepo. It connects brands, agencies, and creators through transparent, performance-driven campaigns, automated social engagement tracking, and multi-document ACID financial settlements. The architecture coordinates three decoupled Next.js micro-frontends (creator/influencer portal, management dashboard, and marketing site) with an Express.js and Node.js REST API backend.

The system is architected as an npm workspaces monorepo uniting four sub-packages: the primary app (Next.js 16, React 19, Radix UI, Framer Motion, Recharts, React Hook Form, Zod), the admin portal (Next.js 14, React 18, TanStack Table), the marketing landing site (Next.js 16, React 19, Tailwind CSS 4, Framer Motion, Swiper), and the core server (Node.js, Express 4.18, Mongoose 8). Micro-frontends operate as Client-Side Rendered (CSR) applications wrapped in Next.js App Router shells with Axios interceptors and React AuthProvider context for seamless state management.

Financial settlements, creator earnings commits, and submission approvals are executed inside MongoDB multi-document ACID transactions using mongoose.startSession() and session.startTransaction(). To guarantee zero financial discrepancies during concurrent batch payouts, write conflicts are handled using a custom exponential-backoff retry wrapper (withRetry) targeting WriteConflict and TransientTransactionError. The immutable double-entry transaction ledger manages Stripe Connect Express accounts, PaymentIntents, automated 10% platform funding fees, 20% creator payout fees, and real-time wallet balance mutations ($inc).

Curved implements an automated multi-platform social metrics synchronization engine with OAuth 2.0 token management and rotation. Running on in-process background scheduling via node-cron every 30 minutes, worker jobs scrape video metrics across YouTube Data API v3, TikTok Open API v2, and Meta Graph API v18 in concurrency-limited batches of 50 via Promise.all. Approved submissions are processed in batches up to 500 records to calculate view-based compensation and dynamically enforce minimum/maximum payout threshold economics.

Application security and audit compliance are enforced across all layers. An automated request-context audit engine leverages Node.js AsyncLocalStorage and Mongoose lifecycle hooks to record user metadata and entity mutations across 12 schema collections without polluting service method signatures. The API gateway is fortified with express-mongo-sanitize against NoSQL injection, Helmet HTTP headers, CORS whitelisting, and a 3-tier rate limiting strategy (global API, authentication, file uploads). System reliability is monitored via Winston structured logging and an active health diagnostics endpoint (/api/health/ping) evaluating MongoDB latency, Cloudinary reachability, and Stripe API connectivity in parallel.

The platform is deployed on a Linux VPS running four isolated PM2 processes across dedicated ports with reverse proxying and automated rolling reload scripts (deploy.sh) ensuring continuous zero-downtime deployments. Static media assets and uploads are ingested via multer streaming buffers and optimized on the Cloudinary CDN.

Project Details

CLIENT
Muhammad Abeid
YEAR
January 2026
TECHNOLOGY
Next.js 16React 19TypeScriptTailwind CSSNode.jsExpress.jsMongoDBMongooseStripe ConnectCloudinaryMeta Graph APITikTok APIYouTube Data API
KEY FEATURES
  • •Monorepo architecture uniting 3 Next.js micro-frontends with an Express REST backend
  • •Transactional financial settlements via MongoDB multi-document ACID transactions
  • •Stripe Connect Express payouts, PaymentIntents, transfers, and automated platform fee splits
  • •Multi-platform social metric aggregation across YouTube Data API, TikTok Open API, and Meta Graph API
  • •OAuth 2.0 token rotation and expiration management for social platform APIs
  • •Request-context audit trail engine powered by Node.js AsyncLocalStorage and Mongoose hooks
  • •Exponential-backoff retry mechanism (withRetry) eliminating transactional write conflicts
  • •Tiered API rate limiting (global, authentication, file uploads) and NoSQL injection sanitization
  • •Role-Based Access Control (RBAC) with granular administrative permission flags
  • •Multi-service health diagnostics and latency telemetry (/api/health/ping)
  • •Automated background scheduling via node-cron processing batch view metrics and payouts
  • •Cloudinary V2 asset management with local buffer ingestion via multer

More SaaS Engineering Case Studies

View All Works →