Skip to content

Add computer vision lesson to the ML track, and verify the Supabase layer - #22

Open
samanyugoyal2010 wants to merge 1 commit into
mainfrom
cursor/cv-lesson-and-supabase-fc37
Open

Add computer vision lesson to the ML track, and verify the Supabase layer#22
samanyugoyal2010 wants to merge 1 commit into
mainfrom
cursor/cv-lesson-and-supabase-fc37

Conversation

@samanyugoyal2010

@samanyugoyal2010 samanyugoyal2010 commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds and publishes a new Machine Learning chapter, "How a Computer Sees" (/learn/ml/computer-vision/), and wires it through to the Supabase leaderboard allowlist.

The lesson teaches convolution as the core operation of computer vision: an image is a grid of brightness numbers, and a 3×3 filter slid over every pixel turns those numbers into edges, blur, and texture. Its hero interactive lets the reader pick a filter and drag a strength slider, watching the filtered image redraw in real time.

New/changed files:

  • src/lib/ml/computer-vision-data.ts — seeded 14×14 image (module scope, mulberry32) plus a pure filteredImage() convolution. No Math.random/Date; no toLocaleString/Intl.
  • src/components/ml/ConvolutionExplorer.tsx — the "use client" hero interactive: hand-written SVG grids, a SegmentedControl for the filter, and a strength slider.
  • src/components/ml/ComputerVisionLesson.tsx — prose composed from the shared primitives, in the house voice.
  • src/components/ml/MlLessonCover.tsx — a hand-drawn SVG cover (miniature of the interactive).
  • src/lib/ml-lessons.ts — chapter entry at order 22 (right after Neural Networks; from-notebook-to-production shifts to 23), published.
  • src/app/learn/ml/(chapters)/[slug]/page.tsx — registered the body.
  • supabase/chapters.sql — regenerated via npm run learn:sql (now 190 published chapters, including computer-vision).

"Set up Supabase"

There is no Docker, Supabase CLI, or reachable hosted project in the agent VM (the Supabase MCP needs auth), and live keys must be supplied through the Secrets panel per docs/SUPABASE_SETUP.md. To verify the database layer regardless, I stood up a local PostgreSQL 16, added small shims for auth.jwt() and the anon/authenticated roles, and applied the repo's real supabase/chapters.sql then supabase/schema.sql — both applied cleanly. The leaderboard logic then behaved exactly as designed:

  • computer-vision is present in the regenerated allowlist.
  • The progress_known_chapters_only trigger silently dropped a made-up slug (2 of 3 inserted rows survived).
  • refresh_profile_stats recomputed XP = 40 (20 × 2 real completions).

Walkthrough

Browser demo of the published lesson and its interactive (track card → lesson → switching filters → dragging the strength slider on the Edges filter → takeaways + pager):

computer_vision_lesson_demo.mp4

Local Supabase schema + allowlist verification output:

Supabase verification log

Related Issue

No proposal issue exists — this lesson was added per direct request. A maintainer should confirm the ML-track slot before merge, per CONTRIBUTING.md.

Type of Change

  • New lesson

Checklist

  • npm run check passes (lint + typecheck + lesson validator + build)

If this touches /learn

  • A lesson proposal issue was opened and confirmed before writing (added on request; not proposed)
  • npm run learn:check passes
  • Every id in headings has a matching id="..." in the body component
  • Cover art added — not the silent fallback
  • Data is seeded at module scope; no Math.random(), Date.now(), or new Date()
  • No toLocaleString or Intl.NumberFormat
  • Composed from src/components/learn/primitives/, no hand-rolled styled blocks
  • No heading ids renamed on an existing lesson (this is a new lesson)
  • Read back at 375px and with reduced motion
  • Original work, not paraphrased from another course, book, or blog

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

New chapter in the ML track (order 22, after Neural Networks) teaching
convolution as the core operation of computer vision:

- src/lib/ml/computer-vision-data.ts: seeded 14x14 image + pure convolution
- src/components/ml/ConvolutionExplorer.tsx: hero interactive (filter + strength)
- src/components/ml/ComputerVisionLesson.tsx: prose in the house voice
- MlLessonCover.tsx: hand-drawn SVG cover
- registered the body, published, and regenerated supabase/chapters.sql
  (190 chapters) so completions of the lesson are allowlisted for XP

Co-authored-by: samanyugoyal2010 <samanyugoyal2010@users.noreply.github.com>
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
new-cwp Ready Ready Preview Aug 22, 2026 6:20am

@samanyugoyal2010

samanyugoyal2010 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@735meis can you please take it from here

i need db sync as well as some additional features as discussed integrated ASAP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants