مساحة المتعلّمLearner hub

الحزمة التعليمية الكاملةComplete learner course pack

الأسبوع السابعFastAPI وPydantic في الذاكرةWeek 7Day 1 — HTTP contracts before code

مواد تعلّم مفتوحة للدراسة المستقلة. يبقى التقدم غير الرسمي في هذا المتصفح فقط، وقد يُمحى عند مسح بيانات تخزين المتصفح. لا يُنشأ هنا حساب أو سجل حضور أو درجة أو نتيجة مساق رسمية.Open learning materials for independent study. Unofficial progress stays only in this browser and can be erased if browser storage is cleared. No account, attendance record, score, or official course result is created here.

تنزيلات المساقCourse downloads

إصدار الحلSolution release

يتوفر بعد التحقق ونافذة الاستدراك والإصدار المعتمد من المدرّبAvailable after the checkpoint, recovery window, and trainer-approved release

اليوم 1Day 1

اليوم 1 — عقود HTTP قبل الكودDay 1 — HTTP contracts before code

ملخص الشرائحSlide summary

الأهدافObjectives

  • اكتب عقود أربع نقاط نهاية لإعلانات خيالية وتوقع استجابات النجاح والإدخال غير الصالح والسجل المفقود.Draft four endpoint contracts for fictional notices and predict success, invalid-input and missing-record responses.

المتطلبات المسبقةPrerequisites

  • أكمل عمل عمليات السجلات المتحقق منها للأسبوع السادس أو مسار الدعم المتفق عليه.Complete the Week 6 validated record-operation work or the agreed supported route.
  • افتح حزمة بداية الأسبوع السابع دون تغيير باستخدام Python 3.11 أو أحدث والاعتماديات المثبتة. استخدم عملية محلية واحدة والإعلانين الخياليين؛ ولا تحتاج قاعدة بيانات.Open the unchanged Week 7 starter with Python 3.11 or newer and the pinned dependencies. Use a single local process and the two fictional notices; no database is required.

الشروحاتExplanations

مورد واحد وأربع عملياتOne resource, four operations

تصف طريقة HTTP العملية ويحدد المسار المجموعة أو مورداً واحداً. يمثل JSON البيانات بينما يميز رمز الحالة النتيجة. الطلب الصحيح شكلياً لمعرف غير موجود فشل في الجلب لا فشل في المخطط.HTTP method describes the operation; the path identifies the collection or one resource. JSON is the representation, while the status code distinguishes outcome. A valid-shaped request for an absent id is a lookup failure, not a schema failure.

أمثلةExamples
إنشاء ← POST /notices ← 201؛ عرض وجلب وتحديث ← 200؛ جسم غير صالح ← 422؛ معرف مفقود ← 404.Create → POST /notices → 201; list/get/update → 200; invalid body → 422; missing id → 404.

الشرائحSlides

الطريقة والمسار والجسم ورمز الحالةMethod, path, body and status

  • اكتب عقود أربع نقاط نهاية لإعلانات خيالية وتوقع استجابات النجاح والإدخال غير الصالح والسجل المفقود.Draft four endpoint contracts for fictional notices and predict success, invalid-input and missing-record responses.

اسأل عن الاستجابة القابلة للملاحظة التي تثبت هدف اليوم.Ask what observable response will prove today's objective.

مورد واحد وأربع عملياتOne resource, four operations

  • إنشاء ← POST /notices ← 201؛ عرض وجلب وتحديث ← 200؛ جسم غير صالح ← 422؛ معرف مفقود ← 404.Create → POST /notices → 201; list/get/update → 200; invalid body → 422; missing id → 404.

توقف لتوقع الرمز وJSON قبل تنفيذ الطلب.Pause for the predicted status and JSON before executing the request.

البيانات الاصطناعية والحالة المؤقتةSynthetic data and temporary state

  • استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ذكّر المتعلمين بأن إعادة التشغيل تفقد التغييرات وأن التخزين الدائم للأسبوع الثامن.Remind learners that restart loses changes and persistence belongs to Week 8.

التدريب الموجّهGuided practice

  • صنّف بطاقات الطلب إلى مسار مجموعة أو فرد ثم اشرح لماذا يحتاج العنوان الفارغ والمعرف 999 إلى استجابتين مختلفتين.Sort request cards by collection or individual path, then explain why a blank title and id 999 need different responses.

ورقة العملWorksheet

  1. قدّم جدول نقاط النهاية ذي الصفوف الأربعة وأمثلة طلب واستجابة مشروحة وتعليل الرموز 201 و200 و422 و404.Submit the four-row endpoint table, annotated request/response examples, and the reasoning for 201, 200, 422 and 404.مرجع الدليل: w7d1-contract-evidenceEvidence reference: w7d1-contract-evidence

خطوات المختبرLab steps

  1. ابدأ من عينة الإعلانين وتوقع الرمز وJSON الاستجابة وتغييرات الذاكرة قبل التنفيذ.Start from the two-notice fixture and predict status, response JSON and memory changes before execution.
  2. أكمل endpoint-table.md للإنشاء والعرض والجلب وتحديث النشر. توقع JSON الطلب والاستجابة لكل حالة منشورة قبل فتح المحرر.Complete endpoint-table.md for create, list, get and publication update. Predict request and response JSON for all published cases before opening the editor.
  3. قارن الاستجابة الفعلية والمتوقعة وأصلح أول حد مختلف وكرر من ذاكرة نظيفة.Compare actual and expected responses, repair the first differing boundary, and repeat from clean memory.
  4. احفظ دليل الطلب والاستجابة الخيالي والتعليل وملاحظة استخدام الذكاء الاصطناعي أو عدم استخدامه فقط.Save only fictional request/response evidence, reasoning and the AI-use or non-use note.

البيانات الاصطناعيةSynthetic data

الإدخال المقدمSupplied inputالنوع المتوقعExpected kind
POST /notices {"title":"Practice notice","body":"Fictional workshop."} → id 3, published false, 201accepted
POST /notices {"title":" ","body":"Fictional workshop."} → 422, unchanged memoryrejected
PATCH /notices/1 {"published":true} → 200, title and body unchangedaccepted
GET or PATCH /notices/999 with valid input → 404rejected
create id 3 → restart single process → original ids [1,2]summary

مسرد الإنجليزية التقنيةTechnical English glossary

  • فعل العملية في HTTPmethod
  • عنوان المورد داخل APIpath
  • رمز نتيجة الطلبstatus code

الخصوصيةPrivacy

استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ممارسة الذكاء الاصطناعيAI practice

يمكن للذكاء الاصطناعي مقارنة مفاهيم HTTP بعد كتابة جدول نقاط النهاية. عليك تعريف المخططات وتنفيذ نقاط النهاية وتشغيل كل طلب موثق وشرح كل اقتراح مقبول؛ ولا تطلب حل التحقق الكامل.AI may compare HTTP concepts after you draft the endpoint table. You must define the schemas, implement the endpoints, run each documented request and explain every accepted suggestion; do not request the complete checkpoint solution.

الاستدراكRecovery

خلال أسبوع واحد أصلح حد مخطط أو نقطة نهاية واحدة كل مرة وأعد التقاط النتائج الصالحة وغير الصالحة والمفقودة نفسها ثم أعد تقديم جدول عقد نقاط النهاية.Within one week, repair one schema or endpoint boundary at a time, recapture the same valid/invalid/missing outcomes, and resubmit the endpoint contract table.

أخطاء شائعة ينبغي ملاحظتهاCommon errors to notice

  • إرجاع 200 مع نص خطأ بدلاً من 404 أو استجابة التحقق المحددة في العقد.Returning 200 with an error string instead of the contract's 404 or validation response.
  • تجتاز المسافات فحص الطول لأن إزالتها متأخرة أو تتحول قيمة نصية بصمت إلى منطقية.Whitespace passes a length check because stripping happens too late, or a text value is silently converted to boolean.
  • تعيد الاختبارات استخدام ذاكرة معدلة أو تدعي التخزين الدائم لأن العملية لم تعد تشغيلها.Tests reuse mutated memory or claim persistence because the process was never restarted.
دليلي التعلّمي المُبلّغ عنه ذاتياًMy self-reported learning evidence

يُحفظ في هذا المتصفح فقط لدعم تعلّمك الشخصي. ليس حضوراً ولا درجة ولا نتيجة تحقق ولا سجلاً لشهادة.Saved only in this browser to support your own learning. It is not attendance, a score, a checkpoint result, or a certificate record.

جارٍ تحميل ملاحظاتك التعليمية المحلية…Loading your local learning notes…

اليوم 2Day 2

اليوم 2 — حدود الطلب والاستجابة في PydanticDay 2 — Pydantic request and response boundaries

ملخص الشرائحSlide summary

الأهدافObjectives

  • عرّف نماذج الإنشاء وتحديث النشر والاستجابة بقيود حقول صريحة وميّز القيم الغائبة والفارغة والخاطئة النوع.Define the create, publication-update and response models with explicit field limits and distinguish omitted, blank and wrong-type values.

المتطلبات المسبقةPrerequisites

  • أكمل عمل عمليات السجلات المتحقق منها للأسبوع السادس أو مسار الدعم المتفق عليه.Complete the Week 6 validated record-operation work or the agreed supported route.
  • افتح حزمة بداية الأسبوع السابع دون تغيير باستخدام Python 3.11 أو أحدث والاعتماديات المثبتة. استخدم عملية محلية واحدة والإعلانين الخياليين؛ ولا تحتاج قاعدة بيانات.Open the unchanged Week 7 starter with Python 3.11 or newer and the pinned dependencies. Use a single local process and the two fictional notices; no database is required.

الشروحاتExplanations

التحقق وتحويل البيانات مهمتان مختلفتانValidation and serialization are different jobs

يقدم طلب الإنشاء العنوان والجسم ويحدد الخادم المعرف وpublished=false. أزل الفراغات قبل فرض الحد الأدنى للطول كي لا تكون المسافات عنواناً. يقبل التحديث published فقط كقيمة منطقية صارمة مطلوبة وتصف الاستجابة الحقول الأربعة. امنع حقول الطلب الزائدة بدلاً من قبولها بصمت.A create request supplies title and body; the server assigns id and published=false. Trim text before enforcing minimum length, so spaces are not a title. The update accepts only a required strict boolean published; the response describes all four stored fields. Forbid extra request fields rather than silently accepting them.

أمثلةExamples
title "   " مرفوض؛ published "yes" مرفوض؛ published true مقبول.title "   " → rejected; published "yes" → rejected; published true → accepted.

الشرائحSlides

التحقق قبل منطق نقطة النهايةValidate before endpoint logic

  • عرّف نماذج الإنشاء وتحديث النشر والاستجابة بقيود حقول صريحة وميّز القيم الغائبة والفارغة والخاطئة النوع.Define the create, publication-update and response models with explicit field limits and distinguish omitted, blank and wrong-type values.

اسأل عن الاستجابة القابلة للملاحظة التي تثبت هدف اليوم.Ask what observable response will prove today's objective.

التحقق وتحويل البيانات مهمتان مختلفتانValidation and serialization are different jobs

  • title " " مرفوض؛ published "yes" مرفوض؛ published true مقبول.title " " → rejected; published "yes" → rejected; published true → accepted.

توقف لتوقع الرمز وJSON قبل تنفيذ الطلب.Pause for the predicted status and JSON before executing the request.

البيانات الاصطناعية والحالة المؤقتةSynthetic data and temporary state

  • استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ذكّر المتعلمين بأن إعادة التشغيل تفقد التغييرات وأن التخزين الدائم للأسبوع الثامن.Remind learners that restart loses changes and persistence belongs to Week 8.

التدريب الموجّهGuided practice

  • ابنِ مصفوفة حقول تبين النوع والإلزام والطول؛ وقارن تحقق المخطط بجلب المورد دون كتابة المسارات بعد.Build a field matrix showing type, requiredness and length; compare schema validation with a resource lookup without writing routes yet.

ورقة العملWorksheet

  1. قدّم مصفوفة الحقول ومخرجات تحقق النماذج وشرح سبب عدم قدرة العميل على تعيين المعرف أو تعديل العنوان عبر تحديث النشر فقط.Submit the field matrix, model-validation outputs and explanation of why the client cannot assign id or alter title through the publication-only update.مرجع الدليل: w7d2-schema-evidenceEvidence reference: w7d2-schema-evidence

خطوات المختبرLab steps

  1. ابدأ من عينة الإعلانين وتوقع الرمز وJSON الاستجابة وتغييرات الذاكرة قبل التنفيذ.Start from the two-notice fixture and predict status, response JSON and memory changes before execution.
  2. أكمل NoticeCreate وNoticeUpdate وNoticeRead. افحص قيمة عادية وعنواناً من مسافات وجسماً أطول من الحد وحقلاً زائداً وpublished غائباً أو غير منطقي.Complete NoticeCreate, NoticeUpdate and NoticeRead. Check a normal value, whitespace-only title, oversized body, extra field, omitted published and non-boolean published.
  3. قارن الاستجابة الفعلية والمتوقعة وأصلح أول حد مختلف وكرر من ذاكرة نظيفة.Compare actual and expected responses, repair the first differing boundary, and repeat from clean memory.
  4. احفظ دليل الطلب والاستجابة الخيالي والتعليل وملاحظة استخدام الذكاء الاصطناعي أو عدم استخدامه فقط.Save only fictional request/response evidence, reasoning and the AI-use or non-use note.

البيانات الاصطناعيةSynthetic data

الإدخال المقدمSupplied inputالنوع المتوقعExpected kind
POST /notices {"title":"Practice notice","body":"Fictional workshop."} → id 3, published false, 201accepted
POST /notices {"title":" ","body":"Fictional workshop."} → 422, unchanged memoryrejected
PATCH /notices/1 {"published":true} → 200, title and body unchangedaccepted
GET or PATCH /notices/999 with valid input → 404rejected
create id 3 → restart single process → original ids [1,2]summary

مسرد الإنجليزية التقنيةTechnical English glossary

  • شكل البيانات وقواعدهاschema
  • رفض المدخل غير الموافق للعقدvalidation
  • قيمة true أو false دون تحويل نصيstrict boolean

الخصوصيةPrivacy

استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ممارسة الذكاء الاصطناعيAI practice

يمكن للذكاء الاصطناعي مقارنة مفاهيم HTTP بعد كتابة جدول نقاط النهاية. عليك تعريف المخططات وتنفيذ نقاط النهاية وتشغيل كل طلب موثق وشرح كل اقتراح مقبول؛ ولا تطلب حل التحقق الكامل.AI may compare HTTP concepts after you draft the endpoint table. You must define the schemas, implement the endpoints, run each documented request and explain every accepted suggestion; do not request the complete checkpoint solution.

الاستدراكRecovery

خلال أسبوع واحد أصلح حد مخطط أو نقطة نهاية واحدة كل مرة وأعد التقاط النتائج الصالحة وغير الصالحة والمفقودة نفسها ثم أعد تقديم دليل الحدود محددة النوع.Within one week, repair one schema or endpoint boundary at a time, recapture the same valid/invalid/missing outcomes, and resubmit the typed-boundary evidence.

أخطاء شائعة ينبغي ملاحظتهاCommon errors to notice

  • إرجاع 200 مع نص خطأ بدلاً من 404 أو استجابة التحقق المحددة في العقد.Returning 200 with an error string instead of the contract's 404 or validation response.
  • تجتاز المسافات فحص الطول لأن إزالتها متأخرة أو تتحول قيمة نصية بصمت إلى منطقية.Whitespace passes a length check because stripping happens too late, or a text value is silently converted to boolean.
  • تعيد الاختبارات استخدام ذاكرة معدلة أو تدعي التخزين الدائم لأن العملية لم تعد تشغيلها.Tests reuse mutated memory or claim persistence because the process was never restarted.
دليلي التعلّمي المُبلّغ عنه ذاتياًMy self-reported learning evidence

يُحفظ في هذا المتصفح فقط لدعم تعلّمك الشخصي. ليس حضوراً ولا درجة ولا نتيجة تحقق ولا سجلاً لشهادة.Saved only in this browser to support your own learning. It is not attendance, a score, a checkpoint result, or a certificate record.

جارٍ تحميل ملاحظاتك التعليمية المحلية…Loading your local learning notes…

اليوم 3Day 3

اليوم 3 — أربع نقاط نهاية فوق الذاكرةDay 3 — Four endpoints over memory

ملخص الشرائحSlide summary

الأهدافObjectives

  • نفّذ نقاط نهاية الإنشاء والعرض والجلب وتحديث النشر بنماذج استجابة وترتيب ثابت ومعرفات مولدة ومعالجة صريحة للسجل المفقود.Implement create, list, get and publication-update endpoints with response models, stable ordering, generated ids and explicit missing-record handling.

المتطلبات المسبقةPrerequisites

  • أكمل عمل عمليات السجلات المتحقق منها للأسبوع السادس أو مسار الدعم المتفق عليه.Complete the Week 6 validated record-operation work or the agreed supported route.
  • افتح حزمة بداية الأسبوع السابع دون تغيير باستخدام Python 3.11 أو أحدث والاعتماديات المثبتة. استخدم عملية محلية واحدة والإعلانين الخياليين؛ ولا تحتاج قاعدة بيانات.Open the unchanged Week 7 starter with Python 3.11 or newer and the pinned dependencies. Use a single local process and the two fictional notices; no database is required.

الشروحاتExplanations

ذاكرة العملية مؤقتةProcess memory is temporary

استخدم الإعلانين المقدمين كحالة أولية. يحصل كل إنشاء صالح على المعرف التالي غير المستخدم. يغير PATCH حقل published فقط ويحفظ البقية. تعيد بداية العملية المحلية الواحدة تحميل العينة وتفقد التغييرات؛ وهذا سلوك متوقع للأسبوع السابع وليس تخزيناً دائماً. لا تصل قاعدة بيانات لحل هذا القيد.Use the two supplied notices as the initial state. Each valid create obtains the next unused id. PATCH changes only published and preserves the other fields. Restarting the single local process reloads the fixture and loses changes; this is expected Week 7 behavior, not persistence. Do not attach a database to solve that limitation.

أمثلةExamples
معرفات أولية [1,2] ← إنشاء 3 ← PATCH 3 published=true ← إعادة التشغيل ← [1,2].Initial ids [1,2] → create id 3 → PATCH 3 published=true → restart → ids [1,2].

الشرائحSlides

فصل سلوك HTTP عن التخزينKeep HTTP behavior separate from storage

  • نفّذ نقاط نهاية الإنشاء والعرض والجلب وتحديث النشر بنماذج استجابة وترتيب ثابت ومعرفات مولدة ومعالجة صريحة للسجل المفقود.Implement create, list, get and publication-update endpoints with response models, stable ordering, generated ids and explicit missing-record handling.

اسأل عن الاستجابة القابلة للملاحظة التي تثبت هدف اليوم.Ask what observable response will prove today's objective.

ذاكرة العملية مؤقتةProcess memory is temporary

  • معرفات أولية [1,2] ← إنشاء 3 ← PATCH 3 published=true ← إعادة التشغيل ← [1,2].Initial ids [1,2] → create id 3 → PATCH 3 published=true → restart → ids [1,2].

توقف لتوقع الرمز وJSON قبل تنفيذ الطلب.Pause for the predicted status and JSON before executing the request.

البيانات الاصطناعية والحالة المؤقتةSynthetic data and temporary state

  • استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ذكّر المتعلمين بأن إعادة التشغيل تفقد التغييرات وأن التخزين الدائم للأسبوع الثامن.Remind learners that restart loses changes and persistence belongs to Week 8.

التدريب الموجّهGuided practice

  • تتبع الطلب عبر تحقق النموذج والجلب أو الكتابة في الذاكرة وتحويل الاستجابة والرمز. افحص الحالة قبل تحديث نشر واحد وبعده.Trace a request through model validation, memory lookup or write, response serialization and status. Check the before/after state for one publication update.

ورقة العملWorksheet

  1. قدّم خريطة المسار والدالة وJSON المنشأ والمحدث ولقطات السجل المفقود ومقارنة إعادة التشغيل التي تشرح حدود الذاكرة.Submit the route-to-function map, created and updated JSON, missing-record captures, and restart comparison explaining the in-memory boundary.مرجع الدليل: w7d3-endpoint-evidenceEvidence reference: w7d3-endpoint-evidence

خطوات المختبرLab steps

  1. ابدأ من عينة الإعلانين وتوقع الرمز وJSON الاستجابة وتغييرات الذاكرة قبل التنفيذ.Start from the two-notice fixture and predict status, response JSON and memory changes before execution.
  2. سجل الدوال الأربع في notice_api.py وأكملها. تحقق من ترتيب القائمة ومعرفات مميزة للإنشاء المتكرر وثبات العنوان والجسم في PATCH و404 للجلب والتحديث المفقودين.Register and complete the four functions in notice_api.py. Verify ascending list order, distinct ids on consecutive creates, unchanged title/body on PATCH, and 404 for missing GET and PATCH.
  3. قارن الاستجابة الفعلية والمتوقعة وأصلح أول حد مختلف وكرر من ذاكرة نظيفة.Compare actual and expected responses, repair the first differing boundary, and repeat from clean memory.
  4. احفظ دليل الطلب والاستجابة الخيالي والتعليل وملاحظة استخدام الذكاء الاصطناعي أو عدم استخدامه فقط.Save only fictional request/response evidence, reasoning and the AI-use or non-use note.

البيانات الاصطناعيةSynthetic data

الإدخال المقدمSupplied inputالنوع المتوقعExpected kind
POST /notices {"title":"Practice notice","body":"Fictional workshop."} → id 3, published false, 201accepted
POST /notices {"title":" ","body":"Fictional workshop."} → 422, unchanged memoryrejected
PATCH /notices/1 {"published":true} → 200, title and body unchangedaccepted
GET or PATCH /notices/999 with valid input → 404rejected
create id 3 → restart single process → original ids [1,2]summary

مسرد الإنجليزية التقنيةTechnical English glossary

  • مسار مرتبط بعمليةendpoint
  • حالة مؤقتة داخل العمليةin-memory
  • تحويل نموذج الاستجابة إلى JSONserialization

الخصوصيةPrivacy

استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ممارسة الذكاء الاصطناعيAI practice

يمكن للذكاء الاصطناعي مقارنة مفاهيم HTTP بعد كتابة جدول نقاط النهاية. عليك تعريف المخططات وتنفيذ نقاط النهاية وتشغيل كل طلب موثق وشرح كل اقتراح مقبول؛ ولا تطلب حل التحقق الكامل.AI may compare HTTP concepts after you draft the endpoint table. You must define the schemas, implement the endpoints, run each documented request and explain every accepted suggestion; do not request the complete checkpoint solution.

الاستدراكRecovery

خلال أسبوع واحد أصلح حد مخطط أو نقطة نهاية واحدة كل مرة وأعد التقاط النتائج الصالحة وغير الصالحة والمفقودة نفسها ثم أعد تقديم دليل نقاط النهاية الأربع.Within one week, repair one schema or endpoint boundary at a time, recapture the same valid/invalid/missing outcomes, and resubmit the four-endpoint evidence.

أخطاء شائعة ينبغي ملاحظتهاCommon errors to notice

  • إرجاع 200 مع نص خطأ بدلاً من 404 أو استجابة التحقق المحددة في العقد.Returning 200 with an error string instead of the contract's 404 or validation response.
  • تجتاز المسافات فحص الطول لأن إزالتها متأخرة أو تتحول قيمة نصية بصمت إلى منطقية.Whitespace passes a length check because stripping happens too late, or a text value is silently converted to boolean.
  • تعيد الاختبارات استخدام ذاكرة معدلة أو تدعي التخزين الدائم لأن العملية لم تعد تشغيلها.Tests reuse mutated memory or claim persistence because the process was never restarted.
دليلي التعلّمي المُبلّغ عنه ذاتياًMy self-reported learning evidence

يُحفظ في هذا المتصفح فقط لدعم تعلّمك الشخصي. ليس حضوراً ولا درجة ولا نتيجة تحقق ولا سجلاً لشهادة.Saved only in this browser to support your own learning. It is not attendance, a score, a checkpoint result, or a certificate record.

جارٍ تحميل ملاحظاتك التعليمية المحلية…Loading your local learning notes…

اليوم 4Day 4

اليوم 4 — التوثيق المولد والأدلة القابلة للتكرارDay 4 — Generated documentation and repeatable evidence

ملخص الشرائحSlide summary

الأهدافObjectives

  • افحص OpenAPI والتوثيق التفاعلي وجرب الحالات الصالحة وغير الصالحة والمفقودة وأكمل تأكيدات TestClient من عينة معادة.Inspect OpenAPI and interactive docs, exercise valid/invalid/missing cases, and complete focused TestClient assertions from a reset fixture.

المتطلبات المسبقةPrerequisites

  • أكمل عمل عمليات السجلات المتحقق منها للأسبوع السادس أو مسار الدعم المتفق عليه.Complete the Week 6 validated record-operation work or the agreed supported route.
  • افتح حزمة بداية الأسبوع السابع دون تغيير باستخدام Python 3.11 أو أحدث والاعتماديات المثبتة. استخدم عملية محلية واحدة والإعلانين الخياليين؛ ولا تحتاج قاعدة بيانات.Open the unchanged Week 7 starter with Python 3.11 or newer and the pinned dependencies. Use a single local process and the two fictional notices; no database is required.

الشروحاتExplanations

التوثيق عقد قابل للاختبارDocumentation is a testable contract

تشكل مزخرفات المسارات وأنواع الطلب ونماذج الاستجابة المخطط المولد. قارن العمليات الأربع الموثقة بجدولك؛ فظهور صفحة التوثيق وحده لا يثبت السلوك. يشغل TestClient التطبيق محلياً دون خادم يستمع للشبكة. أعد العينة ذات الصفين بين الاختبارات كي لا يخفي ترتيبها فشلاً.Decorators, request types and response models shape the generated schema. Compare all four documented operations with your endpoint table; a rendered docs page alone does not prove their behavior. TestClient runs the application locally without a listening server. Restore the two-row fixture between tests so test order cannot hide a failure.

أمثلةExamples
يجب أن تصف /docs و/openapi.json عمليات الإعلان الأربع نفسها؛ وتقارن الاختبارات الرمز وJSON الدقيق لا نص النجاح فقط./docs and /openapi.json must describe the same four notice operations; tests compare status plus exact JSON, not only success text.

الشرائحSlides

مقارنة العقد بالاستجابات الفعليةCompare the contract with real responses

  • افحص OpenAPI والتوثيق التفاعلي وجرب الحالات الصالحة وغير الصالحة والمفقودة وأكمل تأكيدات TestClient من عينة معادة.Inspect OpenAPI and interactive docs, exercise valid/invalid/missing cases, and complete focused TestClient assertions from a reset fixture.

اسأل عن الاستجابة القابلة للملاحظة التي تثبت هدف اليوم.Ask what observable response will prove today's objective.

التوثيق عقد قابل للاختبارDocumentation is a testable contract

  • يجب أن تصف /docs و/openapi.json عمليات الإعلان الأربع نفسها؛ وتقارن الاختبارات الرمز وJSON الدقيق لا نص النجاح فقط./docs and /openapi.json must describe the same four notice operations; tests compare status plus exact JSON, not only success text.

توقف لتوقع الرمز وJSON قبل تنفيذ الطلب.Pause for the predicted status and JSON before executing the request.

البيانات الاصطناعية والحالة المؤقتةSynthetic data and temporary state

  • استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ذكّر المتعلمين بأن إعادة التشغيل تفقد التغييرات وأن التخزين الدائم للأسبوع الثامن.Remind learners that restart loses changes and persistence belongs to Week 8.

التدريب الموجّهGuided practice

  • ابحث عن مخططات الطلب والاستجابة في OpenAPI ونفذ طلباً صالحاً في التوثيق ثم توقع 422 و404 والتقطهما منفصلين.Find request and response schemas in OpenAPI, execute one valid request in docs, then predict and capture 422 and 404 separately.

ورقة العملWorksheet

  1. قدّم مقارنة نقاط النهاية وOpenAPI وفئات الاستجابة الموثقة الثلاث وإعداد الذاكرة النظيفة وتشغيلَي الاختبار. اشرح بديل المخطط وTestClient دون اتصال.Submit the endpoint/OpenAPI comparison, three documented response classes, clean-memory setup and two repeated test runs. Explain the offline schema/TestClient fallback.مرجع الدليل: w7d4-docs-evidenceEvidence reference: w7d4-docs-evidence

خطوات المختبرLab steps

  1. ابدأ من عينة الإعلانين وتوقع الرمز وJSON الاستجابة وتغييرات الذاكرة قبل التنفيذ.Start from the two-notice fixture and predict status, response JSON and memory changes before execution.
  2. أكمل مطالب الاختبار الأربعة بما فيها عدم التغيير عند مدخل غير صالح ومسارا السجل المفقود. شغّل مرتين من العينة والتقط التوثيق والمخطط الخام والرموز وأجسام الاستجابة.Complete the four test prompts, including no mutation on invalid input and both missing paths. Run twice from the fixture; capture docs, raw schema, statuses and response bodies.
  3. قارن الاستجابة الفعلية والمتوقعة وأصلح أول حد مختلف وكرر من ذاكرة نظيفة.Compare actual and expected responses, repair the first differing boundary, and repeat from clean memory.
  4. احفظ دليل الطلب والاستجابة الخيالي والتعليل وملاحظة استخدام الذكاء الاصطناعي أو عدم استخدامه فقط.Save only fictional request/response evidence, reasoning and the AI-use or non-use note.

البيانات الاصطناعيةSynthetic data

الإدخال المقدمSupplied inputالنوع المتوقعExpected kind
POST /notices {"title":"Practice notice","body":"Fictional workshop."} → id 3, published false, 201accepted
POST /notices {"title":" ","body":"Fictional workshop."} → 422, unchanged memoryrejected
PATCH /notices/1 {"published":true} → 200, title and body unchangedaccepted
GET or PATCH /notices/999 with valid input → 404rejected
create id 3 → restart single process → original ids [1,2]summary

مسرد الإنجليزية التقنيةTechnical English glossary

  • وصف آلي لعقد APIOpenAPI
  • عميل محلي لاختبار الطلب والاستجابةTestClient
  • حالة بداية معروفة للاختبارfixture

الخصوصيةPrivacy

استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ممارسة الذكاء الاصطناعيAI practice

يمكن للذكاء الاصطناعي مقارنة مفاهيم HTTP بعد كتابة جدول نقاط النهاية. عليك تعريف المخططات وتنفيذ نقاط النهاية وتشغيل كل طلب موثق وشرح كل اقتراح مقبول؛ ولا تطلب حل التحقق الكامل.AI may compare HTTP concepts after you draft the endpoint table. You must define the schemas, implement the endpoints, run each documented request and explain every accepted suggestion; do not request the complete checkpoint solution.

الاستدراكRecovery

خلال أسبوع واحد أصلح حد مخطط أو نقطة نهاية واحدة كل مرة وأعد التقاط النتائج الصالحة وغير الصالحة والمفقودة نفسها ثم أعد تقديم دليل التوثيق والاختبار.Within one week, repair one schema or endpoint boundary at a time, recapture the same valid/invalid/missing outcomes, and resubmit the documentation and test evidence.

أخطاء شائعة ينبغي ملاحظتهاCommon errors to notice

  • إرجاع 200 مع نص خطأ بدلاً من 404 أو استجابة التحقق المحددة في العقد.Returning 200 with an error string instead of the contract's 404 or validation response.
  • تجتاز المسافات فحص الطول لأن إزالتها متأخرة أو تتحول قيمة نصية بصمت إلى منطقية.Whitespace passes a length check because stripping happens too late, or a text value is silently converted to boolean.
  • تعيد الاختبارات استخدام ذاكرة معدلة أو تدعي التخزين الدائم لأن العملية لم تعد تشغيلها.Tests reuse mutated memory or claim persistence because the process was never restarted.
دليلي التعلّمي المُبلّغ عنه ذاتياًMy self-reported learning evidence

يُحفظ في هذا المتصفح فقط لدعم تعلّمك الشخصي. ليس حضوراً ولا درجة ولا نتيجة تحقق ولا سجلاً لشهادة.Saved only in this browser to support your own learning. It is not attendance, a score, a checkpoint result, or a certificate record.

جارٍ تحميل ملاحظاتك التعليمية المحلية…Loading your local learning notes…

اليوم 5Day 5

اليوم 5 — التحقق الفردي لـAPI موثقةDay 5 — Individual documented API checkpoint

ملخص الشرائحSlide summary

الأهدافObjectives

  • أنجز API الإعلانات الموثقة في الذاكرة فردياً وأثبت سلوك المخططات ونقاط النهاية والسجل المفقود وفق العقد المنشور.Independently produce the documented in-memory notice API and demonstrate schema, endpoint and missing-record behavior against the published contract.

المتطلبات المسبقةPrerequisites

  • أكمل عمل عمليات السجلات المتحقق منها للأسبوع السادس أو مسار الدعم المتفق عليه.Complete the Week 6 validated record-operation work or the agreed supported route.
  • افتح حزمة بداية الأسبوع السابع دون تغيير باستخدام Python 3.11 أو أحدث والاعتماديات المثبتة. استخدم عملية محلية واحدة والإعلانين الخياليين؛ ولا تحتاج قاعدة بيانات.Open the unchanged Week 7 starter with Python 3.11 or newer and the pinned dependencies. Use a single local process and the two fictional notices; no database is required.

الشروحاتExplanations

دليل من API العاملةEvidence from the running API

يجمع التحقق الناجح مخططات طلب واستجابة محددة النوع وأربع عمليات صحيحة ونتائج صالحة وغير صالحة ومفقودة موثقة وشرحاً واضحاً للحالة المؤقتة. لا تكفي اللقطات المحفوظة أو فحوص البيئة؛ اعرض طلباً مباشرة واشرح أين يُحسم كل فشل.A passing checkpoint combines typed request/response schemas, four correct operations, documented valid/invalid/missing outcomes and a clear explanation of temporary state. Saved screenshots or passing environment checks alone are insufficient; demonstrate one request live and explain where each failure is decided.

أمثلةExamples
201 للإنشاء؛ 200 للقائمة المرتبة والجلب وتحديث النشر؛ 422 لرفض المخطط؛ 404 للجلب المفقود؛ إعادة التشغيل تعيد إعلانين.201 create; 200 ordered list/get/publication update; 422 schema rejection; 404 missing lookup; restart restores two notices.

الشرائحSlides

شرح كل حد من حدود HTTPExplain every HTTP boundary

  • أنجز API الإعلانات الموثقة في الذاكرة فردياً وأثبت سلوك المخططات ونقاط النهاية والسجل المفقود وفق العقد المنشور.Independently produce the documented in-memory notice API and demonstrate schema, endpoint and missing-record behavior against the published contract.

اسأل عن الاستجابة القابلة للملاحظة التي تثبت هدف اليوم.Ask what observable response will prove today's objective.

دليل من API العاملةEvidence from the running API

  • 201 للإنشاء؛ 200 للقائمة المرتبة والجلب وتحديث النشر؛ 422 لرفض المخطط؛ 404 للجلب المفقود؛ إعادة التشغيل تعيد إعلانين.201 create; 200 ordered list/get/publication update; 422 schema rejection; 404 missing lookup; restart restores two notices.

توقف لتوقع الرمز وJSON قبل تنفيذ الطلب.Pause for the predicted status and JSON before executing the request.

البيانات الاصطناعية والحالة المؤقتةSynthetic data and temporary state

  • استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ذكّر المتعلمين بأن إعادة التشغيل تفقد التغييرات وأن التخزين الدائم للأسبوع الثامن.Remind learners that restart loses changes and persistence belongs to Week 8.

التدريب الموجّهGuided practice

  • اقرأ المعايير وتوقع الحالات المنشورة وخطط للأدلة دون تلقي كود نقاط النهاية المكتمل.Read the criteria, predict the published cases, and plan evidence without receiving completed endpoint code.

ورقة العملWorksheet

  1. قدّم المصدر وجدول نقاط النهاية وOpenAPI ولقطات الصالح وغير الصالح والمفقود والاختبارات المتكررة ودليل إعادة التشغيل وفحص الخصوصية وملاحظة استخدام الذكاء الاصطناعي؛ واشرح حداً للمخطط وحداً للسجل المفقود مباشرة.Submit source, the endpoint table, OpenAPI, valid/invalid/missing captures, repeated tests, restart evidence, privacy scan and AI-use note; explain one schema and one missing-record boundary live.مرجع الدليل: w7d5-checkpoint-evidenceEvidence reference: w7d5-checkpoint-evidence

خطوات المختبرLab steps

  1. ابدأ من عينة الإعلانين وتوقع الرمز وJSON الاستجابة وتغييرات الذاكرة قبل التنفيذ.Start from the two-notice fixture and predict status, response JSON and memory changes before execution.
  2. انطلاقاً من البداية دون تغيير نفّذ النماذج الثلاثة ونقاط النهاية الأربع واعرض التوثيق المولد وفئات الاستجابة كلها وأعد الفحوص المركزة واشرح فقد الحالة عند إعادة التشغيل.From the unchanged starter, implement the three models and four endpoints, demonstrate the generated docs and all response classes, rerun focused checks, and explain state loss on restart.
  3. قارن الاستجابة الفعلية والمتوقعة وأصلح أول حد مختلف وكرر من ذاكرة نظيفة.Compare actual and expected responses, repair the first differing boundary, and repeat from clean memory.
  4. احفظ دليل الطلب والاستجابة الخيالي والتعليل وملاحظة استخدام الذكاء الاصطناعي أو عدم استخدامه فقط.Save only fictional request/response evidence, reasoning and the AI-use or non-use note.

البيانات الاصطناعيةSynthetic data

الإدخال المقدمSupplied inputالنوع المتوقعExpected kind
POST /notices {"title":"Practice notice","body":"Fictional workshop."} → id 3, published false, 201accepted
POST /notices {"title":" ","body":"Fictional workshop."} → 422, unchanged memoryrejected
PATCH /notices/1 {"published":true} → 200, title and body unchangedaccepted
GET or PATCH /notices/999 with valid input → 404rejected
create id 3 → restart single process → original ids [1,2]summary

مسرد الإنجليزية التقنيةTechnical English glossary

  • اتفاق الطلب والاستجابةcontract
  • نموذج شكل الاستجابةresponse model
  • مورد صحيح الهوية لكنه غير موجودmissing resource

الخصوصيةPrivacy

استخدم الإعلانات العامة الخيالية المقدمة فقط. أبقِ بيانات الاتصال الحقيقية والرسائل الخاصة والرموز السرية والسجلات التشغيلية خارج المصدر والسجلات والأمثلة والتوثيق المولد.Use only the supplied fictional public notices. Keep real contact data, private messages, tokens and operational records out of source, logs, examples and generated documentation.

ممارسة الذكاء الاصطناعيAI practice

يمكن للذكاء الاصطناعي مقارنة مفاهيم HTTP بعد كتابة جدول نقاط النهاية. عليك تعريف المخططات وتنفيذ نقاط النهاية وتشغيل كل طلب موثق وشرح كل اقتراح مقبول؛ ولا تطلب حل التحقق الكامل.AI may compare HTTP concepts after you draft the endpoint table. You must define the schemas, implement the endpoints, run each documented request and explain every accepted suggestion; do not request the complete checkpoint solution.

الاستدراكRecovery

خلال أسبوع واحد أصلح حد مخطط أو نقطة نهاية واحدة كل مرة وأعد التقاط النتائج الصالحة وغير الصالحة والمفقودة نفسها ثم أعد تقديم التحقق الفردي لـAPI الموثقة.Within one week, repair one schema or endpoint boundary at a time, recapture the same valid/invalid/missing outcomes, and resubmit the individual documented API checkpoint.

أخطاء شائعة ينبغي ملاحظتهاCommon errors to notice

  • إرجاع 200 مع نص خطأ بدلاً من 404 أو استجابة التحقق المحددة في العقد.Returning 200 with an error string instead of the contract's 404 or validation response.
  • تجتاز المسافات فحص الطول لأن إزالتها متأخرة أو تتحول قيمة نصية بصمت إلى منطقية.Whitespace passes a length check because stripping happens too late, or a text value is silently converted to boolean.
  • تعيد الاختبارات استخدام ذاكرة معدلة أو تدعي التخزين الدائم لأن العملية لم تعد تشغيلها.Tests reuse mutated memory or claim persistence because the process was never restarted.
دليلي التعلّمي المُبلّغ عنه ذاتياًMy self-reported learning evidence

يُحفظ في هذا المتصفح فقط لدعم تعلّمك الشخصي. ليس حضوراً ولا درجة ولا نتيجة تحقق ولا سجلاً لشهادة.Saved only in this browser to support your own learning. It is not attendance, a score, a checkpoint result, or a certificate record.

جارٍ تحميل ملاحظاتك التعليمية المحلية…Loading your local learning notes…