دليل هندسي

Bz Info ليس مجرد portfolio، بل نظام منتج قابل للتحقق.

هذه الصفحة تعرض المنطق التقني خلف المنصة: معمارية الويب، backend NestJS، الجودة، الاختبارات، التشغيل، SEO، i18n وانضباط التسليم.

Husky pre-pushESLint + Prettierportfolio-api/test9 quality phasesmodule runners.reports output

صفحات مولدة

714

صفحات ثابتة بعد إضافة الخبرات والأدوات والمسارات المحلية.

لغات نشطة

6

الفرنسية والإنجليزية والعربية والإسبانية والألمانية والهولندية مع مسارات مخصصة.

سلسلة الجودة

Typecheck + Build

تحقق frontend منهجي قبل تثبيت التغييرات.

Backend quality is module-owned.

Each serious module can expose its own perf, contract, unit, integration, E2E, smoke, security and mutation phases.

خريطة النظام

منصة مصممة كمنتج كامل.

الدليل لا يأتي من صفحة واحدة، بل من النظام الكامل: موقع عام، API، إدارة، توثيق، أدوات، محتوى محلي وجودة.

01 · Visible

Public web

Next.js, localized routes, SEO, sitemap, expertise pages and documentation.

02 · Architecture

Backend API

NestJS API for contact, chatbot, analytics, communication and product workflows.

03 · Operations

Admin system

Future supervision for requests, conversations, logs, statistics and operations.

04 · Expansion

Tools lab

Developer packs, scripts, transactional SMS gateway and local AI workstation.

دليل backend

يتم التعامل مع backend كعمود فقري للمنتج.

الهدف هو إظهار القدرة على تنظيم الوحدات، العقود، التحقق، التدفقات، الأمن والتكاملات.

NestJS

Modular architecture

Modules, services, DTOs, guards, validation and maintainable API contracts.

Prisma

Controlled persistence

Models, transactions, constraints and clear separation between domain and storage.

Realtime

Live flows

Chat, support, notifications and admin interfaces connected to real system state.

Communication

Email, SMS and notifications

Transactional channels designed with limits, logs, security and precise usage.

01

HTTP request

Controller receives a public operation through a documented route.

02

DTO validation

class-validator, Swagger metadata and ValidationPipe must stay aligned.

03

Guard / auth

Access rules, JWT context, throttling and role checks protect the boundary.

04

Service decision

Business rules are isolated, testable and protected by explicit branches.

05

Prisma / storage

Transactions, constraints and persistence shape are verified by tests.

06

Reports

Schemathesis, smoke, ZAP, k6 and Stryker expose behavior from outside.

منهجية backend

منهجية تدريجية تعمل مع عدة frameworks.

NestJS أو Spring Boot أو Python أو Go أو .NET: الفكرة واحدة. فهم، تثبيت، تحسين، قياس، تقوية ثم توثيق.

01

استكشاف

قراءة routes وDTOs وguards وservices والوصول للبيانات والأخطاء والعقود العامة.

فهم النظام قبل تعديله.

02

Refactor خفيف

توضيح المسؤوليات بدون إعادة كتابة المنتج أو كسر السلوك الحالي.

تقليل الدين التقني بدون مخاطرة كبيرة.

03

اختبارات أساسية

تثبيت السلوك الحالي باختبارات بسيطة لكنها مفيدة.

بناء شبكة أمان قبل التصحيحات العميقة.

04

اختبارات عميقة

اختبار الفروع، الأخطاء، الحدود، المعاملات، null وundefined ومسارات الاستثناء.

مهاجمة الزوايا التي تتجاهلها الاختبارات السطحية.

05

Integration & E2E

التحقق من الحدود الحقيقية بين API والمصادقة والقاعدة والخدمات.

إثبات السلوك خارج العزل.

06

Performance

قياس latency وconcurrency وDB contention وN+1 وthrottling والذاكرة والمسارات البطيئة.

معرفة ما ينكسر تحت ضغط حقيقي.

07

Contract testing

استخدام OpenAPI وSchemathesis لمقارنة العقد العام بالسلوك الحقيقي.

تصحيح DTOs وSwagger وValidationPipe والردود الموثقة.

08

Runtime security

إضافة smoke checks وZAP وlogs والتحقق أثناء التشغيل.

مراقبة النظام كما يعمل فعلاً.

09

Mutation testing

استخدام Stryker لمعرفة هل الاختبارات تكشف تغييرات السلوك.

قياس قوة الاختبارات وليس التغطية فقط.

10

توثيق

حفظ الأوامر والتقارير والـ runners والقرارات بشكل قابل لإعادة الاستخدام.

جعل الجودة قابلة للنقل للفريق والمشاريع القادمة.

تعريف أنواع الاختبار

كل نوع اختبار يغطي خطراً مختلفاً.

جودة backend ليست مجرد مجلدات. كل مرحلة تجيب عن سؤال واضح: هل النظام صحيح، مدمج، موثق، قوي، آمن ومقاوم للتغيير؟

00-static-quality

Static quality gate

يتحقق من typing وESLint وPrettier وbuild وGit hooks قبل الثقة بسلوك runtime.

When

قبل suites ثقيلة، قبل commit، قبل push وقبل تحليل أخطاء أعمق.

Why

Husky وESLint وPrettier يمنعون دخول الضجيج إلى repository: تنسيق مكسور، دين style، أخطاء static أو build غير صالح.

01-perf

Performance

يقيس latency ونسبة الأخطاء والتزامن وحدود API تحت الضغط.

When

قبل اعتماد module مكشوف أو بعد refactor حساس.

Why

قد ينجح backend في unit tests ويفشل تحت concurrency حقيقي.

02-schemathesis

Schemathesis / OpenAPI

يهاجم endpoints تلقائياً اعتماداً على عقد OpenAPI المنشور.

When

بعد تثبيت DTOs وSwagger وValidationPipe وHTTP statuses.

Why

يكشف الفرق بين التوثيق والتحقق الحقيقي والردود.

03-unit

Unit tests

يعزل قراراً أو DTO أو service أو guard أو mapper لاختبار الفروع.

When

في بداية hardening، قبل refactor، ولقتل Stryker mutants.

Why

يثبت القواعد بدون الاعتماد على الشبكة أو قاعدة البيانات.

04-integration

Integration tests

يتحقق من الحدود بين modules وproviders وtransactions وقاعدة البيانات.

When

عندما تعتمد المنطق على Prisma أو transaction أو services مركبة.

Why

يكشف أخطاء تخفيها mocks المتفائلة.

05-e2e

E2E tests

يختبر flow API كاملاً من HTTP request إلى السلوك المتوقع.

When

للمسارات الحساسة مثل auth أو contact أو admin أو notifications.

Why

يثبت أن controller وvalidation وauth وservice وresponse تعمل معاً.

06-smoke

Smoke tests

يتحقق بسرعة أن النظام يعمل ويرد على المسارات الحرجة.

When

بعد build أو deploy محلي أو تغيير environment.

Why

يمنع تشغيل اختبارات مكلفة ضد API متوقف أو مضبوط بشكل خاطئ.

07-zap

ZAP security checks

يراقب سطح HTTP المكشوف لاكتشاف إشارات أمنية أساسية.

When

على routes عامة أو admin أو auth أو أي endpoint مكشوف.

Why

يضيف رؤية runtime لسطح الهجوم.

08-mutation

Stryker mutation

يغير الكود تلقائياً ليتحقق هل الاختبارات تكشف تغير السلوك.

When

بعد تغطية قوية لقياس قوة الاختبارات.

Why

التغطية وحدها لا تكفي؛ Stryker يقيس قوة assertions.

portfolio-api/test

Module-by-module quality factory

Each backend module owns the same quality surface, from contract checks to mutation testing, with a dedicated global runner and local README.

01

01-perf

Load, latency and concurrency baseline.

02

02-schemathesis

OpenAPI contract attack against real endpoints.

03

03-unit

DTOs, services, guards, modules and branch decisions.

04

04-integration

Database, providers and cross-service boundaries.

05

05-e2e

Real API flows through the application surface.

06

06-smoke

Runtime availability and critical path sanity checks.

07

07-zap

Basic exposed security signals.

08

08-mutation

Stryker mutation strength and test robustness.

Sample modules already shaped with this convention

admin-authadmin-dashboardadmin-supportaudit-logschatchatbotcontacthealthleadsmonitoringnotifications
test/<module>/
├── 01-perf
├── 02-schemathesis
├── 03-unit
├── 04-integration
├── 05-e2e
├── 06-smoke
├── 07-zap
├── 08-mutation
├── scripts/run-<module>-global.sh
└── README.md
bash

Global module runner

One command can run the module quality chain with explicit toggles.

MODULE_NAME="admin-auth"RUN_ADMIN_AUTH_SCHEMATHESIS="${RUN_ADMIN_AUTH_SCHEMATHESIS:-true}"RUN_ADMIN_AUTH_SMOKE="${RUN_ADMIN_AUTH_SMOKE:-true}"RUN_ADMIN_AUTH_UNIT="${RUN_ADMIN_AUTH_UNIT:-true}"RUN_ADMIN_AUTH_INTEGRATION="${RUN_ADMIN_AUTH_INTEGRATION:-true}"RUN_ADMIN_AUTH_E2E="${RUN_ADMIN_AUTH_E2E:-true}"RUN_ADMIN_AUTH_MUTATION="${RUN_ADMIN_AUTH_MUTATION:-true}"
bash

Schemathesis contract attack

OpenAPI is fetched from the running API, then attacked in Docker.

SCHEMA_FETCH_URL="${SCHEMA_FETCH_URL:-http://localhost:4002/api/docs-json}"SCHEMATHESIS_BASE_URL="${SCHEMATHESIS_BASE_URL:-http://host.docker.internal:4002}"SCHEMATHESIS_PATH_REGEX="${SCHEMATHESIS_PATH_REGEX:-^/api/v1/admin/auth/(login|refresh|logout|me)$}"docker run --rm --add-host=host.docker.internal:host-gateway \  ghcr.io/schemathesis/schemathesis:stable run openapi-admin-auth.json
json

Stryker mutation gate

Mutation score is a hard quality threshold, not a vanity metric.

{  "testRunner": "jest",  "mutate": ["src/modules/admin-auth/**/*.ts"],  "coverageAnalysis": "perTest",  "thresholds": {    "high": 100,    "low": 100,    "break": 100  }}
javascript

k6 health baseline

Performance tests expose latency and failure-rate risks outside unit isolation.

export const options = {  thresholds: {    http_req_failed: ["rate<0.01"],    checks: ["rate>0.99"],    "http_req_duration{endpoint:health}": ["p(95)<250", "p(99)<500"],  },};

الأداة → الخطر

كل أداة تهاجم نوعاً مختلفاً من المخاطر.

الجودة ليست تجميع شعارات. كل خطوة لها سبب واضح وتغطي زاوية مختلفة.

TypeScript

أخطاء ثابتة

يكشف مشاكل الأنواع قبل runtime خاصة في DTOs وservices والعقود الداخلية.

Unit tests

قواعد عمل هشة

تثبت القواعد المهمة والفروع والأخطاء والحالات الحدية المعزولة.

Integration tests

حدود مخفية

تتحقق من التفاعل بين services والمعاملات وقاعدة البيانات والاعتماديات.

E2E tests

تدفقات API ناقصة

تتحقق من flow حقيقي من endpoint إلى السلوك المتوقع.

k6

الضغط والتزامن

يكشف latency وlocks وN+1 وcontention وسلوك لا يظهر في الاختبارات المعزولة.

Schemathesis

عقد OpenAPI خاطئ

يكشف الفرق بين Swagger وDTOs وValidationPipe وHTTP statuses والردود الفعلية.

ZAP

سطح runtime مكشوف

يرصد إشارات أمنية أساسية مرئية من خارج النظام.

Stryker

اختبارات ضعيفة

يثبت هل test suite تكتشف تغييرات السلوك أم لا.

نموذج الثقة

الثقة ترتفع عندما نهاجم عدة مخاطر.

هذا الرسم نموذج تعليمي وليس إحصائية علمية.

Static20%Unit38%Integration55%E2E68%Contract80%Runtime88%Mutation95%

Static

20%

الكود يترجم وتقل الأخطاء الواضحة.

Unit

38%

تبدأ قرارات العمل الأساسية بالتثبيت.

Integration

55%

حدود service/database/API تصبح أكثر أماناً.

E2E

68%

الـ flows الحقيقية يتم التحقق منها من البداية للنهاية.

Contract

80%

العقد العام يتم اختباره تلقائياً.

Runtime

88%

الأداء وsmoke وruntime security يضيفون رؤية حقيقية.

Mutation

95%

الاختبارات تثبت أنها تكشف التغييرات الخطيرة.

سلسلة الجودة

الجودة سلسلة عمل وليست زخرفة.

كل مرحلة تقلل نوعاً من المخاطر: typing، العقد، السلوك، runtime، الأمن أو قوة الاختبارات.

01

Static confidence

Check typing, formatting, conventions and obvious errors before runtime.

TypeScriptESLintPrettierBuild

02

Behavior confidence

Test business decisions, integrations and end-to-end user paths.

UnitIntegrationE2ESmoke

03

Contract confidence

Attack API contracts and verify that documentation reflects real behavior.

OpenAPISchemathesisSwaggerDTO validation

04

Hardening confidence

Actively look for weaknesses instead of stopping at a green build.

StrykerZAPk6Audit logs

ماذا يثبت هذا

القيمة في الانضباط المتكرر.

هذه الصفحة تعرض منهجاً: تنظيم، تحقق، توثيق، ترجمة، قياس وrefactor عند ظهور حدود.

Readable architecture

Pages, content, components and routes are separated to stay maintainable.

Real refactoring

Oversized files are split instead of being accepted as silent debt.

Verifiable SEO

Sitemap, canonical, hreflang and localized routes are treated as public contracts.

Proof through product

The site itself demonstrates the expected level: content, UI, architecture and validation.

دليل قابل للاستخدام

النقاش التقني يمكن أن يبدأ من دليل ملموس.

لمهام backend أو استعادة مشروع أو منصة منتج، هذه الصفحة تصلح كنقطة دخول تقنية.