The problem
Most client portals assume one login per client. But real clients are companies: the owner approves and pays, while staff need to follow progress and pick up files. If everyone gets the same access, anyone can pay and anyone can see everything.
What I built
Each client is a company with two roles:
Owner: sees the company's projects, pays through Stripe Checkout, and downloads files.
Staff: sees the same projects and status, but there's no Pay button. The page says "Payment is made by your company's owner."
Once the owner pays, the project switches to Paid and the files unlock for everyone in the company, staff included.
The admin creates projects, sets amounts, uploads files, and invites owners and staff from one screen.
57-second walkthrough: the owner pays with a Stripe test card, the project turns Paid, and the file downloads.

Owner's view: one unpaid project and three paid ones.

Owner's project page, with the Pay $480 button.

Staff see the same project, but no Pay button.

After the owner pays, staff see Paid and can download the files.

Admin: create projects and invite owners and staff.
Access rules live in the database
Who can see what is enforced with Supabase Row Level Security, not just hidden in the UI. If a staff member types another company's project URL, the database returns nothing. Unpaid files can't be downloaded, even with a direct link.
Payments that don't double-count
A project becomes Paid only when Stripe's webhook confirms the payment. Every webhook event is recorded once, so if Stripe sends the same event twice, the second one is ignored.
Sign-in emails from a real domain
Clients sign in with a magic link sent from a custom domain through Resend, instead of Supabase's default sender (which only allows a few emails per hour). On a client project, this would be the client's own domain.
How I tested it
273 automated checks on which role can read which rows and columns
Then the whole flow by hand: inviting an owner and staff, creating a project, the staff view before payment, the owner's payment with a Stripe test card, the webhook, Paid status, staff downloading after payment, and status emails to both people in the company
Cross-company access tested by typing URLs directly: blocked at the database
Stack
Next.js, Supabase, Stripe Checkout and webhooks, Resend, Vercel.
The live demo runs in Stripe test mode. No real payments are processed.
0 likes · 1 view · Nov 16, 2026
A B2B client portal where each company's owner pays invoices through Stripe and staff can only view. Access rules live in the database, tested end to end.