ikramdeveloper

Ikramdeveloper

All Projects

Next.js, NestJS, GraphQL, MongoDB, RabbitMQ

Vonza — Affiliate Management System

A full affiliate management module built inside the Vonza SaaS platform — giving each creator admin complete control over affiliate relationships, commission rules, and payout schedules, and giving affiliates a clean self-serve interface for promotions.

Admin dashboard
The Problem

What needed to be solved

Vonza admins — creators selling courses, communities, and digital products — had no built-in way to recruit promoters and reward them for driving sales. Managing affiliate relationships through external platforms meant extra tools, manual tracking, and no integration with Vonza's own product and revenue data. The client needed a fully owned affiliate system embedded directly in the platform.

Engineering Thinking

Key Decisions & Challenges

1

Configurable Cookie Duration and Attribution Model per Admin

Situation

Affiliate attribution relies on cookies to track which affiliate drove a purchase. Different Vonza admins have different business needs — some want a short attribution window, others a long one. When a buyer clicks multiple affiliate links for the same product from different affiliates, which one gets credit also depends on the admin's preference.

Options Considered

  • Fixed platform-wide cookie duration and attribution model — simpler to implement but removes control from admins
  • Make both configurable per admin in their affiliate settings panel

Decision

Made both settings configurable per admin. Default cookie duration is 30 days (industry standard). Attribution model: admins choose between last cookie wins (most recent affiliate link clicked gets credit) or first cookie wins (first link clicked gets credit). New settings apply to future referral links; existing cookies are not retroactively changed. No self-referral protection was implemented since Vonza products don't require login to purchase — there is no reliable way to identify an affiliate buying through their own link.

2

Two-Stage Commission Lifecycle — Configurable Approval and Configurable Payout

Situation

Commissions cannot be transferred immediately after a purchase — the purchase might be refunded, or the admin may need time to verify. Different admins also have different preferences for how hands-on they want to be with both approving individual commissions and scheduling payouts.

Options Considered

  • Auto-approve and auto-transfer all commissions immediately at purchase — simple but risky for refund scenarios
  • Manual-only approval and payout — full control but operationally heavy for admins at scale
  • Two independent configurable stages: approval and transfer each controlled separately per admin

Decision

Built a fully configurable two-stage lifecycle. Stage 1 (Approval): admins choose auto-approve after a configurable holding period (e.g. 2 or 7 days — admin sets it), during which they can still manually reject; or fully manual approval where they review and approve each commission individually. Stage 2 (Transfer): admins choose manual payout (admin creates a payout record with the amount when ready) or automatic on a configurable schedule (every 7 days, 2 weeks, or monthly). A commission must be in approved state before it is included in any transfer.

3

Product-Scoped Referral Links with Affiliate ID

Situation

Vonza admins assign specific products to specific affiliates — an affiliate might be allowed to promote some products but not others. Referral links needed to carry enough context to attribute both the affiliate and the exact product being promoted accurately, enabling correct commission calculation.

Options Considered

  • Single generic affiliate link per affiliate — simpler but loses product-level attribution
  • Product-scoped links — each link encodes both the affiliate ID and the product context

Decision

Each generated referral link is product-scoped, carrying the affiliate ID and product context in the URL. This allows accurate attribution even when an affiliate promotes multiple products, and ensures commission is tied to the correct product sale rather than any purchase on the platform.

What Was Built

Features

Affiliate Onboarding from Admin Panel

Admins can onboard any registered user as an affiliate directly from the admin panel — no separate registration flow required.

Product Assignment per Affiliate

Admins assign specific products each affiliate is allowed to promote. Affiliates only see and generate links for the products explicitly assigned to them.

Admin Revenue & Commission Dashboard

Real-time stats dashboard showing revenue, commissions earned, and refund deductions broken down per affiliate — giving admins full visibility into affiliate performance.

Affiliate Self-Serve Portal

Affiliates log in to their own portal, view only the products assigned to them, generate and copy unique referral links per product, and track their own performance metrics.

Configurable Commission Approval

Admins choose between auto-approve after a configurable holding period or manual approval per commission. Commissions can be rejected at any point before approval.

Configurable Payout Schedule

Admins choose between manual payouts (creating payout records themselves) or automatic transfers on a configurable schedule — weekly, biweekly, or monthly. Only approved commissions are included.

Screenshots

In Action

Affiliate detail view

Affiliate detail view

Responsibility

My Role

I led a team of six engineers as technical lead, working at the architecture level — designing the affiliate link structure, the cookie tracking approach, the commission lifecycle model, and the data schema. Day-to-day implementation was carried out by the team.

Stack

Tech Stack

Next.js NestJS GraphQL Apollo Client Zustand Shadcn/UI TailwindCSS RabbitMQ MongoDB AWS Amplify AWS App Runner TypeScript Turborepo
Result

Outcome

Delivered in 1.5 months. The module runs on the same microservices and Turborepo monorepo structure established during the streaming feature, which meant the team could onboard to the codebase quickly and add the new service without touching existing ones.

Demo

Live Project

vonza.com