本文へスキップ
Skillpedia
APIとサーバー(バックエンド)41k · #6714

nodejs-backend-patterns

できること

このガイドでは、Node.jsを使ってインターネットのサービス(バックエンド)を構築する方法を解説します。コードの整理方法、エラーの処理、アクセス制御、データベースへの接続方法を紹介します。

使う場面

  • ✓サーバーが必要なWebサイトやアプリを作るとき。
  • ✓他のプログラムが利用するAPIを開発するとき。
  • ✓リアルタイムの通信が必要なシステムを作るとき。

スキルのリンク

https://github.com/wshobson/agents/blob/main/plugins/javascript-typescript/skills/nodejs-backend-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/wshobson/agents/blob/main/plugins/javascript-typescript/skills/nodejs-backend-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“オンラインストア向けに、安全なNode.jsサーバーを構築するにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

コードの整理パターンとベストプラクティスが説明されています。これには、受信するリクエストの処理、起こりうるエラーへの対応、許可されたユーザーだけが特定の部分にアクセスできるようにする方法が含まれます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Node.js Backend Patterns

Comprehensive guidance for building scalable, maintainable, and production-ready Node.js backend applications with modern frameworks, architectural patterns, and best practices.

When to Use This Skill

  • Building REST APIs or GraphQL servers
  • Creating microservices with Node.js
  • Implementing authentication and authorization
  • Designing scalable backend architectures
  • Setting up middleware and error handling
  • Integrating databases (SQL and NoSQL)
  • Building real-time applications with WebSockets
  • Implementing background job processing

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Use TypeScript: Type safety prevents runtime errors
  2. Implement proper error handling: Use custom error classes
  3. Validate input: Use libraries like Zod or Joi
  4. Use environment variables: Never hardcode secrets
  5. Implement logging: Use structured logging (Pino, Winston)
  6. Add rate limiting: Prevent abuse
  7. Use HTTPS: Always in production
  8. Implement CORS properly: Don't use * in production
  9. Use dependency injection: Easier testing and maintenance
  10. Write tests: Unit, integration, and E2E tests
  11. Handle graceful shutdown: Clean up resources
  12. Use connection pooling: For databases
  13. Implement health checks: For monitoring
  14. Use compression: Reduce response size
  15. Monitor performance: Use APM tools

Testing Patterns

See javascript-testing-patterns skill for comprehensive testing guidance.

よくある質問

「ミドルウェア」とは何ですか?

リクエストがサーバーのメイン処理に届く前に、内容を確認したり加工したりする「門番」や「処理装置」のようなものです。

なぜTypeScriptを使うのですか?

プログラムを実行する前にデータの型をチェックすることで、よくあるエラーを防ぎ、コードの信頼性を高めてくれます。

「ベストプラクティス」とは何ですか?

あることを行うための、最も良いとされている確立された方法のことです。コードをより安全で理解しやすく、将来も保守しやすいものにします。

詳細

作者による元の説明

Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.

repo: wshobson/agents

人気

GitHubのスター
41k
ランキング
#6714
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル