Put your links on one page, customise the theme and track clicks. Edits appear in a live phone preview. Stripe payments use test mode.
The challenge
Fast public pages and API-proof subscription limits, within the Workers free plan’s CPU constraints.
My role
I built the product, interface, database rules, Stripe integration and deployment, with 62 tests running in CI.
Architecture
Where each part runs. Red follows the example flow.
- L1 Interface Runs on: Browser
Live previews, accessible link ordering and click analytics. Public pages use minimal JavaScript.
- Next.js 16
- Tailwind CSS 4
- shadcn/ui
- dnd-kit
- Recharts
- L2 Server Runs on: Cloudflare Workers
Runs Next.js, verifies webhooks and caches public pages for a day, refreshing after edits.
- Cloudflare Workers
- OpenNext
- Workers KV
- L3 Data Runs on: Supabase
Triggers, column permissions and row-level security enforce plans. A dedicated function exposes public data.
- Postgres
- Row-level security
- Supabase Auth
- Supabase Storage
- L4 External services Runs on: Stripe
Checkout, subscription management and signed webhooks, all in test mode.
- Stripe Checkout
- Customer Portal
- Webhooks
Step by step: A Pro upgrade in test mode
- L1 · Interface The user opens Stripe Checkout in test mode.
- L4 · External services Stripe completes the test payment and sends a webhook.
- L2 · Server The Worker verifies the signature and fetches the current subscription.
- L3 · Data The handler updates the plan; database rules prevent user-side changes.
- L1 · Interface All themes and unlimited links become available.
Key decisions
- 01
Database-enforced plans
Postgres enforces link limits and Pro themes. Users cannot change their plans. PGlite tests verify the rules.
- 02
Verified webhooks
Each verified event fetches the current Stripe subscription, reducing outdated updates from duplicate or reordered events.
- 03
Worker CPU usage
Static assets and caching reduced CPU usage. Recorded warm requests: 5 to 14 ms. Compressed bundle: 2.65 to 1.64 MiB.
- 04
Lightweight pages
Separate layouts, CSS dark mode and sendBeacon keep pages light. Recorded mobile Lighthouse performance: 98.
- 05
Theme contrast
An import script adjusts OKLCH lightness to meet WCAG AA contrast thresholds.