← Back to list

backend-controller-pattern-integration
by allenlin90
⭐ 1🍴 0📅 Jan 24, 2026
SKILL.md
name: backend-controller-pattern-integration description: Provides NestJS Controller patterns for Integration endpoints. This skill should be used when building endpoints for external integrations like Google Sheets or Webhooks.
Integration Controller Pattern (NestJS)
This skill outlines the patterns for Integration controllers in erify_api, specifically for external integrations like Google Sheets extensions.
Core Principles
- Inheritance: Integration controllers should extend their specific base class (e.g.,
BaseGoogleSheetsController). - Authentication: Use specific decorators for the integration type (e.g.,
@GoogleSheets()). - Response Format: often requires specific serialization compatibility (e.g., snake_case for external tools).
Google Sheets Pattern
Base Controller: BaseGoogleSheetsController provides:
@GoogleSheets()authentication decorator.createPaginatedResponse()for standard pagination.
Implementation:
import { Controller, Get, Query } from '@nestjs/common';
import { BaseGoogleSheetsController } from '../base-google-sheets.controller';
import { ApiZodResponse } from '@/lib/openapi/decorators';
import { ZodSerializerDto } from 'nestjs-zod';
@Controller('google-sheets/schedules')
export class GoogleSheetsScheduleController extends BaseGoogleSheetsController {
// Note: Google Sheets often uses explicit @ApiZodResponse + @ZodSerializerDto
// instead of a wrapper if specific description tuning is needed.
@Get()
@ApiZodResponse(createPaginatedResponseSchema(scheduleDto))
@ZodSerializerDto(createPaginatedResponseSchema(scheduleDto))
async getSchedules(@Query() query: ListSchedulesQueryDto) {
const { schedules, total } = await this.scheduleService.getPaginatedSchedules(query);
return this.createPaginatedResponse(schedules, total, query);
}
}
Checklist
- Controller extends appropriate base (e.g.,
BaseGoogleSheetsController). - Uses specific auth decorator (e.g.,
@GoogleSheets). - Uses
@ZodSerializerDtofor strict output serialization.
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon