Lesson 9 of 110 of 6 steps

Lesson 9 · about 25 minutes

Private by default, public when you want

Your app holds things that matter to someone: a baby's feeds, a club's members, customers' bookings. This lesson makes sure only the right people see it, nothing tracks them, and they can take their data with them or delete it.

Server-side checks on every request, rate limits, a strict content security policy, no analytics by default, export and real delete, a plain-words privacy page, and what changes when strangers sign up or pay.

The server checks every request: who's asking, what role they have, and whether it's their data. Add rate limits, a strict content security policy with your own copies of fonts and scripts, and secrets stored with wrangler secret. Health checks count totals rather than watching people. Export gives people everything, delete really removes it everywhere, and a test keeps the privacy page honest.

How much have you built before?
This lesson's wording changes to match.
FreePrivate by default
🔒
Your log

You · your partner · anyone you invite
Nobody else.

What you'll make

  • Data only the right people can see
  • No tracking you didn't ask for
  • Export everything, and a delete that really deletes
  • A privacy page anyone can understand

You'll need: an app with sign-in (lesson 5).

1

Who can see what

Write it down in a sentence, then ask your agent to check the app does exactly that and no more.

Say to your agent
Check that only my partner and I can see and change our log, family can only look, and nobody else can see anything. Show me how you checked.
2

The server decides, every time

Hiding a button isn't protection. It's like taking the sign off a door but leaving it unlocked. Every request to the server is checked: who's asking, are they allowed, is this their data. Bad input is refused, and things like sign-in attempts are limited.

Never trust ids or roles from the client; rate-limit sign-in, invites and anything that sends email; keep a strict CSP and self-host fonts and libraries.

Is my app's code a secret?
Your app's page code can be seen by anyone who opens it; that's normal for the web. Secrets (API keys, passwords) must never be in it: your agent stores them as Cloudflare secrets, not in your files.
3

No tracking

Your app doesn't need to watch people to work. If you want to know it's healthy, count totals across everyone (how many entries this week), never one person's activity, and send yourself private error reports without their contents.

Say to your agent
No analytics or tracking. Add a private error report that tells me what broke, without any of the user's data.
4

Export and delete

Say to your agent
Add Export (everything, as a file I can open) and Delete everything, which really removes it: entries, photos, sign-ins and notifications.

Lesson learned: test the delete on a made-up account and check nothing is left behind, including uploaded files.

5

A privacy page in plain words

What's stored, where, who can see it, for how long, and how to delete it. Short, honest, and kept up to date as the app changes.

Say to your agent
Write a short privacy page in plain words, and keep it in step with what the app really stores.

If your app shows health or safety advice, it should quote a named source (like the NHS) closely, link to it, and say it isn't affiliated with them.

6

Opening it up: public pages, sign-ups, payments

Ready for strangers to sign up, or to charge? More things matter: terms and a privacy policy, a support email, limits against abuse, Workers Paid for email, and a payment provider such as Stripe.

Say to your agent
I'd like anyone to be able to sign up, with a paid plan. Mock up the sign-up and pricing pages first, and tell me what else I need before going public.
Can my agent tell me what I legally need?
It can list the usual things and point you to official guidance, and should check prices and rules against the providers' own pages. For anything legal or tax-related, check with a professional.
Lesson 9 doneYou just made sure only the right people see the data, and nothing tracks them.
Next up · lesson 10, about 20 minutesYour own address, like yourapp.com, without breaking anyone's install.

Did it work?

Tick these off. They're saved in this browser, so you can come back later.

  • Only the people I chose can see my app's data
  • There's no tracking I didn't ask for
  • I can export everything, and delete really deletes
  • My app has a short, plain privacy page