Streetwise
A prototype that ranks nearby merchants from selectable situational context and generates structured, time-limited offers.
- Year
- 2026
- Status
- Archived prototype
- Stack
- React
- TypeScript
- Supabase
Problem
Generic recommendations often ignore the user context that determines whether an option is actually useful.
The system
A web prototype that combined selectable scenario context with client-side merchant ranking, AI-generated offers, Supabase persistence, and a redemption flow with a QR code.
Architecture
Merchants were ranked in the client. The top match and the selected context went to a Supabase Edge Function that generated one structured offer, which the user could accept and redeem.
Engineering decisions
01
Structured AI output instead of free text
Offers were generated through structured function-calling, so every offer had the same fields (headline, description, discount, validity window, call to action, and reason) that the interface could render and store.
02
Discount limits
The Edge Function clamped the model's discount before an offer was stored. A later review identified that the authoritative merchant limit should come from the database rather than the request, and I implemented and tested that stronger enforcement separately.
03
Row-Level Security policies
Supabase Row-Level Security policies controlled who could create and change merchants, offers and redemptions. A later review tightened the read policies for offers and profiles as part of separate hardening work.
Scope and limits
- Streetwise was built on a managed Lovable/Supabase backend that is no longer maintained. This case study describes the implementation preserved in the repository; there is no hosted demo.