iFRAME's internal app for hosting renewals. It keeps each client's hosting packages, emails the client 30, 7 and 1 day before expiry with a pay link, takes the payment with Viva, then issues and emails the invoice through Elorus.
Requirements: Node 22, pnpm, PostgreSQL.
pnpm install
cp .env.example .env # set DATABASE_URL and SESSION_SECRET (openssl rand -hex 32)
pnpm db:migrate
pnpm db:seed # optional demo data
pnpm devSign in at http://localhost:3000/login with an address listed in ALLOWED_EMAILS. With no RESEND_API_KEY, the sign-in link is shown on the page instead of emailed.
Test mode: any provider whose keys are empty is simulated. That covers Viva (a test checkout page), Elorus (in-memory contacts and invoices) and email (logged to the console). A banner at the top of the app shows which ones are simulated.
pnpm import:sheet path/to/Sheet1.html --dry-run # preview
pnpm import:sheet path/to/Sheet1.htmlThe import creates one client, website and package per domain. Each package expires at the end of its sheet month, with reminders paused and no price. After the import:
- Link each client to Elorus. Use Today › "clients not linked", or Clients › "Not linked to Elorus".
- Set each package's plan or a custom price. Use Renewals › "Needs setup".
- Resume reminders on the package page.
The app runs at https://webhosting.iframe.gr. iframe.gr's DNS is on Cloudflare (not Plesk). The app's records are in the Cloudflare zone for iframe.gr, all set to DNS only (grey cloud): CNAME webhosting → d489941e332e9be1.vercel-dns-017.com (Vercel), plus Resend's resend._domainkey.webhosting TXT, send.webhosting CNAME and rsend.webhosting CNAME.
-
Domain: done.
webhosting.iframe.gris on the Vercel projectiframe-serversand serves HTTPS. -
Database: add Neon from the Vercel Marketplace. Vercel sets
DATABASE_URL. The build runsprisma generate. Runpnpm db:migrateagainst Neon once. -
Environment variables: copy every key from
.env.exampleinto Vercel. SetAPP_URL=https://webhosting.iframe.grand leaveEMAIL_REDIRECT_TOempty. -
Viva:
- Create a Smart Checkout payment source. Set its Success URL to
https://webhosting.iframe.gr/pay/viva/successand its Failure URL tohttps://webhosting.iframe.gr/pay/viva/failure. - Add the webhook
https://webhosting.iframe.gr/api/webhooks/vivafor the event Transaction Payment Created. - Start in demo mode (
VIVA_ENV=demo).
- Create a Smart Checkout payment source. Set its Success URL to
-
Elorus:
- Use a test organization first.
- Set the document series ids in
ELORUS_DOCTYPE_TPY,ELORUS_DOCTYPE_APY,ELORUS_DOCTYPE_EUandELORUS_DOCTYPE_NON_EU. - Before the first real invoice, check the lines marked
VERIFYinsrc/lib/elorus/client.tsagainst the Elorus API docs.
-
Email: emails come from
billing@webhosting.iframe.gr, with replies going toinfo@iframe.gr. The sending domain iswebhosting.iframe.gr, verified in Resend with records in Cloudflare. No mailbox is needed for billing@: Resend sends without one, and replies go to info@iframe.gr. Then setRESEND_API_KEY. -
Inngest: install the Inngest Vercel integration. It sets
INNGEST_EVENT_KEYandINNGEST_SIGNING_KEY. -
Cron: set
CRON_SECRET. Vercel Cron calls/api/cron/remindersand/api/cron/sync. -
Test: make one real €1 renewal end to end.
pnpm test # Vitest against a local Postgres (TEST_DATABASE_URL), all providers mocked