Docs brought to the current state: CLAUDE.md rewritten, README formal, handbook and diagrams redrawn

- CLAUDE.md: 1,225 → ~430 lines, current state only (the dated status log stays in git history).
  Server rules moved to the top: what is ours on 249/247 and what is not, non-negotiable rules,
  announce-before-acting, password handling, and the full "deploy it" procedure with verification.
- README: formal entry page with current numbers (10 grades, 18,522 questions, 61 API operations,
  973 tests, PostgreSQL/Redis).
- Removed docs/frontend/ (Figma-era guide with guest login and its own api.ts; the frontend repo has
  the real client). Swagger's external-docs link now points at the frontend repo.
- architecture/operations/security/content-authoring/loadtest/textbooks: SQLite, guest login,
  demo accounts, question packs and the port-80 note replaced by what is true now.
- Technical handbook text updated throughout; all seven diagrams redrawn (PostgreSQL, phone-only
  login, subscriptions, current data model); PDF rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 18:45:51 +03:30
parent eb95209ea8
commit a4e0c576bb
20 changed files with 752 additions and 2134 deletions

View File

@@ -5,7 +5,7 @@ JSON است با زمانِ هر پرسش و هر درخواستِ صفحه‌ی
| فایل | کار |
|---|---|
| `mkusers.py` | کاربرانِ آزمایشیِ غیرمهمان (شماره‌ی جعلیِ `0900…`، بی‌پیامک، بی‌سیگنال) با توکن و سه سوالِ متفاوت از بانکِ سوال برای هر کدام |
| `mkusers.py` | کاربرانِ آزمایشی (شماره‌ی جعلیِ `0900…`، بی‌پیامک، بی‌سیگنال) با توکن و سه سوالِ متفاوت از بانکِ سوال برای هر کدام |
| `loadtest.py` | N نفر هم‌زمان می‌پرسند (استریم، دقیقاً مثلِ فرانت) و B نفرِ دیگر در خانه/آزمون/خلاصه/سهمیه می‌چرخند |
| `fake_upstream.py` | جایگزینِ GapGPT و Qdrant برای آزمایشگاه: embedding، جوابِ استریم با زمانِ لاگ‌نرمال (پیش‌فرض: میانه‌ی ۵٫۲ و صدکِ ۹۰ِ ۱۳ ثانیه، از جواب‌های واقعیِ سرور) و جست‌وجوی Qdrant |
@@ -37,8 +37,10 @@ python tools/loadtest/loadtest.py http://127.0.0.1:8800 users.json 50 10 0 out.j
یعنی کارِ سرورِ ما و صفِ انتظار برای نخِ آزاد. ۵. `manage.py delete_users --ids … --yes` و پاک کردنِ
فایلِ توکن‌ها.
سقفِ ساعتیِ دستیار برای مهمان‌ها بر اساسِ IP است؛ با کاربرِ مهمان از یک ماشین بیش از ~۲۰ پرسش در
ساعت ممکن نیست، برای همین `mkusers.py` کاربرِ غیرمهمان می‌سازد.
**روی سرورِ مشترک، throttleهای پروداکشن دست نمی‌خورند.** اگر سقفِ نرخ مانع است، یک gunicornِ موقت روی سوکتِ جدا در
`~/mathapp-v2/.lt/` با `READ_THROTTLE_RATE` بالا و `DB_POOL_MAX_SIZE=4 --workers 2` بالا بیاورید (تا با ۳۲ اتصالِ
پروداکشن از ۵۷ نگذرد)، کوتاه اجرا کنید و آخرش `.lt` را پاک کنید. در اسکریپت روی آن gunicornِ پس‌زمینه `wait` نزنید:
تا ابد منتظر می‌ماند.
## بازیکن‌ها (نه دستیار): `mkplayers.py`، `play.py`، `agg.py`