How to Build a Client Portal with Claude Code

How to build a client portal with Claude Code: scope it, set up Supabase auth and per-client security, build the pages, test access and deploy on Vercel.

Josh Pocock5 min read

Client portal cover

AI Coding

Client portal

Stride AI Academy

To build a client portal with Claude Code, scope three or four pages first, use Supabase for sign-in and data, write row level security policies so each client sees only their own records, have Claude build the pages, test the access rules with two test accounts, then deploy on Vercel.

Agencies build portals so clients can see their reports, leads, files or project status without asking by email. This walkthrough builds one for an automation agency: each client signs in and sees their own monthly results. The security details are checked against Supabase's row level security docs, October 2026.

The portal build, in order

  1. 1Scope the pagesThree or four, no more
  2. 2Tables and sign-inSupabase auth and a clients table
  3. 3Access rulesRow level security per client
  4. 4Build the pages
  5. 5Test with two accountsClient A must never see client B
  6. 6Deploy

Step 1: Scope it small

Write the scope before opening Claude Code. A first version that clients actually use:

  1. Sign in with an emailed link
  2. Overview: this month's numbers (leads answered, appointments booked, messages sent)
  3. Reports: past monthly reports to read or download
  4. Requests: a form to ask for a change, which creates a task for your team

Leave out chat, billing and file uploads for version two. Each one adds security work.

Step 2: Set up the data and sign-in

Ask Claude Code to propose the schema (see the Claude Code + Supabase tutorial for connecting the database safely):

Design Supabase tables for a client portal for an automation agency.
- clients: id, name
- client_members: links a signed-in user (auth.users id) to a client
- monthly_results: client_id, month, leads_answered, appointments_booked,
  messages_sent
- reports: client_id, month, title, file path
- requests: client_id, created_by, body, status
Write it as a migration. Don't apply it yet.

The client_members table is the key piece. It says which signed-in user belongs to which client, and every access rule hangs off it.

Step 3: Write the access rules

Turn on row level security for every table. Supabase's docs warn that a table in an exposed schema without it is readable and writable by any role with a grant on it.

sql
alter table public.monthly_results enable row level security;

Then a policy so a signed-in user only sees results for clients they belong to:

sql
create policy "Members can view their client's results"
on monthly_results for select
to authenticated
using (
  client_id in (
    select client_id from client_members
    where user_id = (select auth.uid())
  )
);

Ask Claude to write the equivalent policies for every table and operation, then read each one and ask "who can see this row?". Clients should be able to read their own results and reports and create requests, but not edit results or see other clients.

Step 4: Build the pages

With the data and rules in place, describe the pages:

Build the portal as a Next.js app using Supabase auth with email sign-in
links. Pages: sign in, overview (this month's numbers as large cards and
a 6-month trend), reports (list with download links), requests (form plus
a list of past requests with status). Use only the publishable Supabase key
in the browser. Use plan mode first and show me the plan.

Use plan mode for this step: review the plan before Claude writes the pages. Ask for plain, readable pages. Clients open a portal to find one number quickly.

Step 5: Test the access rules properly

This is the step that protects your clients. Create two test clients and a test user for each, then sign in as each user and check:

  • Client A's user sees only client A's results, reports and requests
  • Changing an ID in the URL doesn't show client B's data
  • A signed-out visitor sees nothing but the sign-in page
  • A client user can't edit their results

Ask Claude Code to write automated tests for these too, so a later change can't quietly break them. Supabase's docs also describe testing policies with supabase test db.

Step 6: Deploy and connect your automations

Deploy on Vercel (deploy guide) and add the custom domain, such as portal.youragency.com. Then have your automations write their monthly numbers into monthly_results, using the secret key from server code only. The portal fills itself from then on.

Keys and safety

  • The browser only gets the publishable key, which row level security restricts
  • The secret (service role) key bypasses row level security, so it stays in server code and environment variables. Supabase's docs say never to use it in the browser.
  • Store files in storage buckets with their own access policies, not public links
  • Remove a user's access when they leave the client's team

Is a portal worth it?

For agencies on retainers, often yes: it puts the value of your work in front of the client every time they log in, which supports client retention. For a single small client, a monthly email report may be enough.

Learn to build with Claude Code

The Stride AI Coding course teaches Claude Code and Codex for building client tools and shipping them with GitHub, Vercel and Supabase, written for non-programmers, with weekly live calls. Many of the free guides walk through specific builds.

FAQ

Can Claude Code build a client portal?

Yes. Claude Code can design the database, write the access rules and build the pages from a clear description. You still need to scope it, review the plan, read the access policies and test them with separate accounts before any client uses it.

How do I make sure clients only see their own data?

Use row level security in the database, not just checks in the page code. Link each signed-in user to their client in a membership table, write a policy on every table that filters by that link, and test it by signing in as two different clients.

What should a first client portal include?

Keep it to sign-in, an overview of this month's numbers, past reports and a form to request changes. Add chat, billing and file uploads later, since each adds security work.

How long does it take to build a client portal with Claude Code?

It depends on the scope and how much you test. A small portal with sign-in and three pages can be built quickly, but budget real time for reviewing the access rules and testing them, since that's what protects your clients' data.

Build it with us in Stride AI Academy

Four courses, weekly live calls and a community of people building and selling AI. Or start with 320+ free guides.

Keep reading

Free AI Coding guides