Fully functional store: eSIM lifecycle, top-ups, customer/admin dashboards, monitoring #3695
ccantynzcommented Jun 11, 2026
Originally written by @vercel[bot] on GitHub.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Actions | Updated (UTC) |
|---|---|---|---|
| esim | Preview, Comment | Jun 11, 2026 6:24am |
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Originally written by @ccantynz-alt on GitHub.
Imported from https://github.com/ccantynz-alt/Esim/pull/3
The store is now fully functional (in safe simulation mode)
The complete purchase lifecycle works end to end: browse → buy → QR code issued → install → activate → live usage tracking → top up (recharge) → admin refund/deactivate/monitor.
Two simulation layers keep it safe until you're ready, and both flip on without touching anything else:
EsimProvideradapter interface with a mock implementation — the real supplier (eSIM Access / Telna / etc.) plugs intolib/provider.tswhen the contract is signedCustomer side
/login, demo auth — swap for magic links at launch)Admin side ("see everything, monitor everything, fix everything")
/api/healthJSON endpoint for an uptime monitorADMIN_PASSWORD), customers can't reach itArchitecture
lib/db.ts— repository-pattern data layer (file-persisted in dev; the interface is the contract for the Postgres swap before launch)lib/fulfill.ts— one fulfillment path shared by preview checkout and the Stripe webhook (idempotent on webhook retries)middleware.ts+ HMAC-signed cookie sessions; top-up ownership checks (you can't recharge someone else's eSIM)Verified end-to-end by driving the running server
/dashboard→/login, customer hitting/admin→/admin/login✅tsc, lint, andnext build(245 pages) clean ✅https://claude.ai/code/session_016pMaCaxSE5WQMLnnC7QeYW
Generated by Claude Code