vendix-backend-auth

Implement global JWT authentication and role-based authorization for NestJS backends.

5|Updated Aug 23, 2025
One-click install
npx skills add https://github.com/Rzyfront/Vendix --skill vendix-backend-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vendix-backend-auth
Source: https://github.com/Rzyfront/Vendix/tree/main/skills/vendix-backend-auth
Command: npx skills add https://github.com/Rzyfront/Vendix --skill vendix-backend-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vendix backend security often requires a consistent and scalable approach to authentication and authorization. This Skill provides a global JWT-based strategy with public route support, role-based access control, and granular permissions to secure APIs.

Core Features & Use Cases

  • Global JWT authentication via a NestJS AuthModule with APP_GUARD
  • Public routes marked by a @Public() decorator
  • Role-based access controlled by a RolesGuard
  • Permission-based access controlled by a PermissionsGuard
  • Centralized JwtStrategy for token validation
  • Easy integration with existing domain layers and controllers

Quick Start

  1. Integrate the AuthModule into app.module.ts with JWT settings (secret, expiresIn).
  2. Mark sensitive routes with appropriate @Roles and/or @Permissions decorators.
  3. Provision JWTs (login) and secure endpoints with Bearer tokens.

Frequently Asked Questions about vendix-backend-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement JWT authentication and role-based access control in NestJS?

To configure JWT authentication in NestJS, set up a global AuthModule with APP_GUARD, provide the JWT_SECRET environment variable, and use a JwtStrategy to validate Bearer tokens against protected routes.

How do I mark specific NestJS routes as public while keeping global JWT auth active?

You can exclude specific NestJS routes from global JWT authentication by applying a @Public() decorator to those controllers or endpoints, allowing unauthenticated access while the AuthGuard secures the rest of the API.

Can I enforce granular permissions instead of just roles for API route access?

Yes, granular API access control is supported by applying a PermissionsGuard alongside the RolesGuard, using @Permissions decorators on controllers to restrict specific endpoint actions.

Do I need any external dependencies to set up this JWT auth strategy?

No external Skill dependencies are required, but the NestJS backend environment must supply a JWT_SECRET environment variable and configure token expiration settings for the JwtStrategy to validate tokens correctly.

Why use a global AuthGuard for NestJS backend security instead of per-route guards?

A global AuthGuard secures all NestJS routes by default, preventing accidental exposure of sensitive endpoints and centralizing token validation, while decorators handle specific role and permission overrides.