# My Daneshyar — Master TODO / Roadmap

> Single source of truth for remaining work. Last audited: 2026-07-13 (release 20260713-235959).
> Status: `[ ]` not started · `[~]` in progress · `[x]` done · `[!]` blocked (needs user input/infra)

---

## 🔥 Next Sprint — Top 10 Priority (ranked by daily user impact)

1. **[x] G26 full** — Per-student attendance report with excuse reason + student action center page for teacher (`/teacher/students/{id}`)
2. **[x] G8** — Monthly absence history grouped by month for students
3. **[x] G43** — Soft school-year enforcement: active year on grade entry + year filters
4. **[x] G53** — School reports with custom date range + CSV exports
5. **[x] G45** — Bulk karname print: PDF report cards for entire class
6. **[x] G62** — Last login / last online / sessions, not live who-is-online monitor
7. **[x] G64** — Multi-announcement configurable broadcast banners
8. **[x] G11** — Homework and exam upcoming dates list
9. **[x] G51** — Move student between classrooms with history preserved
10. **[x] G9/G13/G33/G39** — Absence-excuse request flow + exam history/correction + teacher calendar

---

## A. Deferred — needs user action first

- [!] **A1. Absent SMS template IDs** — create template on SMS.ir and FarazSMS panels, paste IDs into super admin → SMS settings → «شناسه قالب پیامک غیبت». Code fully wired.
- [!] **A2. Cloudflare HTTPS** — point domain to Cloudflare, enable proxy, SSL mode Full (strict), origin cert on Apache.
- [!] **A3. Payment gateway choice** — pick provider (Zarinpal / IDPay / Zibal / …) and supply merchant ID.
- [!] **A4. Real payment gateway integration** — after A3: swap `SmsWalletController@chargeDemo` for redirect → callback → verify. Charge modal UI stays. `invoices` + `payments` tables ready.
- [!] **A5. Post-HTTPS config** — after A2: `SESSION_SECURE_COOKIE=true`, `APP_URL=https://…`, remove HTTP redirect. 5-minute job.
- [!] **A6. DB placement decision** — MySQL currently remote at `sql.24.svpj.link` (no TLS, extra latency). Recommendation: move to app server local MySQL (already installed).
- [!] **A7. In-house video/audio server** — blocked by A2 (browsers refuse camera/mic on plain HTTP). coturn already installed + running (ports 3478 + 49152-49999/udp). After HTTPS: wire SFU + camera grid + screen share + recording into `/class-room` video tab.

## B. Performance / scale

- [x] B1. DB indexes on hot query columns
- [x] B2. Queue worker — systemd `daneshyar-queue` running `php artisan queue:work`
- [x] B3. PHP OPcache enabled + tuned
- [x] B4. Apache gzip/deflate + far-future cache headers for `/build` hashed assets
- [x] B5. Laravel config/route/view caches in deploy script
- [x] B6. Heavy SMS sends moved to queued jobs (`SendBulkSmsJob`, ShouldQueue, tries=3)
- [x] B7. Pagination on large lists — Students (perPage=80) + Users (perPage=60) with search filter
- [x] B8. Redis for cache/session/queue — `SESSION_DRIVER=redis`, `CACHE_STORE=redis`, `QUEUE_CONNECTION=redis`
- [x] B9. CDN for static assets via Cloudflare — code side ready via `ASSET_URL`/`ASSET_CDN_URL`, asset preconnect, and super-admin landing settings field
- [!] B10. Slow-query log review — needs real production traffic

## C. Landing / trust

- [x] C1. Footer trust badges: eNAMAD + ساماندهی + medal placeholders with `data-` attrs for embed codes
- [x] C2. Fill real eNAMAD embed code — super-admin configurable sanitized embed field; footer renders it when provided
- [x] C3. Fill real Samandehi embed code — super-admin configurable sanitized embed field; footer renders it when provided
- [x] C4. Achievements/medals row content — super-admin configurable JSON achievements/medals rendered in footer

## D. Credential printing

- [x] D1. Print page with credential cards (username, initial password, login URL, school name)
- [x] D2. Student username = national code (kodmeli) by default
- [x] D3. Bulk password reset → regenerates + prints in one step
- [x] D4. QR on credential cards with revocable personal login token

## E. Online classes (کلاس مجازی)

### E-core (v1, shipped)
- [x] E1–E10. Core room: participants, chat, file share, whiteboard, kick/mute, class states, attendance auto-log
- [x] E21. Personal join tokens per student per class (XXXX-XXXX), entry gate, IP-bound, mismatch detection + audit log

### E-later (v2+)
- [x] E11. WebSockets (Laravel Reverb) on port 8081, Echo.js wired; board + chat real-time
- [x] E14. Whiteboard v2: pen/eraser/text/rect/circle/line/arrow/diamond/image-paste, fill, undo/redo, zoom, PNG export, keyboard shortcuts
- [!] E12. Recording — blocked by A2 (HTTPS)
- [!] E13. Screen-share + camera grid — blocked by A2 + A7
- [!] E17. Breakout rooms — blocked by A2 + A7
- [x] E16. Live polls can reuse saved multiple-choice exam questions as poll presets
- [x] E15. Hand-raise queue with order numbers + "دعوت به صحبت"
- [x] E19. Minutes-attended report + late-join indicator
- [x] E20. Emoji reactions overlay

---

## F. Ideas backlog

- [x] F2. **In-app notification bell** — `NotificationBell.tsx` polls `/api/notifications/unread-count` every 30s. Event triggers wired: TeacherGradeController@store → notifies student, MessageController@store → notifies each recipient, TeacherHomeworkController@store → notifies all class students. Bell now shows real counts.
- [x] F3. PWA manifest, service worker, offline page, installable icons
- [x] F4. Report card PDF export
- [x] F5. Dashboard charts for attendance, SMS usage, activity
- [x] F6. Import students/teachers/users from spreadsheet files
- [x] F7. School year entity with archive/close + student promotion
- [x] F8. Login page: school logo per subdomain/school code
- [x] F9. Backup download — super_admin only, `/super-admin/backup/download`, mysqldump + storage/app zip
- [x] F10. Uptime/error alert: cron can ping `/health`; `?alert=1` logs critical failures and creates super-admin in-app alerts when health checks fail
- [x] F11. Session device list with "sign out other devices" in profile; shows last online/activity per session
- [x] F12. Audit log viewer filters by user, action type, date range
- [x] F13. Landing: live demo sandbox school with auto-reset — `/demo` creates/resets seeded demo school and logs in demo principal; configurable from super admin
- [x] F14. Terms and privacy pages

---

## G. 100-Feature Expansion

### G-Student (دانش‌آموز)
- [x] G1.  **کارنامه کامل** — subjects, per-subject average, GPA, class rank, year/term filter
- [x] G2.  **تاریخچه نمرات** — all grades (تایید/رد/در انتظار) with year filter
- [x] G3.  **وضعیت تایید نمره** — per-grade badge: ✓ تایید | ⏳ در انتظار | ✗ رد شده + rejectReason
- [x] G4.  **اعتراض به نمره (eteraz)** — student submit, school inbox, resolve, policy toggle
- [x] G5.  **میانگین کل و هر درس** — GPA from approved grades, color-coded per-subject
- [x] G6.  **رتبه در کلاس** — rank from classmates' averages; shown on karname
- [x] G7.  **نمودار پیشرفت نمرات** — line chart per subject across terms; added to Student/Grades; also exists in Teacher/StudentScores (TrendAreaChart + BarsChart)
- [x] G8.  **تاریخچه غیبت ماهانه** — `/student/attendance`; monthly accordion with present/absent/late/excused summaries and full log
- [x] G9.  **درخواست تبدیل غیبت به موجه** — student requests a real absence be changed to excused; principal/school reviews, approves/rejects, and attendance record updates
- [x] G10. **وضعیت تکالیف من** — per-homework: submitted ✓ / late ⚠ / missing ✗; card turns red tint when overdue + not submitted; due date shown; submit button inline
- [x] G11. **برنامه آینده تکالیف و امتحانات** — `/student/upcoming`; homework due dates + exam start times merged, grouped by day, color-coded
- [x] G12. **نتایج امتحانات آنلاین** — after submit, student sees MCQ score, own answer vs correct answer; descriptive/file answers wait for teacher scoring
- [x] G13. **تاریخچه امتحانات دانش‌آموز** — student sees saved exam date, subject, classroom, status, submittedAt, score/result; result link opens saved score/answers after submit while teacher-only correction stays separate
- [x] G14. **دانلود کارنامه PDF** — student self-service server-side PDF plus existing school admin PDF
- [x] G15. **کارت دانش‌آموزی PDF** — printable student ID card PDF from student list
- [x] G16. **اعلان‌های خوانده‌نشده** — done via G81 (NotificationBell)
- [x] G17. **پروفایل تحصیلی** — enrollment year, grade level, class name, national code
- [x] G18. **لیست معلمان من** — list of my teachers per subject; link to message
- [x] G19. **نتایج رأی‌گیری** — after voting closes, student sees chart of final results

### G-Teacher (معلم)
- [x] G21. **ورود نمره گروهی** — `BulkGradeEntry.tsx`; classroom+subject filter, per-student inputs, one submit
- [x] G22. **برگه نمرات کلاس** — `/teacher/grade-sheet`; all students × all subjects grid; current approved scores; class avg row; Excel export (list + sheet modes); color-coded by percentage
- [x] G23. **وضعیت تایید نمرات من** — GradeTable now shows approve/reject badge + reject_reason inline under status badge
- [x] G24. **ثبت نظر روی نمره** — description field already in form + DB; now surfaced in grade list and student detail view
- [x] G25. **لیست دانش‌آموزان کلاس** — `/teacher/students`; class dropdown; table: name, code, mobile, username, absence count (color-coded), avg grade; links to student scores
- [x] G26. **گزارش حضور کلاس + اکشن سنتر دانش‌آموز** — `/teacher/students/{id}/detail`; per-student absence stats, attendance log table, grades, quick actions: grade/homework/exam/message/files; contact/profile info; printable
- [x] G27. **اعلام تکلیف با مهلت** — done (HomeworkController@store now notifies all class students)
- [x] G28. **وضعیت تحویل تکالیف** — `/teacher/homeworks/{id}/submissions`; per-student: submitted ✓ / late ⚠ / missing ✗ / pending; stat cards (submitted count, missing count, late count, total); "مشاهده ارسال‌ها" button on homework list row
- [x] G29. **آمار نمرات کلاس** — `/teacher/class-stats`; per-subject avg/min/max/passRate with progress bars; overall stat cards; classroom dropdown
- [x] G30. **پیام به کل کلاس** — compose supports replacing recipients with a whole class or adding class students to current selection
- [x] G31. **گزارش دانش‌آموز** — teacher student detail tabs: overview, grades, attendance log, files, profile/contact info, print button/CSS
- [x] G32. **دانش‌آموزان در خطر** — done via G60 (also accessible via school admin)
- [x] G33. **تقویم معلم** — teacher sees sent homeworks, class exam dates/correction links, and personal todo/calendar notes; teacher can set private reminders or class exam dates
- [x] G34. **برنامه امروز + کلاس بعدی** — both student and teacher dashboards now show today's schedule list + "next upcoming class" banner (subject/time/day, highlighted if today)
- [x] G35. **درخواست بازبینی نمره رد شده** — teacher submits note for reconsideration from rejected grade row
- [x] G36. **آمار شخصی معلم** — 4 stat cards on `/teacher` dashboard: total students, active classes, pending grade approvals (shows "همه تایید شده‌اند" when 0), open homeworks (friendly text when 0)
- [x] G37. **خروجی Excel نمرات** — `/teacher/grades/export`; two modes: list (flat) + sheet (grid); colored headers (green), alternating rows, RTL; maatwebsite/excel; accessible from ClassGradeSheet page
- [x] G38. **فیلتر نمرات بر اساس کلاس** — filter grade sheet by classroom and term
- [x] G39. **تاریخچه و تصحیح امتحانات معلم** — teacher sees exams they created, per-student submissions, answers/files, reviews answers, compares MCQ answers, applies manual score/barom for descriptive/file questions
- [x] G40. **اعلان ورود دانش‌آموز به کلاس آنلاین** — online class sync shows total joined students plus recent join notices for teachers

### G-SchoolAdmin (مدیر مدرسه / معاون / owner)
- [x] G41. **تایید گروهی نمرات** — select-all checkboxes + bulk approve/reject bar + audit logs
- [x] G42. **تنظیم سیاست eteraz** — toggle per school; 12 checkboxes (grades 1-12); JSON in school_settings
- [x] G43. **اعمال نرم سال تحصیلی** — active school year preselected/applied on grade entry; student/report-card/analytics filters use school year; no hard locking
- [x] G44. **داشبورد آماری مدرسه** — `Analytics.tsx`; Recharts bar charts: avg grade/class, per-subject averages, 30-day absence rate; KPI cards; school year filter
- [x] G45. **چاپ گروهی کارنامه** — class PDF report cards with one-student-per-page or stacked mode, individual PDF, per-student stats
- [x] G46. **تنظیم حداکثر نمره** — set max score per subject (default 20; supports 100-point)
- [x] G47. **تنظیم حد قبولی** — passing threshold per subject
- [x] G48. **ارسال پیام به پایه یا کلاس** — classroom bulk picker in messages compose tab; selects classroom → auto-fills all student user_ids; existing MessageController@store handles send
- [x] G49. **صندوق اعتراضات نمره** — pending/resolved tabs, inline resolve form, PATCH /school/eteraz/{id}/resolve
- [x] G50. **لاگ تغییر نمره** — `GradeLogs.tsx`; `grade_change_logs` with student/subject/old→new/changer/IP/time; restricted to owner/principal/moaven
- [x] G51. **انتقال دانش‌آموز بین کلاس‌ها** — old class_students row marked transferred, new active row inserted, transfer log, explicit grade+attendance history deletion single/bulk
- [x] G52. **گزارش تکالیف مدرسه** — per-class homework detail and light statistics: created, submitted, late, missing, avg submission rate, drill down into class
- [x] G53. **گزارش‌های مدرسه با بازه دلخواه** — `/school/reports`; grade summary, attendance summary, exam activity, SMS usage for principal/owner, activity chart, CSV exports
- [x] G54. **ثبت انضباطی دانش‌آموز** — log discipline incidents per student
- [x] G55. **آرشیو سال‌های قبل** — read-only archived year view with grades and attendance summaries
- [x] G56. **تنظیم وزن نمرات** — school config for quiz/midterm/final weights; teacher tags grade type; student report-card averages use weighted calculation
- [x] G57. **تنظیم اعلان SMS غیبت** — configure mode, recipients, and low-balance threshold
- [x] G60. **گزارش دانش‌آموزان ضعیف** — `/school/students/at-risk`; students with avg grade < 50% of max in ≥1 approved subject; expandable rows showing failing subjects + avg; classroom filter; sorted by failing count; link to student scores

### G-SuperAdmin
- [x] G61. **آمار کل سامانه** — super admin dashboard already has: activeSchools, inactiveSchools, totalStudents, totalTeachers, totalUsers, smsUsedThisMonth, expiringLicenses, recentLogins, charts (6-month SMS + school trends, donut). Complete.
- [x] G62. **آخرین ورود / آخرین آنلاین / نشست‌ها** — login logs, `last_login_at`, heartbeat-backed `last_seen_at`, profile session list with sign-out-other-devices; live who-is-online intentionally removed
- [x] G63. **تنظیم سیاست eteraz سراسری** — global default via system settings, overridable per school
- [x] G64. **اعلان‌های سراسری/مدرسه‌ای چندتایی** — configurable announcement cards for students/teachers/principals, custom color, rich text/links, pulse animation, expires_at, dismiss single/all
- [x] G65. **گزارش کامل SMS و شارژ مدارس** — per-school SMS usage, sends, recipients, cost, wallet balance, charge requests/payments, date range and filters
- [x] G66. **لاگ ورود کاربران** — `/super-admin/login-logs`; paginated table; search by username; filter by status/school; delete logs older than X days button. PLUS `/super-admin/db-optimizer`: table sizes, fragmentation, per-table OPTIMIZE, old-record cleanup for login_logs/notifications/audit_logs/sms_wallet_transactions
- [x] G67. **مشخصات نسخه + پایش سیستم** — `/super-admin/status`; version + deploy time, PHP/Laravel/Node, Redis ping+latency, DB ping+latency, queue pending+failed, disk usage bar, school/user/student counts, 7-day login stats, recent failed jobs
- [x] G68. **ابزار SQL امن** — read-only SELECT queries from admin panel with write-operation guard and LIMIT
- [x] G69. **مدیریت پایه‌های تحصیلی** — add/edit/deactivate grade levels
- [x] G70. **مدیریت لایسنس** — set/extend/downgrade license status and limits per school
- [x] G71. **گزارش مدارس غیرفعال** — super admin selects inactivity window (e.g. 10/30/60 days), sees schools with no login/heartbeat/interaction, sortable by duration/name/last interaction
- [x] G72. **حذف / آرشیو مدرسه** — archive/unarchive school; data preserved and users disabled while archived
- [x] G73. **اعلان به مدیر مدرسه** — send message/alert to specific school's owner
- [x] G74. **مدیریت قالب SMS سراسری** — global SMS templates schools can override
- [x] G75. **داشبورد درآمد** — license/payment/SMS charge KPIs, monthly SMS charge chart, per-school table
- [x] G76. **صف پشتیبانی** — schools submit support tickets; super admin inbox reviews/answers/closes
- [x] G78. **تنظیم ماژول‌های پیش‌فرض** — which modules auto-enable when new school is created
- [x] G79. **بک‌آپ دستی DB** — merged with F9; `BackupController@download`; super_admin only; mysqldump + storage/app zip
- [x] G80. **کنترل ماژول گروهی** — enable/disable a module across ALL schools at once

### G-System / Cross-cutting
- [x] G81. **سیستم اعلان داخلی** — `NotificationBell.tsx` in Topbar; polls every 30s; panel shows last 30 notifications; mark single/all read. `IosInstallPrompt.tsx` on both login page AND inside AppLayout (authenticated) — detects iOS Safari, shows once per session, Share→Add to Home Screen steps in Farsi.
- [x] G82. **جستجوی سراسری** — `GlobalSearch.tsx` in Topbar (Ctrl+K); role-based results; click navigates
- [x] G83. **صفحات خطا سفارشی** — 404/403/500 Blade pages; dark, gradient orbs, Vazirmatn, RTL, action buttons
- [x] G84. **بازیابی رمز با موبایل** — deleted email reset; now: checks users.mobile → students.mobile → mother_mobile → father_mobile → if none: "با مدیر مدرسه تماس بگیرید"; SMS OTP sent to found number
- [x] G85. **خبر/اعلان تصویری و قالب‌دار** — news supports image upload, inline display, live preview/demo, template cards (اطلاعیه/هشدار/خبر in green/yellow/red), and a simple canvas/container editor field for typed layout metadata shown on dashboard cards
- [x] G86. **تقویم شمسی تعاملی** — all React date inputs converted to JalaliDatePicker/JalaliDateTimePicker
- [x] G87. **انیمیشن زنگ اعلان** — all notifications are always delivered; topbar bell rings/moves when new unread notification exists, ignored/read notifications remain accessible in full notification list
- [x] G88. **تاریخچه ورود در پروفایل** — profile shows last login time + device used; sessions show last online/activity and can sign out other devices.
- [x] G89. **احراز هویت دو مرحله‌ای (2FA)** — optional SMS OTP for school admin logins, enabled from school settings
- [x] G90. **مدیریت فایل پیشرفته** — file manager with folders, drag-drop upload area, thumbnail preview, and move-to-folder action
- [x] G91. **API عمومی با توکن** — school API token UI plus `/api/public/grades` and `/api/public/attendance` bearer-token endpoints
- [x] G92. **ساعت حضور دانش‌آموز** — `/student/attendance-hours`; present/absent/excused hours per term plus online hours
- [x] G94. **نمودار ارزیابی مدرسه** — analytics radar chart with 6 performance dimensions
- [x] G95. **سیستم باشگاه / فوق برنامه** — school club management with coach, schedule, and student membership
- [x] G96. **افزودن جایزه / تقدیرنامه** — school awards page plus award badges shown on student profile
- [x] G97. **مدیریت جانشین معلم** — substitute teacher assignments by teacher/class/subject/time
- [x] G98. **بانک سوال** — teacher question bank with subject, difficulty, tags, options, and score
- [x] G99. **کش هوشمند میانگین‌ها** — cached class grade averages/rankings with invalidation on grade create/update/approve/reject
- [x] G100. **QR ورود + دانلود + لینک + تجدید** — QR login, PNG download, copy share link, force-refresh token

---

### Release History
| Release | Date | Key Changes |
|---------|------|-------------|
| 20260713-235959 | 2026-07-13 | Completed final 8 open tasks: B9 CDN config hooks, C2 eNAMAD embed settings, C3 Samandehi embed settings, C4 achievements/medals settings, F13 demo sandbox with reset, G86 Jalali date widgets everywhere, G89 optional admin SMS 2FA, G99 cached grade rankings |
| 20260713-235900 | 2026-07-13 | Completed 10 more coding tasks: F10 health endpoint/alerts, G40 online class join counter/notices, G90 advanced file manager, G91 public API tokens, G92 student attendance hours, G94 school radar evaluation, G95 clubs, G96 awards/badges, G97 substitute teachers, G98 question bank |
| 20260713-235500 | 2026-07-13 | Completed 10 more coding tasks: E15 hand queue/invite, E16 exam-question poll presets, E19 late-join indicators, E20 reactions, F8 school-branded login, G30 full class messaging, G35 rejected-grade reconsideration request, G55 archived-year read-only view, G57 absence SMS settings, G75 revenue dashboard |
| 20260713-234500 | 2026-07-13 | Completed 10 more coding tasks: G14 student report-card PDF, G15 student ID card PDF, G56 grade weights, G63 global eteraz policy, G68 safe SQL viewer, G69 grade-level management, G70 license controls, G72 school archive, G74 global SMS templates, G76 support tickets |
| 20260713-231500 | 2026-07-13 | Completed next 10 coding tasks: G17 academic profile, G18 student teacher list, G19 student voting results, G38 class/term grade-sheet filter, G46/G47 subject max+passing scores, G54 discipline incidents, G73 owner alerts, G78 default modules, G80 bulk module control |
| 20260713-223000 | 2026-07-13 | Completed product prompt batch: G9 absence excuse requests, G13 student exam history/result links, G39 teacher exam correction, G33 teacher calendar/todos, G52 homework reports, G85 image/template news, G87 ringing notification bell, G65 SMS/payment details, G71 inactive schools report |
| 20260713-215035 | 2026-07-13 | Roadmap cleanup from product decisions: removed comparison tasks, removed notification preferences in favor of always-on notifications + ringing bell animation, clarified absence-excuse request, student exam history, teacher exam correction, teacher calendar/personal todos, homework reports, image/template news, SMS/charge details, inactive-school duration report |
| 20260713-213820 | 2026-07-13 | Completed user-requested 10-item pass: G62 last login/last online/session logout, G64 multi configurable announcements, G45 bulk karname PDF modes+stats, G51 transfer history + delete grade/attendance history, G8 monthly attendance, G12 exam result after submit, G31 printable teacher student report, G11 upcoming homework/exam list, G53 custom date-range reports + CSV exports, G43 soft school-year enforcement |
| 20260713-203238 | 2026-07-13 | G22 teacher class grade sheet grid, G23 reject reason shown in grade list, G24 teacher comment surfaced, G26 student action center for teacher, G29 class grade stats, G34 today+next class on both dashboards, G37 Excel export (colored, 2 modes), G7 grade progress chart in student grades, G67 super admin status page, G84 password reset mobile chain (student→mother→father) |
| 20260713-200218 | 2026-07-13 | F2 notification triggers (grade/message/homework), G25 teacher roster, G28 homework submissions, G10 student HW status badges, G36 teacher stat cards, G48 bulk message to class, G60 at-risk students, G66 login logs + DB optimizer, G88 profile last login device, iOS prompt on login page |
| 20260713-191845 | 2026-07-13 | G21 bulk grade entry, G41 bulk grade approval, G44 school analytics, G50 grade audit log, F9/G79 backup download, G81 notification bell + iOS PWA prompt, G82 global search, G83 custom error pages |

### Notes
- Server: single VPS, Apache + PHP 8.3 + remote MySQL at sql.24.svpj.link. Releases at `/var/www/daneshyar-releases`, deploy = `python scripts/build.py` → `python scripts/update.py`.
- No external SaaS for class system (user req) — Jitsi self-hosted only.
- SMS API keys env-only (`SMS_SMSIR_API_KEY`, `SMS_FARAZ_API_KEY`); DB stores only non-sensitive provider settings.
- `notifications` table now actively written to — bell shows real counts.
- `login_logs` paginated at `/super-admin/login-logs`; can purge old records from UI.
