Your notes app has real users. Sign up, log in, and user-scoped notes all work. But every user is equal. Alice can't see Bob's notes, and Bob can't see Alice's. That's the point of user-scoped data.
But what if you need to see everything? What if you need to know how many users signed up, what notes they created, or delete something inappropriate? Right now, the only way to check is to open the database directly.
You need an admin — a user who can see all data and take actions that regular users can't.
The idea is simple: two experiences in one app. Regular users (members) see only their own data at /app. Admins see everything at /admin — all users, all notes, and controls to manage them.
Same login flow. Same app. Different access based on one field in the database.
You won't build a separate admin app or install a library. You'll:
null means member, 'admin' means adminrequireAdminFromCookie helper that gates routes and actions/admin route tree with its own layout and pagesBy the end, you'll log in as a member and see only your data, then switch to an admin account and see everything. Let's start with the role column.