Login & Signup – Implementing Authentication
Time to build the auth experience you designed. You'll use Clerk for sign-in and store each user's data in Neon, scoped so people only ever see their own. You're on your auth branch, so everything here is tested on a preview before it reaches your live site.
Auth has a lot of fiddly parts. You'll install the Clerk skill so Claude already knows the current, secure way to wire Clerk into Next.js – middleware, components, session handling. You describe what you want; the skill handles the wiring.
1. Install the Clerk skill
Ask Claude in the chat: "install the clerk-setup skill" – it runs npx skills add clerk-setup for you.
The desktop app picks up a new skill when a session starts. After installing, start a new chat – and hand it your context (your concept, that you're on the auth branch, and that you'll build Clerk + Neon auth) before you build.
Outcome: Claude has the Clerk skill and your context for the build.
2. Set up Clerk and build sign-in / sign-up
Now build the core auth. Plan it briefly, then let Claude build – it'll create your Clerk app, store the keys in the Vercel vault, add the sign-in/sign-up pages, and protect your routes.
Outcome: Users can sign up, log in, and only signed-in users can reach the app.
3. Add onboarding
Give new users a warm, skippable 3-screen onboarding; returning users skip it automatically.
Outcome: New users get a welcoming onboarding; returning users skip straight in.
4. Store and scope user data in Neon
This is the secure heart of it: keep each user's data in Neon, tied to their Clerk account, and make sure the server only ever returns the logged-in user's rows. There's no magic row-level security here – you enforce it on the server, which the Clerk skill does correctly.
Outcome: Each user's data lives in Neon and is locked to them, enforced server-side.
5. Test on your preview
Push your branch so Vercel builds a preview, then run the full flow there before merging.
Outcome: Your full auth flow works on the preview, including data isolation – ready to ship to production in the next lesson.