Skip to content
Back to skills

Backend Controller Pattern Integration

ASecurity

Provides NestJS Controller patterns for Integration endpoints. This skill should be used when building endpoints for external integrations like Google Sheets or Webhooks.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmenttypescriptgoapibackend

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill backend-controller-pattern-integration --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Backend Controller Pattern Integration?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Backend Controller Pattern Integration
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-backend-controller-pattern-integration/badge)](https://www.skillsdirectory.com/skills/david-li0406-backend-controller-pattern-integration)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
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

1.  **Inheritance**: Integration controllers should extend their specific base class (e.g., `BaseGoogleSheetsController`).
2.  **Authentication**: Use specific decorators for the integration type (e.g., `@GoogleSheets()`).
3.  **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**:

```typescript
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 `@ZodSerializerDto` for strict output serialization.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…