- docs/00-15: دراسة، بنية، محرك تعرفة، تسعير، نموذج استئجار، تكاملات، بيانات، realtime، خطة، devops، لاندنج، مخاطر، اصطلاحات سيرفر، تدفق نشر - backend/: NestJS 11 على Docker (health + tenants + عزل tenant_id + بادئة tripz_ + Redis DB 3) - apps/rider, apps/driver, dashboards/admin-web, dashboards/superadmin-web (هياكل) - sync-to-server.sh + .gitignore Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
102 lines
5.6 KiB
Markdown
102 lines
5.6 KiB
Markdown
# 🌳 شجرة المستودع الكاملة (المرجع البنائي)
|
|
|
|
> هذا هو الشكل المستهدف للمونوريبو بعد P0. ابنِ نحوه تدريجياً. الرموز: ★ = آلة حالة Bloc كاملة، 🌐 = عالمي بلا tenant_id.
|
|
|
|
```
|
|
Tripz/
|
|
├── README.md
|
|
├── docs/ # ← أنت هنا (الخطط)
|
|
│
|
|
├── backend/ # NestJS — [02] [08] [09]
|
|
│ ├── src/
|
|
│ │ ├── main.ts
|
|
│ │ ├── app.module.ts
|
|
│ │ ├── common/
|
|
│ │ │ ├── tenant/ # TenantGuard, scoped repo, @Tenant() [06]
|
|
│ │ │ ├── usage/ # UsageInterceptor (من انطلق) [05]
|
|
│ │ │ ├── guards/ interceptors/ filters/ pipes/ decorators/
|
|
│ │ ├── config/ # ConfigModule + country-packs loader [06]
|
|
│ │ ├── modules/
|
|
│ │ │ ├── auth/ tenants/ users/ drivers/
|
|
│ │ │ ├── trips/ # ★ آلة حالة الرحلة (مصدر الحقيقة) [02]
|
|
│ │ │ ├── matching/ # Redis GEO [09]
|
|
│ │ │ ├── tariff/ # محرك التعرفة [04]
|
|
│ │ │ ├── dispatch/ maps/ payments/ billing/
|
|
│ │ │ ├── pricing-zones/ notifications/ regulator/ webhooks/ admin/
|
|
│ │ ├── realtime/ # Socket.IO Gateway + redis adapter [09]
|
|
│ │ ├── jobs/ # BullMQ processors [09]
|
|
│ │ ├── database/
|
|
│ │ │ ├── entities/ # [08]
|
|
│ │ │ ├── migrations/
|
|
│ │ │ └── seeds/ # مستأجر تجريبي للديمو [12]
|
|
│ │ └── integrations/ # [07]
|
|
│ │ ├── payments/ sms/ regulator/ registry.ts
|
|
│ ├── test/ # e2e + اختبار عزل المستأجر [11]
|
|
│ ├── docker-compose.yml # postgres/postgis, redis, martin, api, worker
|
|
│ ├── Dockerfile
|
|
│ └── package.json
|
|
│
|
|
├── mobile/ # Flutter — [03]
|
|
│ ├── packages/
|
|
│ │ └── tripz_core/ # مشترك
|
|
│ │ └── lib/
|
|
│ │ ├── models/ network/ maps/ tariff/ theme/ l10n/ config/
|
|
│ ├── apps/
|
|
│ │ ├── rider/
|
|
│ │ │ └── lib/
|
|
│ │ │ ├── main_<flavor>.dart app.dart
|
|
│ │ │ ├── core/ # DI (get_it), router (go_router), dio
|
|
│ │ │ ├── data/ domain/
|
|
│ │ │ └── features/
|
|
│ │ │ ├── auth/ home/
|
|
│ │ │ ├── trip/ # ★ TripBloc + شاشات دورة الرحلة [03]
|
|
│ │ │ ├── chat/ rating/ profile/ settings/ wallet/(P3)
|
|
│ │ └── driver/
|
|
│ │ └── lib/
|
|
│ │ └── features/
|
|
│ │ ├── auth/ registration/
|
|
│ │ ├── offers/ # ★ OffersBloc [03]
|
|
│ │ ├── active-trip/ earnings/ profile/
|
|
│ ├── flavors/<tenant>/ # config.json + assets/ + store/ [11]
|
|
│ ├── fastlane/ # Fastfile (build/deploy lanes) [11]
|
|
│ └── melos.yaml # إدارة المونوريبو (اختياري)
|
|
│
|
|
├── admin-web/ # لوحة My Hub (Web) — [02] admin module
|
|
│ └── src/ # React/Next أو Flutter Web
|
|
│
|
|
├── landing/ # اللاندنج + الحاسبة + صفحة التسعير — [12]
|
|
│ └── src/ # Next.js/Astro (منفصل عن المنصة)
|
|
│
|
|
├── country-packs/ # حزم الدول — [06]
|
|
│ ├── jo.yaml sy.yaml
|
|
│ └── legal/{jo,sy}/{terms,privacy}.md
|
|
│
|
|
├── infra/ # [11]
|
|
│ ├── docker/ k8s/(للسيادة) terraform/(اختياري)
|
|
│ └── github-actions/ # خطوط CI
|
|
│
|
|
└── contracts/ # عقود SaaS مضادة لـ Onde (ar/en) — [10]
|
|
```
|
|
|
|
## خريطة «ملف الخطة ← مجلد الكود»
|
|
| الخطة | يتحقق في |
|
|
|-------|----------|
|
|
| [02 backend](02-backend-plan.md) | `backend/src/modules`, `common` |
|
|
| [03 mobile](03-mobile-plan.md) | `mobile/apps`, `packages/tripz_core` |
|
|
| [04 tariff](04-tariff-engine.md) | `backend/src/modules/tariff` |
|
|
| [05 billing](05-pricing-billing.md) | `backend/src/modules/billing`, `common/usage` |
|
|
| [06 tenant](06-tenant-model.md) | `backend/src/common/tenant`, `country-packs` |
|
|
| [07 integrations](07-integrations.md) | `backend/src/integrations` |
|
|
| [08 data](08-data-model.md) | `backend/src/database` |
|
|
| [09 realtime](09-realtime.md) | `backend/src/realtime`, `matching`, `jobs` |
|
|
| [11 devops](11-devops-cicd.md) | `infra`, `mobile/fastlane`, `flavors` |
|
|
| [12 landing](12-landing-gtm.md) | `landing`, `admin-web` |
|
|
|
|
## ترتيب البناء المقترح (يتبع [10-roadmap](10-roadmap.md))
|
|
1. **P0:** `backend` (nest new + tenant/usage) → `mobile` (core + rider/driver skeleton) → `infra/CI` → flavor تجريبي ثانٍ.
|
|
2. **P1:** `trips` + `matching` + `tariff` + `realtime` + شاشات الرحلة + `admin-web` أساسي.
|
|
3. **P2:** `dispatch` + `pricing-zones` + `billing` + `regulator` + `landing` + الحاسبة.
|
|
4. **P3:** التوصيل + حجز الويب + BI + country packs جديدة.
|
|
|
|
← العودة إلى [README](../README.md)
|