Astro landing page for lead generation (private biology tutoring), deployed to Cloudflare Workers.
src/pages/index.astro— the single landing page (Arabic, RTL).src/pages/api/lead.ts— a Worker API route that validates and stores each form submission in Cloudflare KV.wrangler.toml— Cloudflare Workers config, including the KV binding (LEADS).public/logo.png,public/favicon.svg— brand assets.
The WhatsApp number is set once, near the top of src/pages/index.astro:
const WHATSAPP_NUMBER = '201090422816';To switch the post-submit CTA from a direct chat to a WhatsApp group invite instead,
replace the wa.me/... links (there are two: the header button and the success-panel
button built in the <script> block) with your https://chat.whatsapp.com/... invite
link.
npm install
# Create the KV namespace that stores submitted leads
npx wrangler login
npx wrangler kv namespace create LEADS
npx wrangler kv namespace create LEADS --previewEach command prints an id. Paste them into wrangler.toml:
[[kv_namespaces]]
binding = "LEADS"
id = "<id from the first command>"
preview_id = "<id from the --preview command>"npm run devNote: the KV binding is only available under wrangler/the Cloudflare runtime. In plain
astro dev the API route logs submissions to the console instead of failing, so the form
still works for local testing — use npm run preview (after npm run build) to test
against the real Workers runtime and KV locally.
Fastest path — deploy directly from your machine:
npm run build
npx wrangler deploy- Push this project to a GitHub repo.
- In the Cloudflare dashboard: Workers & Pages → Create → Connect to Git, pick the
repo. Cloudflare will detect the Astro/Wrangler setup automatically (build command
npm run build, deploy useswrangler.toml). - Under the Worker's Settings → Bindings, confirm the
LEADSKV binding is present (it's created automatically fromwrangler.tomlon first deploy, or add it manually if needed). - Every push to your main branch redeploys the site.
npx wrangler kv key list --binding=LEADS
npx wrangler kv key get "<key>" --binding=LEADSOr bulk-export with npx wrangler kv key list --binding=LEADS --remote and a small script
looping kv key get — ask Claude for a one-off export script any time.
public/logo.png and the color/type choices in index.astro come from the brand kit
in the "أ / اميمة" Google Drive folder. The favicon is a small original SVG made to match
that palette (not pulled from the brand kit).