Skip to main content

Live Demos

Fully-functional, in-browser demos powered by StackBlitz WebContainers. Each example uses an in-memory store so everything works out-of-the-box — no database setup required. Fill in the .env.example values to connect a real database or enable email/SMS features.


Express (Basic)

The simplest integration: Express + @nik2208/node-auth with HttpOnly JWT cookies, bcrypt password hashing, and an admin panel.

StackNode.js · Express · Vanilla HTML/JS
AuthRegister · Login · Logout · /auth/me · Refresh token
DatabaseIn-memory
Startnpm start

Open in StackBlitz


NestJS Fullstack

NestJS application with AuthModule.forRoot(), JwtAuthGuard, @CurrentUser() decorator, and a static HTML frontend.

StackNode.js · NestJS · TypeScript · ts-node · Vanilla HTML/JS
AuthRegister · Login · Logout · /auth/me · Refresh · Protected endpoint
DatabaseIn-memory
Startnpm start

Open in StackBlitz


Next.js Fullstack (Pages Router)

Full-stack Next.js application with a catch-all /api/auth/[...auth] route, Edge Middleware route protection, and a login + dashboard UI.

StackNode.js · Next.js 15 · TypeScript · React
AuthRegister · Login · Logout · Dashboard (protected) · Middleware redirect
DatabaseIn-memory
Startnpm start (runs next dev)

Open in StackBlitz


Angular SSR (with Guards & Interceptors)

Angular 19 application with Server-Side Rendering, a full auth layer, and all production-ready patterns:

  • AuthService — user state, login/logout/refresh via HttpOnly cookies
  • authInterceptor — CSRF header + automatic token-refresh queue (handles concurrent 401s)
  • authGuard, guestGuard, roleGuard — route protection
  • APP_INITIALIZER — silent session restore on page reload
  • ssrCookieInterceptor — forwards browser cookies to the API server during SSR
StackNode.js · Angular 19 SSR · Express (node-auth API) · TypeScript
Dev modenpm start → API server (port 3000) + ng serve (port 4200) with proxy
Productionnpm run build && npm run serve:ssr
DatabaseIn-memory

Open in StackBlitz


Express + Angular SPA

Separate Express API (node-auth) on port 3000 and Angular SPA on port 4200. Angular proxies /auth/* and /admin/* to Express during development.

Same auth patterns as the Angular SSR demo (guards, interceptors, APP_INITIALIZER) — without SSR complexity. In production, Express serves the compiled Angular build.

StackNode.js · Angular 19 · Express (node-auth API) · TypeScript
Dev modenpm start → API server (port 3000) + ng serve (port 4200) with proxy
Productionnpm run build && npm run serve:prod
DatabaseIn-memory

Open in StackBlitz


Using your own database

All demos use InMemoryUserStore by default. To connect a real database, replace it with one of the ready-made stores:

DatabaseGuide
SQLitedocs/database/sqlite
MySQLdocs/database/mysql
PostgreSQLdocs/database/postgresql
MongoDBdocs/database/mongodb

Copy the .env.example.env (or .env.local for Next.js) and set ACCESS_TOKEN_SECRET, REFRESH_TOKEN_SECRET, and your database connection string.

In-memory data resets on restart

The in-memory store is ephemeral — all registered users are lost when the server restarts. This is intentional for the demos. In production, use a persistent database.