● Explication setup

From an empty folder to taking payments.

Nine screens. Each one tells you exactly where to click, what to copy and where to paste it. No terminal, no code, no guessing.

About 20 minutes Free tiers are enough Test mode first, real money later
1

Make a Supabase project

Supabase is the free service that holds the accounts, the plans and the page wording. One project is all you need.

supabase.com/dashboard
+ New project
▦ All projects
? Help

Create a new project

Free. Pick the region closest to you.

Nameexplication
Database password••••••••••••1
RegionEurope (London)
Do this: go to supabase.com/dashboard, sign in, click New project. Name it explication, save the database password somewhere safe 1 (you will not need it in this guide), pick the closest region, and press Create new project. Wait about two minutes while it builds.
2

Paste in the database file

This creates every table the site needs, fills in the seven plans, and locks all editing to your developer email.

supabase.com → your project → SQL Editor
▦ Table editor
>_ SQL Editor
⚿ Authentication
⚙ Project Settings

New query

Paste the whole file, then press Run.

create extension if not exists pgcrypto;
create table public.explication_plans ( … );
2
Do this: in the left sidebar click SQL Editor 2, then New query. Click the button below to copy the file, paste it into the big box, and press Run. You should see Success. No rows returned.
If you later change the plans, come back here and run the same file again — it updates the shop front in place without wiping anything.
3

Turn on email sign-in

Students sign in with an email and password. While you are testing, switch confirmation off so you can sign in instantly.

supabase.com → Authentication → Providers
⚿ Providers
@ Emails
↗ URL Configuration

Email

The simplest way in.

Enable email provider
Confirm email (off while testing)
3
Do this: click Authentication → Providers 3, open Email, make sure it is enabled. Turn Confirm email off for now — turn it back on before real students arrive. Press Save.

The branded email templates are in emails/auth-emails.html — one paste-ready block per email — with subject lines in emails/auth-emails.txt. Those templates only reach real students once a real sender is connected: that is Make email actually arrive, after step 9.
4

Copy two values into the site

The site needs the project's address and its public key. Nothing secret goes in the browser.

supabase.com → Project Settings → API
⚙ General
⚙ API
⚿ Database

Project API keys

Copy these two. Ignore service_role for ever.

Project URLhttps://abcdefgh.supabase.co
anon publiceyJhbGciOiJIUzI1NiIs…
Do this: in Supabase click Project Settings → API. Copy Project URL and the anon public key. Then open the Explication site, click Connect Supabase on the green bar, paste one into each box, and press Connect this site.
Never paste the service_role key into the site. If it ever leaks, rotate it in the same screen.
Want every visitor to skip this step? Open js/config.js in the Explication Web folder and paste the same two values there.
5

Make yourself the developer

One address gets the console: lucas.owen13@icloud.com. Nobody else, ever.

your site → Account

Create account

Emaillucas.owen13@icloud.com
Password••••••••
4
Do this: on the site click Account → Create account 4 and use exactly lucas.owen13@icloud.com. Sign in. A Developer item appears in the sidebar — that is your console.
Using any other address gives a normal account with no console. That is the point: the database itself refuses edits from everyone else.
6

Give a model its API key

Offline models and students' own keys work without this. This is only if you want to host the big models yourself.

your site → Developer → Models & keys

Qwen2.5 7B

Endpoint base URLhttps://openrouter.ai/api/v1
Model name at the hostqwen/qwen-2.5-7b-instruct
API keysk-or-v1-…5
Do this: in your model provider's dashboard create an API key. On the site open Developer → Models & keys, edit a model, paste the endpoint and the key 5, and press Save model. Repeat per model.
The key is write-only: it goes into a table no browser can read, and only the site's server function uses it.
7

Connect PayPal to the plans

Two routes: the PayPal API unlocks purchases automatically; payment links need no keys but one click per sale.

developer.paypal.com → Apps & Credentials
▦ Apps & Credentials
◍ Live
↗ Webhooks

Create a PayPal app

Copy the Client ID and Secret into Supabase secrets.

Client IDAeA1…your-client-id
Secret••••••••••••6
7
Do this: in PayPal open Developer → Apps & Credentials, choose Live (or Sandbox to test), create an app, and copy the Client ID and Secret 6. Add them as PAYPAL_CLIENT_ID and PAYPAL_CLIENT_SECRET in Supabase → Edge Functions → Secrets 7. Add a webhook at https://YOUR-PROJECT.supabase.co/functions/v1/paypal-webhook with the six payment events listed in supabase/SETUP.md, then put its Webhook ID into PAYPAL_WEBHOOK_ID. On the site open Developer → PayPal, paste the Client ID, set Live and PayPal API, and save.
Product namePriceType
Paragraph Lite£4.00One-off
Model Library£14.00One-off
Exam Season£24.00One-off
AI Booster£6.00One-off
Student£4.00Monthly, recurring
Scholar£9.00Monthly, recurring
Examiner£19.00Monthly, recurring
No terminal? Use PayPal payment links instead: create a link per plan in PayPal, paste it into Developer → Plans → PayPal payment link, switch the checkout mode to Payment links, and grant each buyer in People. The API route is the one that unlocks automatically.
8

Try it, then give yourself the plan

With payment links, PayPal takes the money but the site does not hear about it automatically. You approve the buyer by hand — one click.

your site → Developer → People

Give someone a plan

Buyer's emaillucas.owen13@icloud.com
PlanStudent · £4.00
8
Do this: buy your own plan with test card 4242 4242 4242 4242, any future date, any CVC. Then on the site open Developer → People, type the buyer's email, pick the plan and press Grant access 8. The plan shows on their Account page immediately.
Want purchases to unlock themselves? That is the optional checkout-function route in supabase/SETUP.md, step 3. It needs five terminal commands. Everything works without it — you just approve each sale.
9

Publish it

Any static host works. Supabase stays the backend, so there is nothing to run.

Before you upload: open js/config.js in a text editor and paste your Project URL and anon key into the two empty quotes (the same two values from step 4). That is what makes the plans, wording and prices identical for every visitor — without it, each visitor is asked to connect their own project. Then: upload the dist folder — it is the upload copy of the site, with the Supabase function files left out so hosts do not think a build is needed. On Cloudflare go to Workers & Pages → Create → Upload and deploy; on Netlify drag it onto app.netlify.com/drop. You get an address like explication.netlify.app or explication.you.workers.dev. Go back to Supabase → Authentication → URL Configuration and add that address to Redirect URLs. Finally set the same address in the iPhone and Mac apps (see supabase/SETUP.md) so their plan buttons open the right site.
Local files (file://) cannot sign in. Always open the site through Start Explication.command or the published address.
✉

Make email actually arrive

Supabase's built-in sender only delivers to your own team and allows a couple of messages an hour. Real students need a real sender. Three jobs, three services: Resend sends, Cloudflare receives, Apple Mail reads it.

A · Sending: Resend. You need a domain you own — buy one at Cloudflare → Domain Registration (about £8–10 a year) if you do not have one. Then sign up at resend.com; the free plan is 3,000 emails a month, 100 a day.

1. Resend → Domains → Add domain → type the domain → pick a region → Add.
2. It lists three or four DNS records. In Cloudflare open the domain → DNS → Records and add each one exactly as shown. Leave the proxy switch off (grey cloud, “DNS only”) — a proxied MX or TXT record will not verify. Then press Verify in Resend; usually a few minutes.
3. Resend → API Keys → Create API key, permission Sending access, and copy the re_… value. It is shown once.
supabase.com → Authentication → Emails → SMTP Settings

Enable custom SMTP

Six values. Only the sender is yours.

Sender emailno-reply@yourdomain.com
Sender nameExplication
Hostsmtp.resend.com
Port465
Usernameresend
Passwordre_… (your API key)
4. In Supabase open Authentication → Emails → SMTP Settings, turn on Enable custom SMTP and paste the six values above. The username really is the word resend, and the password is the API key, not your Resend login.
5. Trigger a password reset from the site. It should arrive from no-reply@yourdomain.com within seconds, and Resend → Emails shows whether it was delivered. Supabase starts you at 30 messages an hour — raise it in Authentication → Rate Limits once it works. The branded templates from step 3 are what gets sent; nothing else to change.
If Resend offers a DMARC record as well, add it: it is one TXT record at _dmarc and it keeps your mail out of spam folders.
B · Receiving: Cloudflare Email Routing. Free, and receiving only — Cloudflare has no inbox and no SMTP server, so it can never be the thing that sends.

1. The domain has to be on Cloudflare, using Cloudflare's nameservers.
2. Dashboard → Email → Email Routing → Onboard domain → Add records and enable. That adds the MX, SPF and DKIM records for you.
3. Destination addresses → add your iCloud address → open the verification email → verify.
4. Routing rules → Custom addresses → Create address: hello (or support) → action Send to → your iCloud address → Save.
5. Email it from another account. It should land in iCloud within seconds, and the original address stays hidden.
Never switch Email Routing on for a domain that already receives mail somewhere else — Google, Microsoft, or iCloud+. It replaces the MX records, so that other inbox stops getting mail. One receiver per domain.
C · Reading it: Apple Mail. On the iPhone: Settings → Apps → Mail → Accounts → Add Account → iCloud. On the Mac: Mail → Settings → Accounts → + → iCloud.

Mail sent to hello@yourdomain.com is forwarded into that iCloud inbox, so it arrives like any other message. Replies go out from your iCloud address unless you do D.
D · Replying as hello@yourdomain.com (optional). Two honest routes.

iCloud+ custom domain — paid with iCloud+ (about 79p a month): Settings → Apple Account → iCloud → Custom Email Domain → use a domain you own. Apple then hosts the mailbox, Apple Mail sends and receives natively as hello@yourdomain.com, and Cloudflare is only DNS. It takes over the MX records, so switch Cloudflare Email Routing off for that domain first — and then part B is not needed at all.

Send-as through Resend — free, fine for the occasional reply: Mail → Settings → Accounts → your iCloud account → Account Information → Edit Email Addresses → add hello@yourdomain.com. Then Server Settings → Outgoing Mail Server → Edit SMTP Server List → add smtp.resend.com, port 465, user resend, your API key, TLS on. It sends, but Resend is not a mailbox: there is no Sent folder on a server and the message is logged as app mail. Good enough to answer a student; not a replacement for a real inbox.
JobWho does itCost
Send sign-in and password emailsResend → Supabase custom SMTPFree to 3,000 a month
Receive mail at your domainCloudflare Email Routing → forwards to iCloudFree
Read it and replyApple Mail, on the iCloud accountFree
Reply as your domain, nativelyiCloud+ custom domain (replaces Email Routing)iCloud+ subscription
Resend cannot receive email. Never point MX records at Resend, and never put the re_… key in the website — it belongs only in Supabase's SMTP settings.
☰

Where everything lives

One table to come back to when you forget.

What you want to changeWhere to click
Prices, plan names, wording of a planSite → Developer → Plans → Edit
Any sentence on any pageSite → Developer → Wording → edit mode, then click the words
Model keys and endpointsSite → Developer → Models & keys
Payment linksSite → Developer → Plans → PayPal payment link field
Who has a planSite → Developer → People
PayPal keys (advanced)Supabase → Edge Functions → Secrets
The project address and keySupabase → Project Settings → API; site → Developer → Supabase
Emails students receiveSupabase → Authentication → Emails
Which address students see as the senderSupabase → Authentication → Emails → SMTP Settings
Mail sent to hello@yourdomainCloudflare → Email → Email Routing
?

If something looks wrong

The four things that actually go wrong.

SymptomFix
No developer console in the sidebarYou are signed in as a different email. Sign out, sign in as lucas.owen13@icloud.com.
"Supabase could not be reached"Project URL or anon key pasted wrong. Developer → Supabase → paste again from Project Settings → API.
Plans page is emptyStep 2 did not run. Supabase → SQL Editor → paste the file → Run.
"This plan has no PayPal payment link yet"Add the link to that plan in Developer → Plans, or you are in live mode with a test link.
Sign-up says "check your email" but nothing arrivesConfirmation is on and Supabase's built-in sender only reaches your own team. Connect Resend (last section), or turn Confirm email off in Authentication → Providers → Email.