# mohammed-lutfi144/washija-project architecture

> Architecture diagram of the GitHub repository mohammed-lutfi144/washija-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohammed-lutfi144/washija-project
- Repository: https://github.com/mohammed-lutfi144/washija-project

## Overview

وَشيجة منصة لمتابعة الطلاب تربط توثيق المعلم اليومي بالتقارير والأنشطة المنزلية التي يتابعها ولي الأمر. إلى جانب هذا المسار، توفر مراجعة الأنماط والتنبيهات ومساعدًا ذكيًا مستندًا إلى سياق الطالب ومعرفة متخصصة. يوضح الرسم المسارات التي تسندها المقتطفات وفهارس المراجع؛ بعض الروابط التشغيلية لمسارات لم تُقرأ موضحة بخط متقطع ومن دون دليل مباشر.

Main entry points: [`lib/supabase/server.ts`](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/supabase/server.ts) (Supabase), [`app/parent/page.tsx`](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/parent/page.tsx) (ملخص الأسرة), [`app/teacher/page.tsx`](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/page.tsx) (لوحة المعلم), [`app/api/assistant/route.ts`](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/api/assistant/route.ts) (مساعد الأسرة)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["الدخول والصلاحيات"]
  node_auth["تسجيل وصلاحيات<br/>[auth.ts]"]
  node_auth_ui["واجهات الدخول<br/>[page.tsx]"]
end

subgraph group_school["متابعة المعلم"]
  node_teacher_home["لوحة المعلم<br/>[page.tsx]"]
  node_student_records["ملفات الطلاب<br/>[page.tsx]"]
  node_daily_logs["توثيق اليوم<br/>[log-form.tsx]"]
  node_pattern_review["مراجعة الأنماط<br/>[page.tsx]"]
  node_alerts["تنبيهات الطلاب<br/>[alert-list.tsx]"]
end

subgraph group_family["متابعة الأسرة"]
  node_parent_home["ملخص الأسرة<br/>[page.tsx]"]
  node_parent_history["سجل التقدم<br/>[page.tsx]"]
  node_responses["ردود الأنشطة<br/>[response-card.tsx]"]
  node_charts["رسوم التقدم<br/>[student-charts.tsx]"]
  node_report_render["عرض التقارير<br/>[report-view.tsx]"]
end

subgraph group_intelligence["التحليل والمساعدة"]
  node_report_generation["إنشاء التقارير<br/>[generate.ts]"]
  node_pattern_analysis["تحليل الأنماط<br/>[analyze.ts]"]
  node_pattern_rules["قواعد التنبيه<br/>[rules.ts]"]
  node_assistant_api["مساعد الأسرة<br/>[route.ts]"]
  node_assistant_context["سياق الطالب<br/>[context.ts]"]
  node_knowledge["استرجاع المعرفة<br/>[retrieve.ts]"]
  node_gemini["خدمة Gemini<br/>[gemini.ts]"]
end

node_teacher(("المعلم"))
node_parent(("ولي الأمر"))
node_database[("Supabase<br/>[server.ts]")]

node_teacher -.->|"يسجل الدخول"| node_auth_ui
node_parent -.->|"يسجل الدخول"| node_auth_ui
node_auth_ui -.->|"يتحقق"| node_auth
node_auth -->|"يقرأ الملف"| node_database
node_teacher -.->|"يفتح اللوحة"| node_teacher_home
node_teacher_home -->|"يفرض الدور"| node_auth
node_teacher_home -->|"يقرأ السجلات"| node_database
node_teacher -.->|"يوثق اليوم"| node_daily_logs
node_daily_logs -.->|"يحفظ التوثيق"| node_database
node_teacher_home -->|"يفتح ملف الطالب"| node_student_records
node_student_records -->|"يقرأ بيانات الطالب"| node_database
node_student_records -->|"يطلب التحليل"| node_pattern_analysis
node_teacher -.->|"يراجع النتائج"| node_pattern_review
node_pattern_review -->|"يقرأ الأنماط"| node_database
node_teacher_home -->|"يعرض التنبيهات"| node_alerts
node_alerts -->|"يحدّث التنبيه"| node_database
node_pattern_analysis -.->|"يقرأ بيانات التحليل"| node_database
node_pattern_rules -.->|"يقرأ سجلات الطلاب"| node_database
node_parent -.->|"يتابع التقرير"| node_parent_home
node_parent_home -->|"يفرض الدور"| node_auth
node_parent_home -->|"يقرأ التقرير والنشاط"| node_database
node_parent_home -->|"يعرض التقرير"| node_report_render
node_parent_home -->|"يعرض النشاط"| node_responses
node_parent_home -.->|"يفتح السجل"| node_parent_history
node_parent_history -->|"يقرأ السجل"| node_database
node_parent_home -.->|"يفتح التقدم"| node_charts
node_charts -->|"يعرض بيانات التقدم"| node_database
node_teacher -.->|"يطلب تقريرًا"| node_report_generation
node_report_generation -.->|"يستخدم بيانات التقرير"| node_database
node_parent -.->|"يسأل المساعد"| node_assistant_api
node_assistant_api -->|"يتحقق من الدور"| node_auth
node_assistant_api -->|"يحفظ المحادثة ويقرأ الطالب"| node_database
node_assistant_api -->|"يبني السياق"| node_assistant_context
node_assistant_context -->|"يسترجع المعرفة"| node_knowledge
node_assistant_api -->|"يبث الرد"| node_gemini

click node_auth "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/auth.ts"
click node_auth_ui "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/login/page.tsx"
click node_teacher_home "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/page.tsx"
click node_student_records "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/students/%5Bid%5D/page.tsx"
click node_daily_logs "https://github.com/mohammed-lutfi144/washija-project/blob/main/components/log-form.tsx"
click node_pattern_review "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/patterns/page.tsx"
click node_alerts "https://github.com/mohammed-lutfi144/washija-project/blob/main/components/alert-list.tsx"
click node_parent_home "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/parent/page.tsx"
click node_parent_history "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/parent/history/page.tsx"
click node_responses "https://github.com/mohammed-lutfi144/washija-project/blob/main/components/response-card.tsx"
click node_charts "https://github.com/mohammed-lutfi144/washija-project/blob/main/components/charts/student-charts.tsx"
click node_report_render "https://github.com/mohammed-lutfi144/washija-project/blob/main/components/report-view.tsx"
click node_report_generation "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/reports/generate.ts"
click node_pattern_analysis "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/patterns/analyze.ts"
click node_pattern_rules "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/patterns/rules.ts"
click node_assistant_api "https://github.com/mohammed-lutfi144/washija-project/blob/main/app/api/assistant/route.ts"
click node_assistant_context "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/assistant/context.ts"
click node_knowledge "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/knowledge/retrieve.ts"
click node_gemini "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/ai/gemini.ts"
click node_database "https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/supabase/server.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_auth_ui toneBlue
class node_teacher_home,node_student_records,node_daily_logs,node_pattern_review,node_alerts,node_database toneAmber
class node_parent_home,node_parent_history,node_responses,node_charts,node_report_render toneMint
class node_report_generation,node_pattern_analysis,node_pattern_rules,node_assistant_api,node_assistant_context,node_knowledge,node_gemini toneRose
class node_teacher,node_parent toneIndigo
```

## Components

### الدخول والصلاحيات

- [تسجيل وصلاحيات](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/auth.ts): `lib/auth.ts`
- [واجهات الدخول](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/login/page.tsx): `app/login/page.tsx`

### متابعة المعلم

- [لوحة المعلم](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/page.tsx): `app/teacher/page.tsx`
- [ملفات الطلاب](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/students/%5Bid%5D/page.tsx): `app/teacher/students/[id]/page.tsx`
- [توثيق اليوم](https://github.com/mohammed-lutfi144/washija-project/blob/main/components/log-form.tsx): `components/log-form.tsx`
- [مراجعة الأنماط](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/teacher/patterns/page.tsx): `app/teacher/patterns/page.tsx`
- [تنبيهات الطلاب](https://github.com/mohammed-lutfi144/washija-project/blob/main/components/alert-list.tsx): `components/alert-list.tsx`

### متابعة الأسرة

- [ملخص الأسرة](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/parent/page.tsx): `app/parent/page.tsx`
- [سجل التقدم](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/parent/history/page.tsx): `app/parent/history/page.tsx`
- [ردود الأنشطة](https://github.com/mohammed-lutfi144/washija-project/blob/main/components/response-card.tsx): `components/response-card.tsx`
- [رسوم التقدم](https://github.com/mohammed-lutfi144/washija-project/blob/main/components/charts/student-charts.tsx): `components/charts/student-charts.tsx`
- [عرض التقارير](https://github.com/mohammed-lutfi144/washija-project/blob/main/components/report-view.tsx): `components/report-view.tsx`

### التحليل والمساعدة

- [إنشاء التقارير](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/reports/generate.ts): `lib/reports/generate.ts`
- [تحليل الأنماط](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/patterns/analyze.ts): `lib/patterns/analyze.ts`
- [قواعد التنبيه](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/patterns/rules.ts): `lib/patterns/rules.ts`
- [مساعد الأسرة](https://github.com/mohammed-lutfi144/washija-project/blob/main/app/api/assistant/route.ts): `app/api/assistant/route.ts`
- [سياق الطالب](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/assistant/context.ts): `lib/assistant/context.ts`
- [استرجاع المعرفة](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/knowledge/retrieve.ts): `lib/knowledge/retrieve.ts`
- [خدمة Gemini](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/ai/gemini.ts): `lib/ai/gemini.ts`

### Other components

- **المعلم**
- **ولي الأمر**
- [Supabase](https://github.com/mohammed-lutfi144/washija-project/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`

## Connections

- المعلم → واجهات الدخول: يسجل الدخول
- ولي الأمر → واجهات الدخول: يسجل الدخول
- واجهات الدخول → تسجيل وصلاحيات: يتحقق
- تسجيل وصلاحيات → Supabase: يقرأ الملف (evidence: `lib/auth.ts`)
- المعلم → لوحة المعلم: يفتح اللوحة
- لوحة المعلم → تسجيل وصلاحيات: يفرض الدور (evidence: `app/teacher/page.tsx`)
- لوحة المعلم → Supabase: يقرأ السجلات (evidence: `app/teacher/page.tsx`)
- المعلم → توثيق اليوم: يوثق اليوم
- توثيق اليوم → Supabase: يحفظ التوثيق
- لوحة المعلم → ملفات الطلاب: يفتح ملف الطالب (evidence: `app/teacher/page.tsx`)
- ملفات الطلاب → Supabase: يقرأ بيانات الطالب (evidence: `app/teacher/students/[id]/page.tsx`)
- ملفات الطلاب → تحليل الأنماط: يطلب التحليل
- المعلم → مراجعة الأنماط: يراجع النتائج
- مراجعة الأنماط → Supabase: يقرأ الأنماط (evidence: `app/teacher/patterns/page.tsx`)
- لوحة المعلم → تنبيهات الطلاب: يعرض التنبيهات (evidence: `app/teacher/page.tsx`)
- تنبيهات الطلاب → Supabase: يحدّث التنبيه (evidence: `components/alert-list.tsx`)
- تحليل الأنماط → Supabase: يقرأ بيانات التحليل
- قواعد التنبيه → Supabase: يقرأ سجلات الطلاب
- ولي الأمر → ملخص الأسرة: يتابع التقرير
- ملخص الأسرة → تسجيل وصلاحيات: يفرض الدور (evidence: `app/parent/page.tsx`)
- ملخص الأسرة → Supabase: يقرأ التقرير والنشاط (evidence: `app/parent/page.tsx`)
- ملخص الأسرة → عرض التقارير: يعرض التقرير (evidence: `app/parent/page.tsx`)
- ملخص الأسرة → ردود الأنشطة: يعرض النشاط (evidence: `app/parent/page.tsx`)
- ملخص الأسرة → سجل التقدم: يفتح السجل
- سجل التقدم → Supabase: يقرأ السجل (evidence: `app/parent/history/page.tsx`)
- ملخص الأسرة → رسوم التقدم: يفتح التقدم
- رسوم التقدم → Supabase: يعرض بيانات التقدم (evidence: `app/parent/progress/page.tsx`)
- المعلم → إنشاء التقارير: يطلب تقريرًا
- إنشاء التقارير → Supabase: يستخدم بيانات التقرير
- ولي الأمر → مساعد الأسرة: يسأل المساعد
- مساعد الأسرة → تسجيل وصلاحيات: يتحقق من الدور (evidence: `app/api/assistant/route.ts`)
- مساعد الأسرة → Supabase: يحفظ المحادثة ويقرأ الطالب (evidence: `app/api/assistant/route.ts`)
- مساعد الأسرة → سياق الطالب: يبني السياق (evidence: `app/api/assistant/route.ts`)
- سياق الطالب → استرجاع المعرفة: يسترجع المعرفة (evidence: `lib/assistant/context.ts`)
- مساعد الأسرة → خدمة Gemini: يبث الرد (evidence: `app/api/assistant/route.ts`)
