Quickstart — Backend
A minimal NestJS app with working signup and login.
End-to-end signup → login in ten minutes.
Prereqs
- Node 22+, pnpm 10+.
- A Postgres database (or SQLite for the simplest path).
- Already done Installation, Setup Checklist, Database Setup, Environment & Secrets.
1. The module
2. Bootstrap
3. Run it
The library auto-creates the SQLite file and the auth tables.
4. Try it
You should get back accessToken and refreshToken.
If /auth/me returns Alice's profile, the loop is closed.
5. Add a protected route
Register it in AppModule.controllers. Hitting GET /orders without a token returns 401; with a valid token, it returns the orders.
6. Add an AppUser
For anything beyond email/password, you want your own AppUser table linked to NestAuthUser. See the User Model page for the canonical setup, including a UserRegisteredEvent listener that creates the AppUser automatically.
What's next
- Quickstart — React — the frontend half.
- User Model — extending users.
- Authentication Methods — adding OAuth, MFA, passwordless.