Developer starter kit · Authentication

VaultAuth

A reusable authentication foundation for developers who don't want to rebuild login, sessions, roles, permissions, password changes and admin access from scratch for every new application.

Node.js + Express MongoDB Redis JWT RBAC + ABAC BullMQ Next.js 14
Development status: VaultAuth is currently in development. It will be made available to users shortly.
VaultAuth login interface
Why VaultAuth

Stop rebuilding authentication from scratch.

VaultAuth packages the recurring authentication concerns of a modern web application into a starter system that can be adapted to a product instead of recreated for every project.

01AUTH
SESSION SECURITY

Access + refresh tokens

Short-lived access JWTs are kept in Redux memory while refresh tokens use an httpOnly cookie and Redis-backed token allow-listing.

02ACCESS
RBAC · ABAC

Coarse and fine-grained access

Role middleware handles broad access such as admin, while permission and attribute checks support finer-grained authorization decisions.

03SCALE
WORKERS · CLUSTER

Separate work from requests

BullMQ moves background jobs away from the request path, while Node cluster can run one worker process per CPU core in production.

01 AUTHENTICATION
The user experience

Beautiful login experience.

A clean, modern and distraction-free login page built with Next.js 14 and Tailwind CSS. The frontend gives developers a working authentication experience instead of leaving the UI layer to be assembled later.

✓Modern UI with smooth animations
✓Secure authentication flow
✓Responsive on all devices
✓Built for developers
VaultAuth login page Login · Next.js 14
VaultAuth dashboard and change password interface Dashboard · Account security
02 DASHBOARD
Account controls

A focused developer dashboard.

The included dashboard provides the essential account information and security controls without adding unnecessary product-specific complexity.

✓View authenticated profile details
✓Change password from the dashboard
✓Keep the interface minimal and adaptable
✓Use as a starting point for your own product UI
03 USER MANAGEMENT
RBAC · Admin

Powerful admin controls.

Admin-only user management is part of the supplied application flow. The protected user list demonstrates how role-based access can control administrative functionality.

✓View all registered users
✓Manage user roles
✓Secure admin-only access
✓Extend the model with permissions as needed
VaultAuth admin users list Admin · User management
Security model

Short-lived access. Rotating refresh sessions.

The documented default is a 15-minute access token and a 7-day refresh token, with Redis-backed refresh-session allow-listing.

Browser / Next.js
↓ Authorization: Bearer access-token
Express API
↓ 401 → refresh interceptor
httpOnly refresh cookie
↓ Redis jti allow-list
Rotated refresh session

Access tokens are short-lived JWTs kept in Redux memory rather than localStorage. Refresh tokens are longer-lived JWTs stored in an httpOnly cookie, allow-listed in Redis by a per-token jti, and rotated on use.

✓15-minute access token default
✓7-day refresh token default
✓Refresh rotation on every use
✓Revocation on logout, logout-all and password change
// RBAC requireRole('admin') // ABAC requirePermission('users:read') // Runtime attribute checks requireAttribute(predicate)
Authorization

RBAC when roles are enough. ABAC when they aren't.

RBAC provides the coarse-grained role boundary documented by the project, while ABAC supports permission claims and runtime predicates such as resource ownership.

✓user and admin roles
✓Permission-based middleware
✓Runtime attribute predicates
✓Admin-only user management endpoint
Architecture

Authentication with clear boundaries.

Request handling, authentication, authorization, persistence and background work are kept as distinct pieces of the system.

Next.js application
↓ Axios + Redux
Express API
↓ authentication middleware
JWT access / refresh flow
↓
MongoDB + Redis
↓ background work
BullMQ → separate worker
Scaling path

Keep request handling independent from background work.

Registration can enqueue a welcome-email job rather than performing the work inside the request. The separate worker can scale independently from the API.

In production mode, Node cluster can fork one worker process per CPU core and restart a worker after a crash.

Technology stack

Built from familiar production components.

The current repository uses a Node.js backend and a Next.js frontend with explicit infrastructure boundaries.

Backend
Express MongoDB Mongoose Redis ioredis JWT Zod BullMQ bcrypt Helmet CORS Node cluster
Frontend
Next.js 14 App Router Redux Toolkit Axios Tailwind CSS Protected routes
API reference

Core authentication endpoints.

These are the routes documented by the current VaultAuth README.

//vault-api
Method Route Auth Purpose
POST/api/auth/register—Create account and return tokens
POST/api/auth/login—Authenticate a user
POST/api/auth/refreshCookieRotate refresh token
POST/api/auth/logoutBearerRevoke current session
POST/api/auth/logout-allBearerRevoke all user sessions
GET/api/auth/meBearerReturn current user profile
POST/api/auth/change-passwordBearerChange password and revoke other sessions
GET/api/usersBearer + adminList all users
PATCH/api/users/:id/roleBearer + adminChange a user's role
Deployment checklist

Use the right production configuration.

The README calls out several production settings that should be applied before deploying the system publicly.

✓Use long, random JWT access and refresh secrets
✓Enable COOKIE_SECURE=true with HTTPS
✓Use managed MongoDB and Redis services where appropriate
✓Run the BullMQ worker as its own process/deployment
# Production configuration JWT_ACCESS_SECRET=<long-random-secret> JWT_REFRESH_SECRET=<long-random-secret> COOKIE_SECURE=true # Separate worker npm run worker # API npm run start

Build on a foundation, not from scratch.

VaultAuth is being developed as a reusable authentication starter for developers who want a structured starting point for new applications.

It is still in development and will be shortly available to all users.

View VaultAuth on GitLab ↗
Let's work together

Have a project in mind?

Tell me a little about your project, idea or business. I'll get back to you as soon as possible.

in 𝕏 ◎ f ◔ ✓