>_Shreyash Tripathi all_projects
    ~/projects/affiliate-marketing-saas/README.md

    $ cat README.md

    Affiliate-Marketing SaaS

    Multi-Tenant Affiliate Tracking, Commissions & Payouts

    A SaaS where brands run affiliate programs: tracked links, attribution, fraud scoring, GST/TDS invoicing and payouts. Designed and built end-to-end by Shreyash Tripathi, a Full-Stack Developer and UI/UX Engineer based in Noida, India.

    Affiliate-marketing SaaS case study: 41 pages, 31 SQL migrations, 4 portals
    Affiliate-marketing SaaS case study: 41 pages, 31 SQL migrations, 4 portals

    How it's built

    1. 01Affiliate shares /go/ link
    2. 02Click tracked + UTM auto-tagged
    3. 03Store order webhook
    4. 04Attribution + fraud score
    5. 05Commission, GST/TDS invoice
    6. 06Payout

    Overview

    An India-first affiliate-marketing platform for D2C and Shopify brands: affiliates share tracked links, the platform attributes sales, scores fraud, calculates commissions with GST and TDS, and handles invoices and payouts.

    Shreyash Tripathi built it on his own: first a complete frontend simulation, then the real Supabase backend, the Cloudflare Workers deployment, UTM auto-tagging and promo-platform capture.

    How it works

    1. Four portals

      41 pages across a merchant app, an affiliate portal, an admin console and auth.

    2. Tracked links

      A /go/[code] redirect records each click and adds UTM tags automatically before sending the visitor on.

    3. Orders and attribution

      Shopify order webhooks come in, sales are attributed to affiliates, and outbound webhooks notify other systems.

    4. Money

      A GST/TDS invoice engine, refund clawback, disputes and payouts.

    5. Trust and safety

      A fraud-scoring engine and KYC data encrypted at rest.

    6. Security model

      31 SQL migrations with row-level security and no service-role key anywhere: privileged actions go through narrow database functions.

    Challenges & solutions

    challenge: The app crashed on Cloudflare Workers: Turbopack builds broke the runtime and the cache revalidation deadlocked.

    solution: Forced the Cloudflare build onto webpack, removed the incompatible middleware file and made routes dynamic to avoid the deadlock.

    challenge: A null-handling bug in a database function would have let staff of one tenant read another tenant's KYC data.

    solution: Caught it in review and fixed the function before release, so tenant isolation holds.

    challenge: Dashboards showed zero for today in India, and the scheduled webhook job sent some deliveries twice.

    solution: Aligned day buckets and lookups on the same time zone, and fixed the dispatch race with a migration so in-flight deliveries aren't picked again.

    Results

    • Deployed to Cloudflare Workers with a real Supabase backend.
    • 41 pages, 31 SQL migrations, 4 portals.
    • Zero service-role keys in the app: every privileged action is a narrow, audited database function.

    What I built

    • Built solo: 41 pages, 4 portals.
    • Tracked links with auto UTM, fraud scoring.
    • 31 migrations, no service-role key.

    Tech stack

    Affiliate-Marketing SaaS is built with Next.js 16, Supabase, Postgres RLS, Cloudflare Workers and Tailwind CSS.

    • Next.js 16
    • Supabase
    • Postgres RLS
    • Cloudflare Workers
    • Tailwind CSS
    Shreyash Tripathi, Full-Stack Developer & UI/UX Engineer

    About the developer

    Shreyash Tripathi is a Full-Stack Developer and UI/UX Engineer in Noida, India, currently Junior Developer, UI/UX at Garage Collective. He builds React, Next.js and TypeScript interfaces for AI-integrated SaaS products.

    More projects