Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ reward is in, when it was last checked, and what to do if it's stuck** β€” using
four-status model (`Tracking β†’ In Progress β†’ Rewarded β†’ Needs Attention`) on top of the
same `deals.getActivityOfferPlacements` tRPC contract Super serves in production.

## How closely this mirrors Super.com

This demo is deliberately built to match Super's real production stack β€” not just the UI, but the API contract, naming conventions, and architecture. Here's what's the same:

| What | Super | This demo |
|---|---|---|
| **UI library** | Material UI (MUI) v6 + Emotion | MUI v6 + Emotion β€” same component primitives, same `sx` prop styling |
| **Font** | Poppins (observed in HAR) | Poppins via `next/font/google` β€” same weights, same scale |
| **API style** | tRPC β€” observed at `/snapcommerce/api/trpc/{router}.{procedure}` | tRPC v11, same path prefix, same `snapcommerce` namespace |
| **Wire format** | `snake_case` field names β€” `user_offer_activity`, `last_completed_at`, `icon_url`, etc. | Identical β€” Zod schemas and fixtures use the exact HAR field names |
| **Response envelope** | `{ result: { data: { data: <payload> } } }` doubly-nested superjson shape | Identical β€” `{ data: ... }` envelope preserved throughout |
| **Procedure naming** | Verb-prefixed: `getActivityOfferPlacements`, `updateActivityOfferPlacement` | Same convention for every procedure |
| **Status model** | `RETRY`, `IN_PROGRESS` observed; larger enum in production | `deriveActivityStatus()` maps the same values β†’ four user-facing statuses; unknown enum values pass through |
| **Analytics** | Amplitude | Console-logged stub with Amplitude-shaped event names and properties |
| **Auth stack** | Custom JWT; Ada chatbot | JWT payload stub in the Ada dialog; chat UI matched to observed layout |
| **Runtime** | Node.js on AWS | Node.js via Vercel Fluid Compute β€” same runtime, different host |

The main deviations are the framework (Next.js App Router vs. Super's webpack React SPA β€” the trade-off is collapsed frontend/backend/deploy at the cost of SSR semantics) and the host (Vercel vs. AWS β€” functionally identical for this surface). Everything user-observable β€” component library, font, API contract, field names β€” is matched field-for-field to what HAR captures show.

---

## Live demo
Expand Down
Loading