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.
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).
Who can see what
Write it down in a sentence, then ask your agent to check the app does exactly that and no more.
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?
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.
Export and delete
Lesson learned: test the delete on a made-up account and check nothing is left behind, including uploaded files.
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.
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.
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.
Can my agent tell me what I legally need?
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