Skillpedia
واجهات API والخوادم (backend)41k · #6714

nodejs-backend-patterns

ما الذي تفعله

يساعد هذا الدليل على بناء الخدمات الخلفية للإنترنت باستخدام Node.js. يعلّم كيفية تنظيم الشيفرة ومعالجة الأخطاء وتأمين الوصول والاتصال بقواعد البيانات.

متى تستخدمها

  • ✓عندما تبني موقعًا أو تطبيقًا يحتاج إلى خادم.
  • ✓عندما تطور واجهة برمجية تستخدمها برامج أخرى.
  • ✓عندما تنشئ أنظمة تحتاج إلى تواصل فوري.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/wshobson/agents/blob/main/plugins/javascript-typescript/skills/nodejs-backend-patterns/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“كيف أبني خادم Node.js آمنًا لمتجري الإلكتروني؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يشرح الدليل أنماط تنظيم الشيفرة وأفضل الممارسات. ويتضمن ذلك كيفية التعامل مع الطلبات الواردة والأخطاء المحتملة، وضمان أن المستخدمين المصرح لهم فقط يصلون إلى أجزاء معينة.

المحتوى التقني (ملف 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.

الأسئلة الشائعة

ما هو «middleware»؟

هو أشبه بـ«حراس» أو «معالجات» تفحص الطلبات القادمة للخادم أو تعدّلها قبل وصولها إلى الدالة الرئيسية.

لماذا أستخدم TypeScript؟

يساعد 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
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة