Databases & Sign-in
Store data in tables, let people sign in, and protect each person's data.
- Suits
- Learners who have deployed a site (D3) and want apps that remember things. Every exercise uses a pretend database full of fictional robots, planets and pets.
- Before this
- Where it fits
- Level 4, Launcher (16+): Launch a real app and keep it running — deploy, domains, databases, mobile — and move it between tools without losing anything. This course is in Under the hood: The concepts and tools behind an app: files, front end and back end, data, APIs, Git, hosting and deployment.
What you'll be able to do
- Design simple tables with columns, rows, keys and relationships.
- Read, add, change and remove rows safely, with backups and checks before risky changes.
- Explain authentication (who you are) versus authorisation (what you may do), and what a session is.
- Explain file storage, public versus private files, and short-lived links.
- Describe row-level security and why every table needs rules, and why secret database keys stay on a server.
- Explain data minimisation: collect only what an app needs and delete it when it is no longer needed.
Lessons
1. Tables, rows and columns
25 minDesigning a simple database for a made-up robot club, with keys and relationships.
2. Reading and writing data
30 minSelecting, inserting, updating and deleting rows safely, with checks and backups.
3. Sign-in and sessions
25 minHow sign-in works, what a session is, and the difference between authentication and authorisation.
4. File storage
25 minStoring images and files, keeping private files private, and checking uploads.
5. Row-level security
30 minRules inside the database that make sure people can only see and change their own rows.
6. Collect less data
20 minOnly store what an app needs, keep it only as long as needed, and never collect real personal details in practice apps.
How it's assessed
- Designs a sensible table schema with primary and foreign keys.
- Predicts which rows a query will touch and spots a missing where clause.
- Explains authentication versus authorisation and what 401 and 403 mean.
- Writes a row-level security rule in plain words and explains why secret keys stay on the server.
- Spots a data-minimisation problem in an app plan.
To complete the course
- Pass each lesson check (70% or more).
- Complete the query playground and row-level security simulator using fictional data.
Notes for parents, guardians and teachers
- All exercises use Amphicode's in-browser pretend database with fictional robots, planets and pets. No account, key or personal information is needed.
- Supabase is introduced as an example service. Its privacy policy says its services are not intended for children under 13, so learners under 13 always use Amphicode's sandbox database and can't connect Supabase.
- Connect Supabase (optional, 13 and over): a parent or guardian can connect their own Supabase account for a learner aged 13–17 from the learner's page, or a learner aged 13 or over can connect their own account in Settings — when a 13–17 learner does this, their guardians get a notice on the Family page (and an email, where email is set up) and can disconnect it. Adults learning for themselves can connect too. Amphicode's age check uses the age band you chose; a band that might include under-13s counts as under 13.
- With Connect Supabase, Amphicode keeps the Supabase sign-in encrypted on its server and only gives the learner's lessons the project's web address and public key — never a secret key. Setting up a Supabase account or organisation, and keeping it on the Free plan, is the adult's decision; Amphicode never asks for payment details. Disconnecting deletes Amphicode's copy and asks Supabase to end the access; the project itself stays in Supabase until you delete it there.
- Learners are taught never to collect real people's personal information in practice apps, and that secret database keys stay on a server.
- Privacy laws differ between countries; this course teaches general good practice, not legal advice.
What comes next
- D6: Payments in Test Mode · How online payments work, practised only with pretend money in test mode.
A parent, guardian or teacher creates the account. A short placement check suggests where each learner starts.