cd /news/machine-learning/i-built-a-tiktok-style-shopping-feed… · home topics machine-learning article
[ARTICLE · art-106928] src=dev.to ↗ pub= topic=machine-learning verified=true sentiment=↑ positive

I built a TikTok-style shopping feed with a recommender system — in pure client-side JS

Developer Bhaumik Tandan built ThodaSa, a TikTok-style shopping feed for the Indian market with a recommender system that runs entirely in client-side JavaScript. The static site on GitHub Pages uses 13-dimensional product feature vectors and a weighted engagement profile stored in localStorage to personalize the feed without any backend or tracking servers. The project is open source on GitHub.

read2 min views1 publishedAug 22, 2026

TL;DR: I built ThodaSa — a reels-style impulse-shopping demo for the Indian market. You scroll products like Instagram reels, and the feed learns your taste — with no backend, no login, and no tracking servers. The whole recommender is ~150 lines of client-side JavaScript. Code is on GitHub.

Quick-commerce apps in India (Blinkit, Zepto, Meesho) figured out something interesting: shopping is entertainment. I wanted to push that to its logical end — what if the store was literally a reels feed? One product per screen, full-bleed photo, swipe up for the next dopamine hit, everything under ₹499.

And because a feed is boring if it's the same for everyone, it needed a recommender system. The catch: this is a static site on GitHub Pages. No servers. So the recommender had to live entirely in the browser.

Every product gets embedded as a 13-dimensional feature vector — no ML libraries, just an array:

// [0..7] category one-hot (snacks, beauty, gadgets, home, ...)
// [8..10] price bucket one-hot (low ≤150, mid 151–300, high >300)
// [11] deal flag
// [12] highly-rated flag (≥4.5)
export const vecOf = (p) => {
  const v = new Array(13).fill(0)
  v[CATS.indexOf(p.category)] = 1
  v[p.price <= 150 ? 8 : p.price <= 300 ? 9 : 10] = 1
  if (p.deal) v[11] = 1
  if (p.rating >= 4.5) v[12] = 1
  return v
}

The user's taste is a weighted running sum of the vectors they engage with, persisted in localStorage

:

Signal Weight
Purchase +10
Add to cart +8
Wishlist +5
Share +4
Dwell > 4s on a card +2
Flick past in < 1.2s −1
Un-wishlist −3

Dwell time comes from an IntersectionObserver

on the snap-scroll feed — if you on a card, that's a signal; if you flick past it instantly, that's a signal too. Every new session decays the profile by 0.85, so recent taste dominates.

On each visit, every product is scored:

score = cosine(profile, vecOf(product))
      + Math.random() * 0.15          // jitter
      - Math.min(seenCount, 5) * 0.06 // fatigue penalty

Then the feed interleaves: two "exploit" cards (best matches, badged ✨ For you) for every one "explore" card (random from the long tail, badged 🎲 Fresh find). Pure exploitation makes an echo chamber; the exploration slots keep the feed a discovery machine.

Cold start (fewer than 3 signals) falls back to a hand-curated launch order.

scroll-snap-type: y mandatory

  • one 100dvh

card per product gets you TikTok-feel scrolling with zero JS scroll handlers.IntersectionObserver

is a shockingly good implicit-feedback sensor.Scroll a few beauty products and reload — watch the feed rearrange itself. Then check the "Your vibe" widget in the wishlist to see what it learned about you.

Roast the code, star the repo, or tell me what you'd impulse-buy under ₹499.

── more in #machine-learning 4 stories · sorted by recency
── more on @thodasa 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/i-built-a-tiktok-sty…] indexed:0 read:2min 2026-08-22 ·