Skip to content

feat: add deals feature with database seeding, backend API, and inter…#88

Open
yashmitb wants to merge 1 commit intoCSES-Open-Source:mainfrom
yashmitb:main
Open

feat: add deals feature with database seeding, backend API, and inter…#88
yashmitb wants to merge 1 commit intoCSES-Open-Source:mainfrom
yashmitb:main

Conversation

@yashmitb
Copy link
Copy Markdown
Contributor

@yashmitb yashmitb commented May 4, 2026

feat: add deals feature with database seeding, backend API, and interactive UI component

Changes

Added a full Deals & Offers page for logged-in UCSD students, backed by a Supabase deals table seeded from multiple open-source student discount databases.

  • Database: Created deals table with 268 unique student deals across 9 categories (Software, Cloud, Education, Productivity, Shopping, Entertainment, AI, Music, UCSD Exclusive). Added link_status column populated by a link validation script that HEAD-checks all 268 URLs.
  • Backend: Added GET /deals endpoint with optional ?category= filter, returning deals sorted by UCSD-specific first.
  • Frontend: New Deals tab (5th tab, pricetag icon) using the existing Tamagui design system — matches Home tab layout with Screen, Card, SectionTitle, and AppText primitives.
    • Navy header with total/free/UCSD-exclusive stat chips
    • Animated search bar (border color transitions on focus)
    • Horizontal category filter pills with spring bounce animation on press
    • DealCard components with staggered fade+slide entrance animations, color-coded category/badge chips, UCSD exclusive gold strip, and ✓ Verified / Unchecked link status badge
  • Seeding: Single combined seed script (seed_deals_all.ts) merges all three sources with name-based deduplication (curated data takes priority).
  • Link validation: validate_links.ts — runs parallel HEAD requests against all deal URLs, marks each as verified, broken, or unchecked in the DB. Re-runnable anytime.

Testing

  • Ran seed_deals_all.ts — confirmed 268 deals inserted cleanly across all categories.
  • Ran validate_links.ts — 224 verified, 18 broken, 26 unchecked out of 268.
  • Tested GET /deals and GET /deals?category=UCSD via curl — correct results, UCSD deals sorted first.
  • Verified Deals tab renders, search filters correctly, category pills animate, and "Get Deal" opens the correct URL.

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.

1 participant