nestjs_specialist
БесплатноБез исполняемых скриптовНе проверенComprehensive NestJS framework guide with Drizzle ORM integration. Use when building NestJS applications, setting up APIs, implementing authentication…
от vuralserhat86★ 43 звезды на GitHubОб этом скилле
NestJS Framework with Drizzle ORM
When to Use
- Building REST APIs or GraphQL servers with NestJS
- Setting up authentication and authorization
- Implementing middleware, guards, or interceptors
- Working with databases (TypeORM, Drizzle ORM)
- Creating microservices architecture
- Writing unit and integration tests
- Setting up OpenAPI/Swagger documentation
Core Architecture
Module Structure
import { Module } from '@nestjs/common';
@Module({
imports: [/* other modules */],
controllers: [/* controllers */],
providers: [/* providers */],
exports: [/* exported providers */],
})
export class FeatureModule {}
Controller Pattern
import { Controller, Get, Post, Body, Param, Query } from '@nestjs/common';
@Controller('users')
export class UsersController {
@Get()
findAll(@Query() query: any) {
return 'This returns all users';
}
@Get(':id')
findOne(@Param('id') id: string) {
return `This returns user #${id}`;
}
@Post()
create(@Body() createUserDto: any) {
return 'This creates a user';
}
}
Service with Dependency Injection
import { Injectable } from '@nestjs/common';
@Injectable()
export class UsersService {
constructor(/* inject dependencies */) {}
findAll() {
return 'Users service logic';
}
}
Database Integration with Drizzle
Setup with Drizzle ORM
Installation
# Using npm
npm install drizzle-orm pg
npm install -D drizzle-kit tsx @types/pg
# Using yarn
yarn add drizzle-orm pg
yarn add -D drizzle-kit tsx @types/pg
Configuration
// drizzle.config.ts
import 'dotenv/config';
import { defineConfig } from 'drizzle-kit';
export default defineConfig({
out: './drizzle',
schema: './src/db/schema.ts',
dialect: 'postgresql',
dbCredentials: {
url: process.env.DATABASE_URL!,
},
});
Database Schema
// src/db/schema.ts
import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core';
export const users = pgTable('users', {
id: serial('id').primaryKey(),
name: text('name').notNull(),
email: text('email').notNull().unique(),
createdAt: timestamp('created_at').defaultNow(),
});
Database Service
// src/db/database.service.ts
import { Injectable } from '@nestjs/common';
import { drizzle } from 'drizzle-orm/node-postgres';
import { Pool } from 'pg';
import * as schema from './schema';
@Injectable()
export class DatabaseService {
private db: ReturnType<typeof drizzle>;
constructor() {
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
});
this.db = drizzle(pool, { schema });
}
get database() {
return this.db;
}
}
User Repository with Drizzle
// src/users/user.repository.ts
import { Injectable } from '@nestjs/common';
import { DatabaseService } from '../db/database.service';
import { users } from '../db/schema';
import { eq } from 'drizzle-orm';
@Injectable()
export class UserRepository {
constructor(private db: DatabaseService) {}
async findAll() {
return this.db.database.select().from(users);
}
async findOne(id: number) {
const result = await this.db.database
.select()
.from(users)
.where(eq(users.id, id))
.limit(1);
return result[0];
}
async create(data: typeof users.$inferInsert) {
const result = await this.db.database
.insert(users)
.values(data)
.returning();
return result[0];
}
async update(id: number, data: Partial<typeof users.$inferInsert>) {
const result = await this.db.database
.update(users)
.set(data)
.where(eq(users.id, id))
.returning();
return result[0];
}
async remove(id: number) {
const result = await this.db.database
.delete(users)
.where(eq(users.id, id))
.returning();
return result[0];
}
}
Complete User Module
// src/users/users.module.ts
import { Module } from '@nestjs/common';
import { UsersController } from './users.controller';
import { UsersService } from './users.service';
import { UserRepository } from './user.repository';
import { DatabaseService } from '../db/database.service';
@Module({
controllers: [UsersController],
providers: [UsersService, UserRepository, DatabaseService],
exports: [UsersService],
})
export class UsersModule {}
User Service Implementation
// src/users/users.service.ts
import { Injectable } from '@nestjs/common';
import { UserRepository } from './user.repository';
import { User } from './interfaces/user.interface';
@Injectable()
export class UsersService {
constructor(private userRepository: UserRepository) {}
async findAll(): Promise<User[]> {
return this.userRepository.findAll();
}
async findOne(id: number): Promise<User> {
const user = await this.userRepository.findOne(id);
if (!user) {
throw new Error('User not found');
}
Установить nestjs_specialist в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл nestjs_specialist?
Comprehensive NestJS framework guide with Drizzle ORM integration. Use when building NestJS applications, setting up APIs, implementing authentication, working with databases, or integrating Drizzle ORM. Covers controllers, providers, modules, middleware, guards, interceptors, testing, microservices, GraphQL, and database patterns.
Как установить скилл nestjs_specialist?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nestjs_specialist запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic