Right now your project is a single index.html, online with Vercel — but it's still just a static page. Today we wire three real things onto it: your own domain, a backend that can store data, and an AI brain. By the end it stops being a page and starts being a real app.
The backend matters most for you: it lets you collect every visitor's input in one place — exactly what your user research needs. The AI gives your page a brain. And one rule runs through all of it: your keys are passwords — never let them leak.
Every step is a prompt you can copy — drop it into Codex or Cursor. Keep this page open all class. Stuck? Mia is here.
01 · Today
Thing 1Your own domainConnect the Cloudflare domain you bought yesterday to your Vercel site. No more long vercel.app address.
Thing 2A backend that stores data — SupabaseMove data out of the browser into a real database, so every user's input lands in one place. This is what powers your research.
Thing 3An AI brain — DeepSeekAdd real AI to your page — generate a personalized reply, a summary, whatever your project needs.
The ruleKeep your keys safeA leaked API key costs real money. We end the class on exactly how not to leak yours — this part is not optional.
02 · Connect your domain
Yesterday you bought a domain on Cloudflare. Now we point it at your Vercel site so your project lives at your address, not a long vercel.app one. The flow: Vercel gives you one DNS record, you paste that record into Cloudflare, you wait a few minutes. Let AI walk you through it step by step:
我昨天在 Cloudflare 买了一个域名,现在想把它接到我已经部署在 Vercel 上的网站,让网站用我自己的域名打开。请一步一步带我做,每一步告诉我点哪里、填什么:
1. 在 Vercel 上打开我这个项目 → Settings → Domains,把我的域名输进去点 Add。
2. Vercel 会给我一条 DNS 记录(类似一个 A 记录或 CNAME)。告诉我这条记录长什么样、要复制哪几个值。
3. 带我去 Cloudflare 后台,找到这个域名的 DNS 设置,把 Vercel 给的那条记录加进去。
4. 加完等几分钟生效,然后我用自己的域名打开网站确认能访问。
我是零基础,请用最直白的话讲,不要假设我知道 DNS 是什么。每一步做完我会回来跟你说结果,你再带下一步。
Didn't buy a domain? No problem — skip this section and keep using your vercel.app address all class. Everything else today works exactly the same.
03 · What is MCP? (vs. a CLI)
A service like Vercel or Supabase can be driven from outside in a few ways — and you already know one: the CLI. When you ran git push or vercel, you typed a command and the service obeyed. git, gh (GitHub), vercel — these are command-line tools, made for a human to type. Fast and scriptable, but you have to know the commands.
MCP — Model Context Protocol — is the same idea, but for your AI. Instead of you typing commands, your coding AI (Cursor / Codex) plugs straight into the service and drives it from plain language. A CLI is a plug for a human; MCP is a plug for the AI. Today you plug Supabase into your AI and just say "make a table" — nothing to memorize.
CLIA human types commandsgit push, gh, vercel — you learn the commands and run them yourself in the terminal.
MCPYour AI plugs in and drives itYou say "create a table" in plain words; the AI talks to Supabase directly through the plug. No commands to remember.
Same goalThree ways up the same mountainGUI = you click · CLI = you type · MCP = your AI does it for you. All three let "the outside" operate a service.
04 · Add a backend with Supabase
Supabase is a ready-made backend — a database plus an API, out of the box. Right now your page probably saves things in the browser's localStorage, which means each user's data is stuck on their own device and you can never see it. We fix that: move the data into Supabase so everyone's input lands in one place you can read — the foundation of your user research. First, set up the Supabase MCP plug.
Everyone — whether you use Codex or Cursor — start at the official guide and pick your tool: supabase.com/docs/guides/ai-tools/mcp. It shows the exact config for your editor (Cursor even has a one-click "Add to Cursor"). Then paste this so your AI finishes the wiring:
Plug connected. Now let AI use it — create a table for your research data, and rewrite your page to save into Supabase instead of the browser:
现在 Supabase MCP 已经接好了。请通过 MCP 帮我做两件事:
① 建一张表,用来存我网站收集的用户反馈 / 研究数据。先读我的 index.html,看看我现在收集了哪些字段(比如用户的输入、选择、留言),据此设计表的字段;再帮我建表,并给每条记录自动加上时间戳。
② 改我的网页:我现在的数据是存在浏览器 localStorage 里的,只能存在用户自己设备上,我收不到。把它改成提交到 Supabase 这张表里——这样不管谁在哪台设备打开我的网站,填的数据都会汇总到我这一个地方,方便我后面做用户研究统计。
改完告诉我怎么在 Supabase 后台看到收上来的数据。每一步做完跟我确认,别一次全改完。
05 · Give it an AI brain — DeepSeek
Now the brain. DeepSeek is a chat AI you can call from your page — to generate a personalized reply from what a user typed, summarize their answers, whatever your project needs. The prompt asks AI to read DeepSeek's official docs and wire up the simplest working version. Fill in one sentence describing your AI feature, and paste your key where shown:
请阅读 https://api-docs.deepseek.com 的官方文档,帮我在我的网页里接入 DeepSeek 的对话 API,实现[一句话描述你的 AI 功能]。先用最简单的方式让它在本地跑起来,能调通、能看到 AI 返回的结果就行。我的 API key 是 <课上老师发的 DeepSeek API Key>。
Hold on — this key is dangerous. While testing, fill the key in locally only. The moment it runs, stop there. Do NOT git push, do NOT deploy any version with the key in it. The next section is exactly how to put this online safely — wait for it.
06 · Keep your keys safe
This is the section that matters most today, so we go slow. An API key is a password. If it leaks, someone uses your key and you pay the bill. Three hard rules:
Rule 1Never push it to GitHubGitHub auto-scans every push for keys. A leaked key gets found in minutes and drained — real money, your money.
Rule 2Never hard-code it in front-end HTML/JSAnything in your page is visible to anyone who presses F12. A key in your HTML is a key you've published.
Rule 3To go live, hide it behind your backendMove the key behind a backend you own — a Vercel Serverless Function (or a Supabase Edge Function). Your page calls your backend; your backend calls DeepSeek with the key read from a server-side env var. The key never reaches the browser.
Here's how to do Rule 3. Since you deploy on Vercel, the smoothest path is a Vercel Serverless Function: drop one file in your repo (api/chat.js), put the key in Vercel's Environment Variables, and your page calls /api/chat instead of DeepSeek directly — so the key lives on the server, never in your HTML. (Already deep in Supabase? A Supabase Edge Function does the exact same job; the prompt covers both. Note: putting a key in Vercel's env only helps because a function reads it server-side — a key in a plain static page is still exposed.)
A lot of words flew by today. Here's the whole map on one screen — when you build it (you + your tools) and when people use it (data flowing through your app):
■ WHEN YOU BUILD IT
──────────────────────────────
You
│
├─ CLI ──▶ git · gh · vercel
│ (you type commands)
│
└─ plain talk ──▶ Coding AI (Cursor / Codex)
│ writes your site
└─ MCP ──▶ Supabase
(AI builds your tables)
■ WHEN PEOPLE USE IT
──────────────────────────────
User
│ opens
▼
Frontend · index.html, in the browser
│ calls API
▼
Backend · Vercel function, on the server, hides the key
│ calls API
▼
DeepSeek · the AI running inside your product
The one people mix up: two different AIs. The coding AI (Cursor / Codex) builds your house; DeepSeek is the assistant living inside it. One line each:
FrontendWhat users see and clickYour index.html, running in their browser.
BackendCode on a server, hidden from usersHides keys, holds the database, calls outside AIs.
APIHow one program asks anotherfrontend → backend and backend → DeepSeek both go through APIs.
Coding AIBuilds the site — Cursor / CodexHelps you write it. Not inside the finished product.
Runtime AILives inside the product — DeepSeekCalled live while a user is using your page.
MCPA plug for the AILets the coding AI operate a service (Supabase) for you.
CLICommands for a humanYou type them in a terminal — git push, gh, vercel.
08 · Leave with
Homework 1Connect your domain (if you bought one)Point your Cloudflare domain at Vercel so your project opens at your own address. Didn't buy one? Skip it.
Homework 2Store your data in SupabaseMove your page off localStorage so every user's input collects in one place — ready for your research.
Homework 3Get one simple DeepSeek feature working locallyThe smallest possible AI feature, running on your machine. Worry about going live after it works.
Homework 4Confirm no key got pushedCheck your repo: not in any file, not in your commit history. If you're unsure, ask before you push.
09 · Before you go — class feedback
Two minutes, every class. Tell us what landed and what didn't — it directly shapes next week's class.
Generation AI · Class Reflection & Feedback
Two minutes — your feedback goes straight to the teacher and shapes the next class. Thanks!