Chapter 1 · Session 1
Before you start: what you are building, in what order
You do not need to be a programmer. Claude Code writes the code; you decide what it is for, paste the prompts in this course, check what comes back and own the result. This chapter shows the whole build in the order you will do it, and sets up the names every later step uses.
15 min2 stepsNo installs yet
By the end of this chapter you can
- Say what each of the four services is for, in one sentence each.
- Follow the build order and say why each stage comes before the next.
- Enter your company's names once, so every prompt, command and address in the course is ready to copy.
How this course works
Every build step in this course has the same five parts. Why says what the step is for and what goes wrong without it. Do this gives you the exact text to paste: a prompt for Claude Code, a command for the terminal, or a web address to open, each with a Copy button. You will see shows the screen you should get, recreated so it stays readable. Check it worked says how to tell. If it goes wrong lists the problems we actually hit building the CivOps platform, and the fix for each.
You will rarely type anything yourself. Copy, paste, read what comes back, and compare it with the screen in the lesson. When they match, tick Done and move on. When they do not, open If it goes wrong before trying anything else: most problems are already there.
The four services, and what each one is for
| Service | What it is for | Who owns it | Plan you need |
|---|---|---|---|
| GitHub | The code, every change to it, and the tests that must pass before a change is accepted | The company, with two owners | Team ($4 per user per month): the free plan cannot protect a private repository |
| Supabase | The database: every record, who may read it, and sign-in | The company, with two owners | Free to build; Pro ($25 a month) before the plant depends on it |
| Vercel | Builds the website from GitHub and runs it at an address | The company, with two owners | Pro ($20 per user per month): the free plan is for non-commercial use only |
| Claude Code | The developer: reads your prompts and writes, tests and explains the code | A company seat | A Claude plan that includes Claude Code, bought by the company |
The build order
The order is not a teaching choice. Each stage needs what the one before it made, and doing them out of order is the main cause of rework. This is the order the whole course follows:
| Sessions | What you make | Why it comes here |
|---|---|---|
| 1. Set up (this session) | Accounts, keys, your computer, an empty live website | Everything else is stored, built and run here |
| 2. Intent | One page: the decision the platform serves | Without it, nothing tells you or the agent what to build |
| 3. Directing the agent | Briefs, checks first, reading a change | You use it in every later session |
| 4. Names | The naming standard for sites, lines, equipment and measures | Tables, addresses and screens are named from it |
| 5. Schema | The tables, committed before any screen | Every screen, report and rule is built on the tables |
| 6. Test data | Realistic made-up data in every table | Screens and tests need data before real data flows |
| 7–9. Roles and access | The role matrix, access rules on every table, sign-in that denies by default | Rules need tables to protect, and must exist before people sign in |
| 10. Quality checks | The ten checks every change must pass | From here on, agents work faster than you can read |
| 11. First real deploy | Migrations on deploy, previews, rollback, backups | Ship early so every later session is tested where it runs |
| 12–15. Screens | Operator, supervisor and manager screens, the first workflow, the dashboard | Now there is data, access and a pipeline to build on |
| 16–17. Many agents | Splitting the work across agents, overnight builds | Only safe once checks and access rules exist |
| 18–21. Prove it | Security tests, the testing protocol, plant connectivity, the IT package | Proof needs a finished system to test |
| 22–23. Go live | The cost case, handover, runbook, restore drill | The last step is showing someone else can run it |
Agree who owns what, before anyone signs up
10 minutesWhy
The costliest mistake in plant software is finding, years later, that the code is in a contractor's account, the database is on someone's personal card and the person who set it up has left. Deciding owners first means every account is created in the company's name, once, and never has to be moved.
Do this
Get two people to agree, in writing (an email is enough):
- Owner one (pat@acme.com) and owner two (sam@acme.com): both get full control of every account. Two, so the platform never depends on one person.
- The company password manager where every account password, recovery code and key is kept. Use the one your IT department already runs. If there is none, ask IT before choosing one.
- The company card that pays for the accounts, and who approves spending.
- Work email addresses only. Every account is opened with a acme.com address, never a personal one.
Send this, so the decision is written down and IT hears about it before anything is created, not after:
To: sam@acme.com; IT
Subject: Ownership of the Acme Bottling platform accounts
We are setting up the accounts for the Acme Bottling platform (Cleveland first). Before anything is created, please confirm:
1. Owners: pat@acme.com and sam@acme.com, both with full control of every account.
2. Accounts, all opened with acme.com addresses: GitHub organisation acme-ops, Supabase organisation Acme Bottling, Vercel team acme-ops, Claude seats for both owners.
3. Passwords, recovery codes and keys: kept only in the company password manager, in a vault shared by both owners. Never in email, chat or files.
4. Payment: the company card, approved by <name>.
5. IT: is there anything you need from us before we create these accounts?
Reply "agreed", or tell us what to change.You will see recreated screen
| Item | Kind | Added by |
|---|---|---|
| GitHub: acme-ops (owner one) | Login + recovery codes | pat@acme.com |
| GitHub: acme-ops (owner two) | Login + recovery codes | sam@acme.com |
| Supabase: acme-platform-prod database password | Password | pat@acme.com |
| Vercel: acme-ops | Login + recovery codes | pat@acme.com |
- The vault is shared by both owners. You will add these items as you go; it starts empty.
Check it worked
Both owners have agreed by email, both can open the shared vault, and you know which card pays.
If it goes wrong
IT says the company does not allow cloud services
Stop here and ask IT what is allowed. The IT approval package (Session 21) explains how the platform is placed and protected; IT may want to read it now. Building on accounts IT later refuses means building twice.
Only one person is available
Set up as owner one now, but do not go past Step 17 until a second owner exists. Everything in this course assumes two.
Enter your names once
5 minutesWhy
Every prompt, command and web address in this course has your company's names in it. Typing them once here means you never edit a command by hand, which is where most copy-and-paste mistakes come from. The names follow the naming standard you will write in Session 4: lower case, letters, digits and hyphens.
Do this
Fill in what you know. Leave the rest blank: blank fields show an example (underlined with dots) or are worked out from the others. You will fill in the Supabase reference and live address later, when those services give them to you.
Saved with your progress. Every prompt, command and address in the course now uses these names. Change them any time from Your names at the top of the page.
You will see recreated screen
- What you typed.
- Worked out from it. Type over it if you want something else.
Check it worked
The repository name in this sentence is yours, not an example: acme-platform. If it is underlined with dots, it is still an example.
Fastest path
Use Copy my names in the Your names panel (top of the page) and paste them into the first lesson you open on another computer or in your company's learning system. Lessons on the same site share them automatically.
If it goes wrong
My names disappear when I come back
Your browser may be clearing site data (private browsing, or a company setting). The names are also saved with your progress in your company's learning system. If both are lost, use Copy my names and keep the text in your notes.
Knowledge check
Why does the course build the schema before any screen?
Knowledge check
Where may a database password be pasted?
References
- GitHub Docs: About organizations. https://docs.github.com/en/organizations/collaborating-with-groups-in-organizations/about-organizations
- Claude Code docs: Overview. https://code.claude.com/docs/en/overview
- Supabase Docs: Architecture. https://supabase.com/docs/guides/getting-started/architecture
Chapter 2 · Session 1
Accounts in the company's name
Four accounts, each opened with a company email, each with two owners and two-step sign-in, each with a spending limit. About 30 minutes, all in the browser.
30 min4 stepsBrowser only
By the end of this chapter you can
- Create the GitHub organisation on the Team plan and require two-step sign-in.
- Create the Supabase organisation and project, with the password in the company password manager.
- Create the Vercel team and the company's Claude seats.
- Set a spending limit on every paid service.
Create the GitHub organisation
10 minutesWhy
GitHub holds the code and every change ever made to it. An organisation (not a personal account) means the code belongs to the company, survives any one person leaving, and can require two-step sign-in for everyone. The Team plan is needed because the free plan cannot protect a private repository, and protection is what makes it safe to let an AI agent propose changes.
Do this
https://github.com/account/organizations/new?plan=team
Sign in with your acme.com address first. Organisation name: acme-ops. Contact email: pat@acme.com. Choose My company or institution and enter Acme Bottling.
Then require two-step sign-in for every member:
https://github.com/organizations/acme-ops/settings/security
Tick Require two-factor authentication for everyone in the acme-ops organization and save.
Then invite owner two with the Owner role:
https://github.com/orgs/acme-ops/people
Choose Invite member, enter sam@acme.com, choose Owner.
You will see recreated screen
- Tick this. Members without two-step sign-in are removed until they turn it on, so tell owner two first.
Check it worked
The organisation page shows Team as the plan, two people with the Owner role, and two-step sign-in required.
If it goes wrong
The name acme-ops is taken
GitHub organisation names are unique worldwide. Pick another (for example add the site code: acme-cle-ops), then change GitHub organisation in Your names. Every later command updates.
Owner two never got the invitation
Invitations go to the email on their GitHub account, which must exist first. Ask them to create a GitHub account with their acme.com address and turn on two-step sign-in, then invite them again.
Someone lost their phone and cannot sign in
This is why recovery codes go in the password manager the day two-step sign-in is turned on. Download them from https://github.com/settings/security and store them now.
Create the Supabase organisation and project
10 minutesWhy
Supabase is the database. Every record the plant creates lives here, and Supabase enforces who may see each record. It is created now, before any code, so the company owns the data from the first row. The region decides where the data physically sits: pick the one nearest the plant so screens are fast and the data stays in the country IT expects.
Do this
https://supabase.com/dashboard/sign-up
Sign up with your acme.com address (not "Continue with GitHub": the account should not depend on one person's GitHub login).
https://supabase.com/dashboard/new
Create an organisation called Acme Bottling, type Company. Then create a project: name acme-platform-prod, region nearest Cleveland.
On the Database password field, choose Generate a password, then copy it straight into the password manager as Supabase: acme-platform-prod database password before you press Create new project. You will not be shown it again.
When the project is ready, look at the address bar. The 20 letters after /project/ are the project reference. Type them into Supabase project reference in Your names, and the region into Supabase region.
https://supabase.com/dashboard/project/abcdefghijklmnopqrst/settings/general
This should open your project's settings. If it says the project does not exist, the reference in Your names is wrong.
You will see recreated screen
- Generate it, then copy it into the password manager now.
- Nearest the plant. It cannot be changed later without moving the database.
You will see recreated screen
- Copy this into Your names. Every Supabase address in the course uses it.
Check it worked
The settings link above opens your project, and the database password is in the password manager.
Fastest path
Invite owner two now while you are here: Organization settings, then Team, then Invite, role Owner.
If it goes wrong
I did not save the database password
Reset it: Project Settings, then Database, then Reset database password. Put the new one straight into the password manager. Nothing else uses it yet, so nothing breaks.
A free project stopped working after a week
Free projects pause after a week with no activity. Restore it from the dashboard. Move to Pro before anyone in the plant relies on it.
Create the Vercel team
5 minutesWhy
Vercel turns the code in GitHub into the website people use, and rebuilds it every time a change is accepted. A company team on the Pro plan is needed because the free Hobby plan is for non-commercial use only. Everyone who will approve changes must be a member, or Vercel will refuse to build their changes.
Do this
Sign up with your acme.com email address and choose the Pro plan for a team named acme-ops. When asked to connect a Git provider, choose GitHub and allow access to the acme-ops organisation only.
https://vercel.com/teams/acme-ops/settings/members
Invite sam@acme.com with the Owner role.
You will see recreated screen
- Choose only the platform repository once it exists, or all repositories in acme-ops if this organisation holds nothing else.
Check it worked
The team page shows acme-ops on Pro, with two owners.
If it goes wrong
Vercel asks to install on my personal GitHub account
Choose the acme-ops organisation in the account picker. If it is not listed, you are not an owner of it yet: finish Step 3 first.
Company Claude seats, and spending limits everywhere
5 minutesWhy
Claude Code needs a Claude plan that includes it. Buying it as the company means the company controls who has a seat and what is spent, and work done on the platform is not tied to someone's personal subscription. Spending limits on every service mean a mistake (an agent stuck in a loop, a forgotten test project) costs a known, small amount.
Do this
Choose a plan that includes Claude Code, bought by the company. Add seats for both owners.
Then set a limit in each paid service:
- Supabase: Organization settings, Billing, Spend cap on.
- Vercel: acme-ops/settings/billing" href="https://vercel.com/teams/acme-ops/settings/billing" target="_blank" rel="noopener">Team settings, Billing, Spend Management: set a monthly amount and turn on the notification.
- Claude: the organisation's admin settings: set a usage or spend limit if your plan offers one.
You will see recreated screen
- On. Record the amount you chose in docs/KEYS.md in Step 13.
Check it worked
Each paid service shows a limit, and both owners have a Claude seat.
If it goes wrong
We already pay for Claude personally
Fine for learning, but move the platform's work to a company seat before Step 10. Code an agent writes belongs to whoever directs it under their agreement; keep that the company.
Knowledge check
Why is the GitHub organisation put on the Team plan rather than the free plan?
Knowledge check
When should the Supabase database password go into the password manager?
References
- GitHub Docs: Requiring two-factor authentication in your organization. https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-two-factor-authentication-for-your-organization/requiring-two-factor-authentication-in-your-organization
- GitHub Docs: About protected branches (plan availability). https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches
- Supabase: Pricing and spend cap. https://supabase.com/pricing
- Vercel Docs: Fair use and the Hobby plan. https://vercel.com/docs/limits/fair-use-guidelines
- Vercel Docs: Spend management. https://vercel.com/docs/spend-management
Chapter 3 · Session 1
Your computer and Claude Code
Four free programs, one repository, and the guard rails that keep Claude Code safe: written in one prompt and accepted through your first pull request.
30 min4 stepsMac or Windows
By the end of this chapter you can
- Install Git, Node.js, the GitHub command-line tool and Claude Code, and check each one.
- Create the repository from the terminal and protect its main branch.
- Have Claude Code write the guard rails: what it may never read, never run and must always do.
Install the four tools
15 minutesWhy
Git keeps track of every change to the code. Node.js runs the tools the platform is built with. The GitHub command-line tool (gh) lets Claude Code open pull requests for you, which removes most of the back and forth between the terminal and the browser. Claude Code is the developer you direct.
Do this
On a Mac, paste these one at a time. The first opens a window asking to install developer tools: choose Install and wait for it to finish.
xcode-select --install/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"brew install node ghcurl -fsSL https://claude.ai/install.sh | bashOn Windows, paste these into PowerShell one at a time:
winget install --id Git.Git -e; winget install --id OpenJS.NodeJS.LTS -e; winget install --id GitHub.cli -eirm https://claude.ai/install.ps1 | iexClose the terminal window and open a new one, so it finds the new programs. Then check all four at once:
git --version; node --version; gh --version; claude --versionYou will see recreated screen
Check it worked
Four version numbers and no "command not found". Node's number starts with 20 or higher.
If it goes wrong
command not found: claude (or brew, or gh)
Close every terminal window and open a new one; programs installed a moment ago are only found by new windows. On a Mac, if brew is still not found, run the two lines Homebrew printed under Next steps at the end of its install.
npm or the installer fails with a certificate or proxy error
Your company network inspects web traffic. Do not turn security checks off. Ask IT for the company certificate and proxy settings for developer tools; send them this page.
winget is not recognised
Install App Installer from the Microsoft Store, or ask IT to install Git, Node.js LTS and GitHub CLI for you.
Sign in, and create the repository from the terminal
5 minutesWhy
Signing the GitHub tool in once lets both you and Claude Code create repositories and pull requests without copying any token. Creating the repository from the terminal makes it, connects it to your computer and puts it in the right folder in one command.
Do this
gh auth login --web --git-protocol httpsIt prints a one-time code and opens the browser: paste the code, choose Authorize, and allow the acme-ops organisation. Then create the repository and its folder:
mkdir -p ~/code && cd ~/code && gh repo create acme-ops/acme-platform --private --add-readme --clone && cd acme-platformNew-Item -ItemType Directory -Force ~/code | Out-Null; cd ~/code; gh repo create acme-ops/acme-platform --private --add-readme --clone; cd acme-platformYou will see recreated screen
Check it worked
acme-ops/acme-platform" href="https://github.com/acme-ops/acme-platform" target="_blank" rel="noopener">github.com/acme-ops/acme-platform opens and shows one file, README.md.
If it goes wrong
GraphQL: pat@acme.com does not have the correct permissions to execute CreateRepository
Run gh auth refresh -h github.com and, in the browser, grant access to the acme-ops organisation (the Grant button next to it). Then run the create command again.
Name already exists on this account
Someone already created it. Use gh repo clone acme-ops/acme-platform ~/code/acme-platform instead, then cd ~/code/acme-platform.
Protect the main branch
5 minutesWhy
The main branch is the code that runs the plant's website. Protecting it means no change reaches it without a pull request, a passing check and a person saying yes. This is the setting that makes it safe to let Claude Code write code: it can propose anything, and nothing lands unreviewed.
Do this
https://github.com/acme-ops/acme-platform/settings/rules/new?target=branch
New branch ruleset. Name: protect main. Enforcement: Active. Target branches: Include default branch.
Tick Restrict deletions, Require a pull request before merging (1 approval), Block force pushes. Leave Require status checks to pass for Session 10, when the checks exist. Press Create.
You will see recreated screen
- Active, not Evaluate: Evaluate only reports.
- One approval: the person who did not write the change.
- Turned on in Session 10, once there are checks to require.
Check it worked
Rules shows protect main as Active. On your computer, git push origin main now fails with "protected branch": that failure is what you want.
If it goes wrong
Rulesets are not available, or the rule saves but does not apply
The organisation is on the free plan. Upgrade at https://github.com/organizations/acme-ops/settings/billing and come back.
A change reached main even though a check was red
The ruleset is not Active, or someone is allowed to bypass it. Only owner one should be on the bypass list. In Session 10, a CODEOWNERS file also names who must review the database and sign-in folders.
I am the only reviewer, so I cannot approve my own pull request
Correct, and intended. Owner two approves. Until owner two has access, you can set approvals to 0 and set it back to 1 at Step 17.
Start Claude Code and have it write the guard rails
10 minutesWhy
Claude Code reads a file called CLAUDE.md at the start of every session; it is where the platform's standing rules live, so you do not repeat them in every prompt. A settings file stops it from reading the files that hold keys and from running commands that change the live database. We learned this the hard way: a "reset the database" command, run to fix a small error, used the everyday login and wiped a shared database. Writing them first means every later session starts safe. One prompt does all of it and opens the pull request, which is much faster than creating each file yourself.
Do this
cd ~/code/acme-platform && claudeThe first time, Claude Code asks you to choose a colour theme, then to sign in: choose Claude account with subscription and sign in with your company seat in the browser. It then asks whether you trust the files in this folder: choose Yes (it is your repository). Then paste:
You are setting up the repository for Acme Bottling's plant platform. I am not a programmer: explain anything you need me to decide in plain words.
Create a branch called setup/guard-rails and add these files:
1. CLAUDE.md with the standing rules for every session:
- The platform serves Acme Bottling, site Cleveland (code cle). Read docs/INTENT.md before any task once it exists.
- Never read, print or ask me for keys, passwords or tokens. They live in Vercel, GitHub secrets and the company password manager. If something needs a key, tell me which setting needs it and I will enter it myself.
- Work on a branch and open a pull request with gh. Never push to main.
- Every change comes with a test that would fail without it. Run the tests before opening the pull request and show me the result.
- Explain each pull request in plain English: what changed, why, and how I can see it working.
2. .claude/settings.json that denies reading .env, .env.* and any *.pem or *.key file, and denies these commands: git push to main, git push --force, supabase db push, supabase db reset, vercel --prod.
3. .gitignore for a Node and Next.js project, including .env* (but not .env.example) and .vercel.
4. docs/KEYS.md: a register of every key and secret with columns Name, What it unlocks, Where it lives, Who holds it, Last rotated. Names and locations only, never values. Start it with the Supabase database password (in the company password manager, held by pat@acme.com and sam@acme.com).
5. .github/pull_request_template.md with three headings: What changed, Why, How to check it.
Commit, push the branch and open a pull request titled "Guard rails for working with Claude Code". Then show me the pull request link.You will see recreated screen
- The plan, ticked off as it goes.
- The deny list: Claude Code cannot read key files or run these commands, even if asked.
- Choose 1 (Yes) for a single command. Choose 2 only for commands you are happy to allow every time, like opening pull requests.
Check it worked
Pull request #1 is open on GitHub with five files. Open Files changed and read CLAUDE.md: it should say what the prompt asked, in plain words.
Fastest path
When Claude Code asks permission, option 2 ("don't ask again") is safe for read-only and pull-request commands (gh pr create, npm test). It saves dozens of interruptions later. Never choose it for commands that delete, push to main or touch the live database.
If it goes wrong
Claude Code asks me for a key or password
Answer: No. Keys are entered by a person in the website that needs them. Tell me which setting needs it. Then check CLAUDE.md says the same; if it does not, ask Claude Code to add it.
Claude Code pushed straight to main, or tried to
The branch rule from Step 9 refuses it. Say: Main is protected. Create a branch, push that, and open a pull request.
It stops and asks what to do next, again and again
Answer the question, then add: For the rest of this task, make reasonable choices yourself and list them in the pull request description. Questions about keys or deleting things are the exception: always answer those yourself.
Knowledge check
What is CLAUDE.md for?
References
- Claude Code docs: Set up Claude Code. https://code.claude.com/docs/en/setup
- Claude Code docs: Settings and permission rules. https://code.claude.com/docs/en/settings
- Claude Code docs: Memory and CLAUDE.md. https://code.claude.com/docs/en/memory
- GitHub CLI manual: gh repo create. https://cli.github.com/manual/gh_repo_create
- GitHub Docs: About rulesets. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets
Chapter 4 · Session 1
Keys, the first deploy and the two-person test
An empty website, live at the company's address, connected to the database without anyone copying a key, and proven to belong to the company because a second person can change it.
30 min7 stepsEnds with a gate
By the end of this chapter you can
- Have Claude Code create the empty app and merge it through a reviewed pull request.
- Connect Supabase to Vercel so the keys move between them without anyone copying them.
- Deploy, open it on a phone, and record every key in the register.
- Prove ownership: a second person changes the live site.
Review and merge your first pull request
5 minutesWhy
Every change to the platform arrives as a pull request: a proposed change you can read before it is accepted. Doing the first one now, on a harmless change, teaches the routine you will use hundreds of times.
Do this
https://github.com/acme-ops/acme-platform/pulls
Open pull request #1. Read the description, then the Files changed tab.
If everything matches what you asked for, owner two approves it (Review changes, Approve) and either of you presses Merge pull request. Then, in Claude Code:
The pull request is merged. Switch to main, pull the latest, and delete the setup/guard-rails branch locally.You will see recreated screen
- The approval from the person who did not ask for the change.
- Merge. The branch can be deleted afterwards.
Check it worked
The README and the five new files are on main at https://github.com/acme-ops/acme-platform.
If it goes wrong
Merging is blocked: review required
That is the rule from Step 9 working. Owner two approves; you cannot approve your own.
Create the empty app
10 minutesWhy
Before building anything useful, deploy something empty. It proves the whole chain works (your computer, GitHub, Vercel, Supabase) while there is nothing to break, so later problems are about the feature, not the plumbing.
Do this
Create a branch called setup/empty-app. Create a Next.js app with TypeScript, the App Router, Tailwind and ESLint in this folder, without interactive questions, keeping CLAUDE.md, docs/ and .claude/ as they are.
Add one page at / that says "Acme Bottling platform — Cleveland" and the date and time it was built. Add the Supabase client library (@supabase/supabase-js and @supabase/ssr) and a file .env.example listing the names of the Supabase variables the app will read, with no values.
Run the build and the lint, show me they pass, then commit, push and open a pull request titled "Empty app".You will see recreated screen
- The build passing before the pull request is the routine for every change from now on.
Check it worked
Pull request #2 exists and Claude Code showed the build passing. Do not merge it yet: Vercel will build it first in Step 14.
If it goes wrong
create-next-app refuses because the folder is not empty
Say: Create the app in a temporary folder and move its files in, keeping CLAUDE.md, README.md, docs/, .claude/ and .github/.
The build fails
Paste the last 30 lines of the error back with: The build fails with this. Find the cause, fix it, and run the build again before telling me it works.
Connect Supabase to Vercel, so nobody copies a key
5 minutesWhy
The website needs the database's address and keys. If a person copies them, they end up in chats, emails and laptops. Supabase's Vercel integration puts them straight into Vercel's protected settings and keeps them up to date, so the keys never pass through anyone's hands.
Do this
https://supabase.com/dashboard/project/abcdefghijklmnopqrst/settings/integrations
Under Vercel, choose Install (or Add new project connection), pick the acme-ops team, then the project acme-platform. If acme-platform is not listed yet, do Step 14 first and come back.
Then check what arrived, by name only:
https://vercel.com/acme-ops/acme-platform/settings/environment-variables
You should see the Supabase variables listed, with their values hidden.
And record them in the register:
On a new branch docs/keys, update docs/KEYS.md: add every environment variable name you can see with "npx vercel env ls" (names only, never values), what each unlocks, where it lives (Vercel, synced from Supabase by the integration), and who holds it (pat@acme.com and sam@acme.com). Mark any variable whose name contains SERVICE_ROLE or SECRET as "server only: must never be used in browser code". Open a pull request.You will see recreated screen
| Key | Value | Environments |
|---|---|---|
| NEXT_PUBLIC_SUPABASE_URL | •••••••• | All |
| NEXT_PUBLIC_SUPABASE_ANON_KEY | •••••••• | All |
| SUPABASE_SERVICE_ROLE_KEY | •••••••• | All |
| POSTGRES_URL | •••••••• | All |
- Names visible, values hidden. Variables starting NEXT_PUBLIC_ are meant to be seen by browsers; the others must stay on the server.
- Kept in step by the integration: if a key is rotated in Supabase, Vercel gets the new one.
Check it worked
Vercel lists the Supabase variables, and docs/KEYS.md lists the same names with no values.
If it goes wrong
A variable is listed but the feature still fails, or an email never arrives
The value is there but wrong: on our Academy, a key's value turned out to be the variable's own name, pasted in by mistake. When you type a value into Vercel or GitHub, paste the value only, never NAME=value. Session 10 adds a start-up check that names any missing or malformed key without printing it.
Claude Code tries to open .env.local to read the keys
The deny rule from Step 10 blocks it, which is correct. Say: Use npx vercel env ls for names only.
A key was pasted into a chat or committed by mistake
Treat it as public. Rotate it the same day: in Supabase, Project Settings, API Keys, create a new secret key and revoke the old one. The integration updates Vercel. Then note the date in docs/KEYS.md.
| Key or secret | What it unlocks | Where it lives | Who holds it | Never |
|---|---|---|---|---|
| Supabase database password | Full control of the database | Company password manager | pat@acme.com, sam@acme.com | Never in Vercel, a chat or a file |
| Supabase secret (service role) key | Reads and writes everything, ignoring access rules | Vercel (server only), synced by the integration | Nobody copies it | Never in browser code or a NEXT_PUBLIC_ variable |
| Supabase publishable (anon) key | What a signed-out visitor may do, which access rules limit | Vercel, synced | Public by design | Never treated as a secret, and never relied on for protection |
| GitHub sign-in (gh) | Creating branches and pull requests as you | Your computer's keychain, set by gh auth login | Each person their own | Never shared between people |
| Claude seat | Claude Code as you | Your computer, set by signing in | Each person their own | Never shared between people |
Deploy, and open it on your phone
5 minutesWhy
Importing the repository into Vercel makes every pull request get its own preview address, and every merge to main update the live site. Opening it on a phone proves it works for someone who is not at your desk.
Do this
Choose Import next to acme-ops/acme-platform. Leave the settings Vercel detects (Next.js) and press Deploy.
When it finishes, copy the address Vercel shows into Live address in Your names (it may have a suffix if the name was taken). Then go back to pull request #2: Vercel has added a preview link. Open it, check the page, then approve and merge.
https://acme-platform.vercel.app
Your live site. Open it on your phone too.
You will see recreated screen
- Ready means built and live.
- Copy this into Your names if it differs from what is shown.
You will see recreated screen
- Open the preview before approving. This is how every screen will be checked from now on.
Check it worked
https://acme-platform.vercel.app shows "Acme Bottling platform — Cleveland" on your phone, after pull request #2 is merged.
If it goes wrong
The build failed on Vercel but worked in Claude Code
Open the failed deployment, copy the last 40 lines of the build log and paste them into Claude Code with: The Vercel build fails with this but the local build passed. Find what differs (Node version, environment variables, files not committed) and fix it.
The build runs out of memory
We hit this as the platform grew. Ask Claude Code: The Vercel build is running out of memory. Check for large files or imports pulled into the build, and only raise the memory limit if that is not the cause.
The preview asks me to sign in to Vercel
That is Deployment Protection, on by default: previews are only for your team. Leave it on.
Get the keys onto your computer, the safe way
3 minutesWhy
Later sessions run the app on your computer, which needs the same variables. Pulling them with Vercel's tool writes them to a local file that Git ignores and Claude Code is forbidden to read, so they still never pass through a chat.
Do this
npx vercel login && npx vercel link --yes --project acme-platform --scope acme-ops && npx vercel env pull .env.localYou will see recreated screen
Check it worked
git status does not list .env.local. If it does, stop: the .gitignore from Step 10 is wrong.
If it goes wrong
git status lists .env.local
Do not commit. In Claude Code: git status shows .env.local. Fix .gitignore so every .env file except .env.example is ignored, without reading the file.
Turn off public sign-up
2 minutesWhy
A plant platform is not a public website. With sign-up on, anyone who finds the address can create an account. Off, people only get an account when an owner invites them. One switch closes a whole class of attack before there is anything to attack.
Do this
https://supabase.com/dashboard/project/abcdefghijklmnopqrst/auth/providers
Turn off Allow new users to sign up and save.
You will see recreated screen
- Off. Session 8 adds the access rules and Session 9 the invitations that go with them.
Check it worked
The switch is off after you reload the page.
The two-person test
5 minutesWhy
This is the proof that the platform belongs to the company. If a second person, on their own computer with their own sign-in, can change the live site, nothing depends on you alone. We found one problem only this test catches: Vercel refuses to build a change from someone who is not a member of the Vercel team.
Do this
Owner two, on their own computer, after Steps 7 and 8 (sign-in only: the repository already exists, so they clone it):
gh repo clone acme-ops/acme-platform ~/code/acme-platform && cd ~/code/acme-platform && claudeOn a new branch, change the home page so it also says "Owned by Acme Bottling". Run the build, then open a pull request.Owner one reviews the preview and approves; owner two merges. If you set approvals to 0 in Step 9, set them back to 1 now.
You will see recreated screen
- The second person's change, live, without your login.
Check it worked
The live site shows the second person's line, and their name is on the merge in GitHub.
If it goes wrong
Vercel says the deployment was blocked because the commit author is not a member of the team
Invite owner two to the Vercel team (Step 5), then use Redeploy on the blocked deployment.
Owner two cannot push: permission denied
They are not yet an owner of the acme-ops organisation, or have not accepted the invitation. Check https://github.com/orgs/acme-ops/people.
Knowledge check
Why connect Supabase to Vercel with the integration instead of copying the keys across?
Knowledge check
A second owner's change does not deploy and Vercel says the author is not a team member. What is the fix?
References
- Supabase Docs: Vercel integration. https://supabase.com/docs/guides/integrations/vercel-marketplace
- Vercel Docs: Environment variables. https://vercel.com/docs/environment-variables
- Vercel CLI: vercel env pull. https://vercel.com/docs/cli/env
- Vercel Docs: Deployment protection. https://vercel.com/docs/deployment-protection
- Supabase Docs: API keys. https://supabase.com/docs/guides/api/api-keys
Chapter 5 · 12 questions · 80% passes
Final assessment
Twelve questions across the session. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.
15 min12 questions≈ 15 minutesRetake allowed
Your result
CivOps AI Academy
Set Up: Your Accounts, Your Keys, Your Computer and an Empty Live Platform
Element F00 complete · Learner
Your LMS records this completion. For the CivOps Foundation certificate, finish the Foundation Course at https://civops.io/learn.