nodejs-backend-patterns
构建生产级 Node.js 后端
Também disponível em: sickn33
创建 Node.js 后端服务需要理解中间件模式、身份验证流程和数据库集成。本技能提供可直接使用的代码模式和架构指导,适用于 Express 和 Fastify 框架。
Baixar o ZIP da skill
Upload no Claude
Vá em Configurações → Capacidades → Skills → Upload skill
Ative e comece a usar
Testar
A utilizar "nodejs-backend-patterns". Create an Express server with authentication and rate limiting
Resultado esperado:
- Server setup with helmet security, cors configuration, and compression middleware
- Rate limiting using express-rate-limit with Redis store for distributed environments
- JWT authentication middleware that validates tokens and handles unauthorized errors
- Request logging middleware using pino for structured logging
A utilizar "nodejs-backend-patterns". Show me how to structure a Node.js backend with layered architecture
Resultado esperado:
- Controllers handle HTTP requests and responses
- Services contain business logic and validation
- Repositories manage data access and database operations
- Middleware provides cross-cutting concerns like auth and logging
A utilizar "nodejs-backend-patterns". How do I connect to PostgreSQL in Node.js with TypeScript?
Resultado esperado:
- Use pg library with connection pool for efficient database connections
- Implement repository pattern to abstract database operations
- Use parameterized queries to prevent SQL injection
- Handle transactions for atomic operations across multiple queries
Auditoria de Segurança
SeguroPure documentation skill containing code examples and architectural patterns for Node.js backend development. No executable code, no file system access, no network calls, no system command execution. All content is static documentation meant for user reference. Static findings are false positives triggered by example code patterns.
Fatores de risco
🌐 Acesso à rede (6)
⚡ Contém scripts (1)
⚙️ Comandos externos (47)
📁 Acesso ao sistema de arquivos (11)
🔑 Variáveis de ambiente (50)
Pontuação de qualidade
O Que Você Pode Construir
构建 REST API
使用 Express 或 Fastify 创建具有正确中间件、验证和错误处理的可扩展 REST API
设计后端架构
使用控制器、服务、存储库和依赖注入模式实现分层架构
设置身份验证
配置 JWT 身份验证、基于角色的授权和安全密码处理(使用 bcrypt)
Tente Estes Prompts
Show me how to set up an Express.js server with helmet, cors, compression, and request logging middleware
Create JWT authentication middleware for Express that validates Bearer tokens and attaches user to request
Show the repository pattern for PostgreSQL with connection pooling, transaction support, and CRUD operations
Create a global error handler for Express with custom error classes and proper HTTP status codes
Melhores Práticas
- 使用 TypeScript 确保类型安全,防止生产后端中的运行时错误
- 使用自定义错误类和全局错误处理器实现正确的错误处理
- 在处理业务逻辑之前,使用 Zod 或 Joi 模式验证所有输入
Evitar
- 将密钥或凭据直接硬编码在源代码中,而不是使用环境变量
- 使用同步方法或阻塞操作而降低服务器性能
- 在生产环境中返回详细的错误消息,暴露内部实现细节
Perguntas Frequentes
支持哪些 Node.js 框架?
推荐的数据库模式是什么?
此技能如何与其他工具集成?
使用此技能时我的数据安全吗?
为什么我的 API 路由不工作?
这与其他后端技能有何不同?
Detalhes do Desenvolvedor
Autor
wshobsonLicença
MIT
Repositório
https://github.com/wshobson/agents/tree/main/plugins/javascript-typescript/skills/nodejs-backend-patternsReferência
main
Estrutura de arquivos
📄 SKILL.md