api-route

Generate Next.js 16 API routes with Better Auth, RBAC, Zod, and Drizzle ORM.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/vieriusorin/GroupLearn --skill api-route-vieriusorin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-route
Source: https://github.com/vieriusorin/GroupLearn/tree/main/.claude/skills/api-route
Command: npx skills add https://github.com/vieriusorin/GroupLearn --skill api-route-vieriusorin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation of robust Next.js API routes by providing a standardized template that incorporates essential features like authentication, authorization, input validation, and database operations.

Core Features & Use Cases

  • Standardized API Endpoints: Generates GET, POST, PATCH, and DELETE handlers for resource management.
  • Integrated Auth & RBAC: Seamlessly integrates with Better Auth for authentication and role-based access control.
  • Input Validation: Utilizes Zod for robust request body and query parameter validation.
  • Drizzle ORM Support: Includes patterns for performing type-safe database operations with Drizzle ORM.
  • Use Case: Quickly scaffold a new API endpoint for managing user profiles, ensuring secure access and data integrity from the outset.

Quick Start

Generate a new API route for managing 'products' in the 'src/app/api/products/' directory.

Frequently Asked Questions about api-route

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

FAQPage Schema
How do I generate Next.js API routes with authentication and Drizzle ORM?

Generate Next.js API routes with integrated Better Auth, RBAC, Zod validation, and Drizzle ORM by scaffolding standardized GET, POST, PATCH, and DELETE handlers for secure resource management.

What is the best way to add role-based access control to Next.js API endpoints?

Adding role-based access control to Next.js API endpoints is best achieved by integrating Better Auth and RBAC policies directly within your route handlers to enforce secure authorization.

How do I validate request bodies in Next.js API routes using Zod?

Validate request bodies in Next.js API routes using Zod by parsing incoming requests against defined schemas before passing the data to Drizzle ORM database operations.

Does this API route generator support CRUD operations for Next.js 16?

Yes, this API route generator supports Next.js 16 by scaffolding standardized CRUD operations, handling request parsing, database interactions, and returning structured error responses.

Can I use Drizzle ORM for type-safe database operations in Next.js API routes?

You can use Drizzle ORM for type-safe database operations in Next.js API routes by following the included patterns for secure data interactions after Zod validation and Better Auth checks.

Why do my Next.js API routes fail without proper input validation and authorization?

Next.js API routes fail without validation and authorization because unauthenticated requests bypass security; integrating Better Auth, RBAC, and Zod ensures data integrity and secure access control.