# Knowledge Base — INDEX

> The map of every topic. Read [`README.md`](README.md) first (how the KB works). كل موضوع وسطر وصف ولينك.
> ✅ = ملف مكتوب · 🟡 = موجود جزئيًا/يحتاج تكميل · ⬜ = مخطّط (نكتبه أول ما نشتغل عليه)

## 🏭 Production & Manufacturing
- ✅ [Production module](topics/production.md) — manufacturing dashboard + per-work-center load board + collapsible factory nav; cost-accounting megaproject context; **Make-to-Order customer-flow analysis** ([plan](plans/mfg-mto-flow-plan.html)) — module ~90% built, net-new = intake entity + new-product→Development + 3 accounting approval gates.

## 🔬 LIS (Laboratory)
- ✅ [Analyzer middleware](topics/middleware.md) — on-prem Python middleware (Maglumi/VITROS/Dymind/Udichem), source-of-truth/deploy loop, drivers, ASTM/HL7, SSH access, VITROS onboarding.
- ✅ [Client PC access — reverse SSH tunnel](topics/client-pc-tunnel.md) — **read when the tunnel drops.** How we reach the analyzer's Windows box (`ssh -4 -p 2222 hp@127.0.0.1`, reverse tunnel the client dials out), why it drops, and the fix (free port 2222 on our server: `kill -9` the zombie sshd → user re-runs the tunnel). scp/PowerShell/python toolkit + paths.
- ✅ [Sample generation & the barcode gate](topics/lis-sample-generation.md) — **🔴 sample tubes are NOT created by the BE at request creation**; the FE generates them in a separate fire-and-forget step (`onOrderSuccess` → `POST /lis/samples auto_split` → `aliquot`) after save → if it doesn't complete the request stays `pending` with 0 samples and barcode print warns "No collected samples". [Investigation report](plans/lab-barcode-no-samples-investigation.html). Fix = move generation to the BE (transactional).
- ⬜ LIS flow & rebuild — worklist-centric flow, kanban/validation, external labs, the rebuild plan. (content currently in MEMORY.md `lis-*` notes → consolidate here)
- ⬜ Lab accounting & invoicing — LIS GL settings, VAT, customer invoice printing, payments/cashier.

## 🚀 Distribution & Updates (MoonStack)
- ✅ [Dev & release branch workflow](topics/dev-workflow.md) — **read before cutting a release.** Branches (`hazemdev` work branch → `main` release source), the release page + CLI, **prerequisites + ALL env vars + gotchas so ANY dev env/user can release correctly.**
- ✅ [Parallel development (2nd Claude / fatamadev)](topics/parallel-dev.md) — running a second Claude instance in parallel on its own branch (`fatamadev`), each on a different module, merging to `main`. **Must be separate per instance: DB + URL/deploy + working dir** (🔴 never let the 2nd touch `moonui_dev_be` — not binlogged). Partition by module. [Visual guide](https://moonui.elbaset.com/parallel-claude-fatamadev.html).
- ✅ [MoonStack update & changelog](topics/moonstack-update.md) — fast/crash-safe self-host updates, the what's-new/changelog process, the **seeder gap** (updates don't seed new definitions), release flow, per-client gotchas, **🔴 docroot-ready packaging fix** ([plan](plans/moonstack-docroot-ready-plan.html)) — the zip extracts as raw Laravel (public/ subfolder → fresh-install 404 + insecure); fix = inject a root `.htaccess` rewrite→`public/`.
- ⬜ Self-hosted distribution plan — the separate WordPress-style installer direction (do NOT touch Ahmed's Moon Central). (in MEMORY.md `self-hosted-distribution-plan`)

## 🎤 Sales & Presentations
- ✅ [Sales presentation & deck visuals](topics/presentation.md) — the EN/AR lab decks (web root, 19 slides, design system), real-screenshot capture recipe, **AI image-gen playbook** (Gemini "Nano Banana" / OpenAI / WaveSpeed) + **🔐 secure key handling (keys never in repo/chat)**.

## 🧩 Core / Platform
- ✅ [Default Accounts — master inventory & /setup plan](topics/default-accounts/INDEX.md) — **every GL-default-account setting across ALL modules** (de-duped ~52 keys), the 28 missing from the first-run `/setup` page (Lab 10 / Manufacturing 8 / HR 10), the **setup page writes 7 INERT legacy keys nothing reads**, the setting-definition schema, and the extension plan. Per-area topics in [`topics/default-accounts/`](topics/default-accounts/). ⚠️ AR-header trap.
- ⬜ API conventions — auth (`X-Authorization`), pagination (25 cap / `listAll`), dates/money/soft-deletes, envelope.
- ⬜ Deploy & environments — build/deploy to moonui `/app`, the dev-vs-prod BE targets, `.htaccess`, suexec/chown.

---

### How to extend this index
Add your topic under the right section as `- ✅ [Title](topics/<slug>.md) — hook`. Keep it to one line. See [`README.md`](README.md) §3–4.
