Jelajahi Sumber

[#1] Fix PDF invisible text layer, Acrobat Reader save on close warning, custom headers and footers, and database partitioning Mermaid chart

Lange François 2 minggu lalu
induk
melakukan
c5d48eba87
41 mengubah file dengan 225 tambahan dan 66 penghapusan
  1. TEMPAT SAMPAH
      Project.pdf
  2. TEMPAT SAMPAH
      Retro Planning.pdf
  3. TEMPAT SAMPAH
      delivery.zip
  4. TEMPAT SAMPAH
      docs/Backup_Procedure.pdf
  5. TEMPAT SAMPAH
      docs/Data_Ingestion.pdf
  6. TEMPAT SAMPAH
      docs/Final_Report.pdf
  7. 27 15
      docs/Installation_Guide.md
  8. TEMPAT SAMPAH
      docs/Installation_Guide.pdf
  9. TEMPAT SAMPAH
      docs/Operator_Installation_Guide.pdf
  10. 22 0
      docs/Recommendations.md
  11. TEMPAT SAMPAH
      docs/Recommendations.pdf
  12. TEMPAT SAMPAH
      docs/Scrum_Artifacts.pdf
  13. TEMPAT SAMPAH
      docs/Scrum_Daily.pdf
  14. TEMPAT SAMPAH
      docs/Scrum_Plan.pdf
  15. TEMPAT SAMPAH
      docs/Scrum_Retro.pdf
  16. TEMPAT SAMPAH
      docs/Scrum_Review.pdf
  17. 10 7
      docs/Scrum_Wiki.md
  18. TEMPAT SAMPAH
      docs/Scrum_Wiki.pdf
  19. TEMPAT SAMPAH
      docs/Start_Stop_Procedures.pdf
  20. TEMPAT SAMPAH
      docs/Technical_Document.pdf
  21. TEMPAT SAMPAH
      docs/Test_Cases_Sprint8.pdf
  22. TEMPAT SAMPAH
      docs/URL_Formats.pdf
  23. TEMPAT SAMPAH
      docs/Uninstall_Guide.pdf
  24. TEMPAT SAMPAH
      docs/User_Description.pdf
  25. TEMPAT SAMPAH
      docs/User_Guide.pdf
  26. TEMPAT SAMPAH
      docs/WSL_Deployment.pdf
  27. 9 1
      docs/Wiki_Home.md
  28. TEMPAT SAMPAH
      docs/Wiki_Home.pdf
  29. TEMPAT SAMPAH
      docs/am.png
  30. 11 13
      docs/architecture.md
  31. TEMPAT SAMPAH
      docs/architecture.pdf
  32. TEMPAT SAMPAH
      docs/disaster_recovery_plan.pdf
  33. TEMPAT SAMPAH
      docs/distributed_deployment.pdf
  34. TEMPAT SAMPAH
      docs/docker_connection.pdf
  35. 2 2
      docs/project_report.md
  36. TEMPAT SAMPAH
      docs/project_report.pdf
  37. TEMPAT SAMPAH
      docs/retro_planning.pdf
  38. TEMPAT SAMPAH
      docs/taiga_audit_report.pdf
  39. TEMPAT SAMPAH
      docs/zabbix_monitoring.pdf
  40. 53 23
      generate_docs.py
  41. 91 5
      scripts/generate_pdfs.py

TEMPAT SAMPAH
Project.pdf


TEMPAT SAMPAH
Retro Planning.pdf


TEMPAT SAMPAH
delivery.zip


TEMPAT SAMPAH
docs/Backup_Procedure.pdf


TEMPAT SAMPAH
docs/Data_Ingestion.pdf


TEMPAT SAMPAH
docs/Final_Report.pdf


+ 27 - 15
docs/Installation_Guide.md

@@ -41,10 +41,10 @@ sudo apt remove -y docker.io docker-compose docker-compose-v2 docker-doc podman-
 ```bash
 sudo apt update
 sudo apt install -y ca-certificates curl
-sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
-echo "deb [arch=\$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg   -o /etc/apt/keyrings/docker.asc
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
 sudo apt-get update
-sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+sudo apt-get install -y docker-ce docker-ce-cli containerd.io   docker-buildx-plugin docker-compose-plugin
 ```
 
 ### Step 2.3: Start and Enable Docker Daemon
@@ -61,9 +61,21 @@ sudo usermod -aG docker $USER
 ```
 
 ### Step 2.5: Reboot the WSL Instance
-Execute the command below inside WSL to gracefully reboot the instance:
+To reboot the WSL instance, you must shutdown and restart WSL. You can choose one of the following methods:
+
+**Option A: Restart from Windows Host (Recommended & Safest)**
+1. Close your Ubuntu terminal.
+2. Open Windows PowerShell or Command Prompt.
+3. Run the shutdown command:
+   ```powershell
+   wsl --shutdown
+   ```
+4. Re-open your Ubuntu terminal.
+
+**Option B: Restart from inside WSL Terminal**
+If you prefer to trigger the reboot directly from the WSL terminal:
 ```bash
-cd /mnt/c/ && cmd.exe /c start "rebooting WSL" cmd /c "timeout 5 && wsl -d $WSL_DISTRO_NAME" && wsl.exe --terminate $WSL_DISTRO_NAME
+cd /mnt/c/ && cmd.exe /c start "rebooting WSL" cmd /c   "timeout 5 && wsl -d Ubuntu-22.04" &&   wsl.exe --terminate Ubuntu-22.04
 ```
 
 Upon reconnecting, verify Docker is running by starting the hello-world container:
@@ -85,20 +97,20 @@ sudo update-alternatives --config iptables
 ### Step 3.2: Configure DNS Settings
 To ensure reliable package downloads and LLM registry calls:
 ```bash
-echo "1,\$ s/^/#/
-\$ a
+echo '1,$ s/^/#/
+$ a
 nameserver 1.1.1.1
 .
 w
-q" | sudo ed /etc/resolv.conf
+q' | sudo ed /etc/resolv.conf
 
-echo "\$ a
+echo '$ a
 # Added these 2 lines:
 [network]
 generateResolvConf = false
 .
-W
-q" | sudo ed /etc/wsl.conf
+w
+q' | sudo ed /etc/wsl.conf
 ```
 
 ---
@@ -106,8 +118,8 @@ q" | sudo ed /etc/wsl.conf
 ## 4. Repository Clones & Branch Governance
 
 There are two repositories configured for this project:
-- Primary Git Repository: `https://git.btshub.lu/lanfr/LocalFoodAI_lanfr144.git`
-- Alternative Git Repository (Worldwide Access - Clone): `https://github.com/lanfr144/LocalFoodAI_lanfr144.git`
+- Primary Git Repository: https://git.btshub.lu/lanfr/LocalFoodAI_lanfr144.git
+- Alternative Git Repository (Worldwide Access - Clone): https://github.com/lanfr144/LocalFoodAI_lanfr144.git
 
 Clone the primary repository inside your home directory:
 ```bash
@@ -142,12 +154,12 @@ git remote set-head origin main
 
 Ensure the runbooks and sync scripts have executable permissions:
 ```bash
-chmod +x data_sync.sh backup_db.sh manage_services.sh scripts/manage_models.sh
+chmod +x data_sync.sh backup_db.sh manage_services.sh   scripts/manage_models.sh
 ```
 
 Follow the standard runbook to initialize credentials and launch services:
 ```bash
-# 1. Create a local [.env file](file:///C:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/.env) based on [step 3 guidelines](#3-network-configuration--performance-tuning)
+# 1. Create a local [.env file](file:///C:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/.env) based on step 3 guidelines
 # 2. Run the service manager to spin up containers
 ./manage_services.sh start
 ```

TEMPAT SAMPAH
docs/Installation_Guide.pdf


TEMPAT SAMPAH
docs/Operator_Installation_Guide.pdf


+ 22 - 0
docs/Recommendations.md

@@ -0,0 +1,22 @@
+The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:Recommendations.md:%an:%ae:%ad:%cn:%ce:%cd:%H:%D:%N$"
+
+
+# Recommendations for Future Agile Projects
+
+Based on the challenges and technical resolutions encountered during the engineering and deployment lifecycle of this project, the following guidelines are recommended to optimize future implementations:
+
+## 1. Version Control and Git Attributes Governance
+* **Define Binary Assets Early**: Ensure that `.gitattributes` is defined and committed at the project's inception. Specifically, explicitly declare non-textual formats (e.g., `*.pdf binary`, `*.ttf binary`, `*.zip binary`, `*.docx binary`) to prevent line-ending renormalization from corrupting binary compiles.
+* **Filter Script Ordering**: During cache resets or clean checkouts, isolate filters to prevent smudge/clean scripts from failing if dependency helpers are not yet available on disk.
+
+## 2. Document Generation & PDF Portability
+* **Prioritize Core Standard Fonts**: To prevent "Cannot extract embedded font" errors in external PDF viewers (such as Adobe Acrobat Reader), avoid custom font embeddings. Rely on built-in PDF standard fonts (such as `Helvetica` for sans-serif body text and `Courier` or `Courier New` for monospaced code blocks).
+* **Code Block Wrapping & Margin Safety**: Avoid extremely long lines in code blocks. Manually wrap long command lines with the bash backslash `\` to prevent visual page overflows and copy-paste gluing.
+* **Avoid Hard Page-Break Constraints**: Do not force `page-break-inside: avoid` on large block flowables. If a block's height exceeds the remaining page layout or the viewport boundary, the rendering engine may drop the block entirely or insert empty pages.
+* **Portal and Index Structure**: For static document ecosystems, use relative links (`.md` targets) to cross-reference guides. Ensure the compilation script translates them to `.pdf` targets dynamically, creating a fully linked portable PDF ecosystem.
+* **Auditable Page Layout Headers/Footers**: Use programmatic post-processing in PyMuPDF to draw clean page headers (logo image, document title, project code) and footers (author ID, Page X of Y) for institutional quality.
+
+## 3. Shell Scripting and Configuration Streamlining
+* **Dynamic Variable Formatting**: When presenting shell commands in documentation code blocks, avoid backslash-escaping environment variables (such as `$USER` or `$WSL_DISTRO_NAME`) as they render literally in the code block and break copy-paste execution.
+* **Separation of Interactive Streams**: For stream editors (like `ed`), keep all commands and markers on their own separate lines. Never join commands (like `.w`) on a single line. Use single quotes `'` for `echo` input streams to avoid escaping variables with backslashes.
+* **Home Directory Alignment**: Always prefix repository clone commands with `cd ~` to ensure that deployment environments remain aligned relative to user home folders.

TEMPAT SAMPAH
docs/Recommendations.pdf


TEMPAT SAMPAH
docs/Scrum_Artifacts.pdf


TEMPAT SAMPAH
docs/Scrum_Daily.pdf


TEMPAT SAMPAH
docs/Scrum_Plan.pdf


TEMPAT SAMPAH
docs/Scrum_Retro.pdf


TEMPAT SAMPAH
docs/Scrum_Review.pdf


+ 10 - 7
docs/Scrum_Wiki.md

@@ -9,31 +9,34 @@ Welcome to the static Scrum documentation portal. This master wiki aggregates an
 
 ## Sprint Ceremonies & Logs
 
-### 1. [Sprint Plans (Scrum_Plan.md)](Scrum_Plan.pdf)
+### 1. [Sprint Plans](Scrum_Plan.md)
 *Contains Sprint Plan formulations, active user stories selection, scope statements, and team capacity bounds for each milestone loop.*
 
-### 2. [Daily Scrums (Scrum_Daily.md)](Scrum_Daily.pdf)
+### 2. [Daily Scrums](Scrum_Daily.md)
 *Continuous daily stand-up summaries tracking individual task completion, blocker mitigations, and immediate day-to-day coordination.*
 
-### 3. [Sprint Reviews (Scrum_Review.md)](Scrum_Review.pdf)
+### 3. [Sprint Reviews](Scrum_Review.md)
 *Contains sprint review logs, clinician demonstration summaries, feature validation checklists, and stakeholder feedback logs.*
 
-### 4. [Sprint Retrospectives (Scrum_Retro.md)](Scrum_Retro.pdf)
+### 4. [Sprint Retrospectives](Scrum_Retro.md)
 *Reviews process improvements, continuous integration learnings, and action items aimed at optimizing team operations and environment tuning.*
 
 ---
 
 ## Deliverables & Quality Assurance
 
-### 5. [Scrum Artifacts (Scrum_Artifacts.md)](Scrum_Artifacts.pdf)
+### 5. [Scrum Artifacts](Scrum_Artifacts.md)
 *Indexes sprint velocity metrics, completed story points distributions, burndown coordinates, and final Taiga delivery milestones.*
 
-### 6. [Sprint 8 Test Cases (Test_Cases_Sprint8.md)](Test_Cases_Sprint8.pdf)
+### 6. [Sprint 8 Test Cases](Test_Cases_Sprint8.md)
 *Legacy acceptance test logs covering core NLP chat, portion converters, and initial search validations.*
 
-### 7. [Uninstallation Guide (Uninstall_Guide.md)](Uninstall_Guide.pdf)
+### 7. [Uninstallation Guide](Uninstall_Guide.md)
 *Provides structured procedures to completely remove and tear down all system components from Windows and Linux/WSL environments.*
 
+### 8. [Recommendations for Future Projects](Recommendations.md)
+*Reflections and guidelines derived from this project's challenges to optimize subsequent deployments, including font selection, git attributes management, and shell formatting.*
+
 ---
 
 > [!NOTE]

TEMPAT SAMPAH
docs/Scrum_Wiki.pdf


TEMPAT SAMPAH
docs/Start_Stop_Procedures.pdf


TEMPAT SAMPAH
docs/Technical_Document.pdf


TEMPAT SAMPAH
docs/Test_Cases_Sprint8.pdf


TEMPAT SAMPAH
docs/URL_Formats.pdf


TEMPAT SAMPAH
docs/Uninstall_Guide.pdf


TEMPAT SAMPAH
docs/User_Description.pdf


TEMPAT SAMPAH
docs/User_Guide.pdf


TEMPAT SAMPAH
docs/WSL_Deployment.pdf


+ 9 - 1
docs/Wiki_Home.md

@@ -2,4 +2,12 @@ The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:Wiki_Home.md:%an
 
 
 # Documentation Home
-Welcome to the static documentation mirror. Please navigate the markdown files in this directory for architectural diagrams and guides.
+
+Welcome to the static documentation portal. Please navigate the guides below:
+
+- **[Detailed Installation and Deployment Guide](Installation_Guide.md)**
+- **[Clinician User Manual](User_Guide.md)**
+- **[Technical Capstone Document](Technical_Document.md)**
+- **[Agile Scrum Wiki Portal](Scrum_Wiki.md)**
+- **[System Uninstallation Guide](Uninstall_Guide.md)**
+- **[Recommendations for Future Projects](Recommendations.md)**

TEMPAT SAMPAH
docs/Wiki_Home.pdf


TEMPAT SAMPAH
docs/am.png


+ 11 - 13
docs/architecture.md

@@ -54,18 +54,16 @@ graph TD
 
 To optimize massive dataset ingestion (~24GB OpenFoodFacts dataset) and completely bypass InnoDB row size limits while maintaining sub-second RAG response times, the database utilizes a vertically partitioned structure:
 
-```
-             +-------------------------+
-             |    Unified SQL View     |
-             |       "products"        |
-             +------------+------------+
-                          |
-       +------------------+------------------+
-       v                  v                  v
-+--------------+   +--------------+   +--------------+
-|products_core |   |  allergens   |   |    macros    |
-|(Base/FULLTEXT|   |(Ingredients) |   | (Precision)  |
-+--------------+   +--------------+   +--------------+
+```mermaid
+flowchart TD
+    View["Unified SQL View\n'products'"]
+    Core["products_core\n(Base/FULLTEXT)"]
+    Allergens["allergens\n(Ingredients)"]
+    Macros["macros\n(Precision)"]
+    
+    View --> Core
+    View --> Allergens
+    View --> Macros
 ```
 
 1. **`products_core`**: Contains product base information (barcode, name, brand, primary category) optimized with `FULLTEXT` indexing.
@@ -94,7 +92,7 @@ Services are distributed across specialized local hypervisors and Windows subsys
 When the remote VM host network or Taiga server is completely unreachable:
 - **Zero-Dependency Containers**: The entire platform runs entirely locally on the notebook host via **Docker Compose** (`docker-compose.yml`).
 - **Automatic IP Resolution**: Application configuration, Alembic, and SNMP notifications automatically adjust their endpoints to target local network interfaces (`localhost` / custom Docker networks) rather than unreachable remote IPs, avoiding timeout hangs or crashes.
-- **Dynamic Task Tracking**: Agile development logs are dynamically synced into the workspace [task.md](../task.md) and [walkthrough.md](../walkthrough.md) artifacts to track progress until connectivity is restored.
+- **Dynamic Task Tracking**: Agile development logs are dynamically synced into the workspace [task.pdf](../task.md) and [walkthrough.pdf](../walkthrough.md) artifacts to track progress until connectivity is restored.
 
 ---
 *Documented by Antigravity.*

TEMPAT SAMPAH
docs/architecture.pdf


TEMPAT SAMPAH
docs/disaster_recovery_plan.pdf


TEMPAT SAMPAH
docs/distributed_deployment.pdf


TEMPAT SAMPAH
docs/docker_connection.pdf


+ 2 - 2
docs/project_report.md

@@ -48,7 +48,7 @@ Below is an exhaustive catalog of every critical file in the repository, detaili
 | **download_csv.sh**<br>`./download_csv.sh` | Downloader helper script that fetches specific smaller subsets of OpenFoodFacts CSV files. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **master_trigger.sh**<br>`./master_trigger.sh` | Orchestrator script that wakes and verifies multiple secondary subservices in sequence. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **manage_services.sh**<br>`./manage_services.sh` | DevOps service manager script. Handles automated, sequential startup, shutdown, restart, and health checking of all container elements in the stack. | `1e316d1` | Lange François | 2026/06/16 09:25:09 | *[#1] Render Mermaid flowcharts, relative cross-linking, and clean up RCS $ placeholders* |
-| **generate_docs.py**<br>`./generate_docs.py` | Dynamic doc generator. Generates and mirrors all markdown manuals under `/docs` with live Git log metadata injection. | `2a1cfbe` | Lange François | 2026/06/16 19:21:55 | *[#1] Fix code block line wrapping and replace literal $ placeholders with correct #ident formatting in descriptions* |
+| **generate_docs.py**<br>`./generate_docs.py` | Dynamic doc generator. Generates and mirrors all markdown manuals under `/docs` with live Git log metadata injection. | `2a8ed05` | Lange François | 2026/06/16 21:48:22 | *[#1] Fix PDF fonts layout margins and installation guide steps* |
 | **docker-compose.yml**<br>`./docker-compose.yml` | Main 10-container Docker orchestration map defining MySQL, App UI, Ollama Engine, SearXNG, Nginx proxy, Airflow stack, and Zabbix server suites. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **docker-compose_skip.yml**<br>`./docker-compose_skip.yml` | Resilient 8-container offline/local single-node orchestration manifest. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **docker-compose-wsl.yml**<br>`./docker-compose-wsl.yml` | WSL2-specific Docker Compose configuration file. Configures services with a +20 port shift to guarantee zero port conflicts on developer workstations. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
@@ -59,7 +59,7 @@ Below is an exhaustive catalog of every critical file in the repository, detaili
 | **requirements.txt**<br>`./requirements.txt` | Python runtime dependency catalog storing strict library versioning constraints. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **INSTALL_WSL.md**<br>`./INSTALL_WSL.md` | WSL2 deployment guide. Provides step-by-step instructions for installing and deploying the application inside WSL2 with port shifts. | `129180a` | Lange François | 2026/06/15 12:49:05 | *[#1] Add Developer and Agent Productivity Guidelines to guides and agent workflows* |
 | **taiga/local-food-ai-1-36f35ff9-da1b-4eb5-9309-058448c998ad.json**<br>`./taiga/local-food-ai-1-36f35ff9-da1b-4eb5-9309-058448c998ad.json` | Historical Taiga Agile export. Contains the complete project history, including all closed user stories, tasks, and sprint configurations. | `d768ead` | Lange François | 2026/06/01 07:44:40 | *TG-221 #closed - Last commit to sync all the file to ship to the teacher.* |
-| **scripts/generate_pdfs.py**<br>`./scripts/generate_pdfs.py` | PDF document builder. Converts all markdown documentation manuals under `/docs` into high-fidelity PDF format with expanded Git version headers. | `609bfd1` | Lange François | 2026/06/16 21:00:12 | *[#1] Style code blocks as dark terminal boxes, avoid page-breaks inside pre elements to prevent copy-paste split errors, and update compiled PDFs* |
+| **scripts/generate_pdfs.py**<br>`./scripts/generate_pdfs.py` | PDF document builder. Converts all markdown documentation manuals under `/docs` into high-fidelity PDF format with expanded Git version headers. | `2a8ed05` | Lange François | 2026/06/16 21:48:22 | *[#1] Fix PDF fonts layout margins and installation guide steps* |
 | **scripts/generate_project_report.py**<br>`./scripts/generate_project_report.py` | Technical project report generator. Automatically gathers codebase structure, Git commit metadata, and purpose records to construct the Project.pdf report. | `2a1cfbe` | Lange François | 2026/06/16 19:21:55 | *[#1] Fix code block line wrapping and replace literal $ placeholders with correct #ident formatting in descriptions* |
 | **scripts/setup_deploy.py**<br>`./scripts/setup_deploy.py` | DevOps deployment script. Orchestrates local and VM container sets, verifying network connectivity and system parameters. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |
 | **scripts/taiga_sync_final.py**<br>`./scripts/taiga_sync_final.py` | Taiga automated synchronization helper. Pushes bug tickets, fills wiki pages, and assigns unassigned user stories. | `a701972` | Lange François | 2026/06/16 18:25:32 | *[#1] Fix PDF corruption via renormalization and add Uninstall Guide for WSL and Windows* |

TEMPAT SAMPAH
docs/project_report.pdf


TEMPAT SAMPAH
docs/retro_planning.pdf


TEMPAT SAMPAH
docs/taiga_audit_report.pdf


TEMPAT SAMPAH
docs/zabbix_monitoring.pdf


+ 53 - 23
generate_docs.py

@@ -206,10 +206,14 @@ sudo apt remove -y docker.io docker-compose docker-compose-v2 docker-doc podman-
 ```bash
 sudo apt update
 sudo apt install -y ca-certificates curl
-sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
-echo "deb [arch=\$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
+  -o /etc/apt/keyrings/docker.asc
+echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
+https://download.docker.com/linux/ubuntu jammy stable" | \
+sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
 sudo apt-get update
-sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+sudo apt-get install -y docker-ce docker-ce-cli containerd.io \
+  docker-buildx-plugin docker-compose-plugin
 ```
 
 ### Step 2.3: Start and Enable Docker Daemon
@@ -226,9 +230,23 @@ sudo usermod -aG docker $USER
 ```
 
 ### Step 2.5: Reboot the WSL Instance
-Execute the command below inside WSL to gracefully reboot the instance:
+To reboot the WSL instance, you must shutdown and restart WSL. You can choose one of the following methods:
+
+**Option A: Restart from Windows Host (Recommended & Safest)**
+1. Close your Ubuntu terminal.
+2. Open Windows PowerShell or Command Prompt.
+3. Run the shutdown command:
+   ```powershell
+   wsl --shutdown
+   ```
+4. Re-open your Ubuntu terminal.
+
+**Option B: Restart from inside WSL Terminal**
+If you prefer to trigger the reboot directly from the WSL terminal:
 ```bash
-cd /mnt/c/ && cmd.exe /c start "rebooting WSL" cmd /c "timeout 5 && wsl -d $WSL_DISTRO_NAME" && wsl.exe --terminate $WSL_DISTRO_NAME
+cd /mnt/c/ && cmd.exe /c start "rebooting WSL" cmd /c \
+  "timeout 5 && wsl -d Ubuntu-22.04" && \
+  wsl.exe --terminate Ubuntu-22.04
 ```
 
 Upon reconnecting, verify Docker is running by starting the hello-world container:
@@ -250,20 +268,20 @@ sudo update-alternatives --config iptables
 ### Step 3.2: Configure DNS Settings
 To ensure reliable package downloads and LLM registry calls:
 ```bash
-echo "1,\$ s/^/#/
-\$ a
+echo '1,$ s/^/#/
+$ a
 nameserver 1.1.1.1
 .
 w
-q" | sudo ed /etc/resolv.conf
+q' | sudo ed /etc/resolv.conf
 
-echo "\$ a
+echo '$ a
 # Added these 2 lines:
 [network]
 generateResolvConf = false
 .
-W
-q" | sudo ed /etc/wsl.conf
+w
+q' | sudo ed /etc/wsl.conf
 ```
 
 ---
@@ -271,8 +289,8 @@ q" | sudo ed /etc/wsl.conf
 ## 4. Repository Clones & Branch Governance
 
 There are two repositories configured for this project:
-- Primary Git Repository: `https://git.btshub.lu/lanfr/LocalFoodAI_lanfr144.git`
-- Alternative Git Repository (Worldwide Access - Clone): `https://github.com/lanfr144/LocalFoodAI_lanfr144.git`
+- Primary Git Repository: https://git.btshub.lu/lanfr/LocalFoodAI_lanfr144.git
+- Alternative Git Repository (Worldwide Access - Clone): https://github.com/lanfr144/LocalFoodAI_lanfr144.git
 
 Clone the primary repository inside your home directory:
 ```bash
@@ -307,12 +325,13 @@ git remote set-head origin main
 
 Ensure the runbooks and sync scripts have executable permissions:
 ```bash
-chmod +x data_sync.sh backup_db.sh manage_services.sh scripts/manage_models.sh
+chmod +x data_sync.sh backup_db.sh manage_services.sh \
+  scripts/manage_models.sh
 ```
 
 Follow the standard runbook to initialize credentials and launch services:
 ```bash
-# 1. Create a local [.env file](file:///C:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/.env) based on [step 3 guidelines](#3-network-configuration--performance-tuning)
+# 1. Create a local [.env file](file:///C:/Users/lanfr144/Documents/DOPRO1/Antigravity/Food/.env) based on step 3 guidelines
 # 2. Run the service manager to spin up containers
 ./manage_services.sh start
 ```
@@ -587,7 +606,15 @@ To prove and guarantee that no clinical user details or dietary profiles leave t
 
 
 # Documentation Home
-Welcome to the static documentation mirror. Please navigate the markdown files in this directory for architectural diagrams and guides.
+
+Welcome to the static documentation portal. Please navigate the guides below:
+
+- **[Detailed Installation and Deployment Guide](Installation_Guide.md)**
+- **[Clinician User Manual](User_Guide.md)**
+- **[Technical Capstone Document](Technical_Document.md)**
+- **[Agile Scrum Wiki Portal](Scrum_Wiki.md)**
+- **[System Uninstallation Guide](Uninstall_Guide.md)**
+- **[Recommendations for Future Projects](Recommendations.md)**
 """,
     "Scrum_Wiki.md": """The current version is #ident "@(#)$Format:LocalFoodAI_lanfr144:generate_docs.py:%an:%ae:%ad:%cn:%ce:%cd:%H:%D:%N$"
 
@@ -600,31 +627,34 @@ Welcome to the static Scrum documentation portal. This master wiki aggregates an
 
 ## Sprint Ceremonies & Logs
 
-### 1. [Sprint Plans (Scrum_Plan.md)](Scrum_Plan.pdf)
+### 1. [Sprint Plans](Scrum_Plan.md)
 *Contains Sprint Plan formulations, active user stories selection, scope statements, and team capacity bounds for each milestone loop.*
 
-### 2. [Daily Scrums (Scrum_Daily.md)](Scrum_Daily.pdf)
+### 2. [Daily Scrums](Scrum_Daily.md)
 *Continuous daily stand-up summaries tracking individual task completion, blocker mitigations, and immediate day-to-day coordination.*
 
-### 3. [Sprint Reviews (Scrum_Review.md)](Scrum_Review.pdf)
+### 3. [Sprint Reviews](Scrum_Review.md)
 *Contains sprint review logs, clinician demonstration summaries, feature validation checklists, and stakeholder feedback logs.*
 
-### 4. [Sprint Retrospectives (Scrum_Retro.md)](Scrum_Retro.pdf)
+### 4. [Sprint Retrospectives](Scrum_Retro.md)
 *Reviews process improvements, continuous integration learnings, and action items aimed at optimizing team operations and environment tuning.*
 
 ---
 
 ## Deliverables & Quality Assurance
 
-### 5. [Scrum Artifacts (Scrum_Artifacts.md)](Scrum_Artifacts.pdf)
+### 5. [Scrum Artifacts](Scrum_Artifacts.md)
 *Indexes sprint velocity metrics, completed story points distributions, burndown coordinates, and final Taiga delivery milestones.*
 
-### 6. [Sprint 8 Test Cases (Test_Cases_Sprint8.md)](Test_Cases_Sprint8.pdf)
+### 6. [Sprint 8 Test Cases](Test_Cases_Sprint8.md)
 *Legacy acceptance test logs covering core NLP chat, portion converters, and initial search validations.*
 
-### 7. [Uninstallation Guide (Uninstall_Guide.md)](Uninstall_Guide.pdf)
+### 7. [Uninstallation Guide](Uninstall_Guide.md)
 *Provides structured procedures to completely remove and tear down all system components from Windows and Linux/WSL environments.*
 
+### 8. [Recommendations for Future Projects](Recommendations.md)
+*Reflections and guidelines derived from this project's challenges to optimize subsequent deployments, including font selection, git attributes management, and shell formatting.*
+
 ---
 
 > [!NOTE]

+ 91 - 5
scripts/generate_pdfs.py

@@ -27,11 +27,15 @@ def main():
     }
     h1, h2, h3, h4, h5, h6, h1 *, h2 *, h3 *, h4 *, h5 *, h6 * {
         color: #000000 !important;
+        margin-top: 18px !important;
+        margin-bottom: 8px !important;
     }
     pre {
-        background-color: #212529 !important;
-        border: 1px solid #343a40 !important;
+        background-color: #f8f9fa !important;
+        border: 1px solid #e9ecef !important;
         padding: 2px !important;
+        margin-top: 8px !important;
+        margin-bottom: 16px !important;
         border-radius: 3px !important;
         font-family: 'Courier New', 'Courier', monospace !important;
         font-size: 10pt !important;
@@ -41,8 +45,8 @@ def main():
     pre code, pre * {
         font-family: 'Courier New', 'Courier', monospace !important;
         font-size: 10pt !important;
-        color: #f8f9fa !important;
-        background-color: #212529 !important;
+        color: #212529 !important;
+        background-color: #f8f9fa !important;
         white-space: pre-wrap !important;
         word-break: break-all !important;
     }
@@ -133,6 +137,9 @@ def main():
         
         # Add <br/> after code blocks to force copy-paste blank line
         md_content = re.sub(r'(```[a-zA-Z0-9_-]*\n[\s\S]*?\n```)', r'\1\n<br/>', md_content)
+        
+        # Convert any relative markdown links in standard format [text](filename.md) or [text](./filename.md) to point to .pdf
+        md_content = re.sub(r'\]\((?!http|https)([a-zA-Z0-9_./-]+)\.md(#[a-zA-Z0-9_-]+)?\)', r'](\1.pdf\2)', md_content, flags=re.IGNORECASE)
 
         try:
             pdf = MarkdownPdf(toc_level=2, optimize=True, plugins={"mermaid": {}})
@@ -160,7 +167,86 @@ def main():
             else:
                 pdf.add_section(Section(md_content, paper_size="A4", root=root_dir), user_css=user_css)
                 
-            pdf.save(pdf_file)
+            # Post-process compiled PDF to insert header and footer
+            import fitz
+            doc = pdf._make_doc()
+            total_pages = len(doc)
+            
+            # Parse title from md_content
+            title_match = re.search(r'^#\s+(.+)$', md_content, re.MULTILINE)
+            if title_match:
+                doc_title = title_match.group(1).strip()
+                doc_title = re.sub(r'[*_`#]', '', doc_title).strip()
+            else:
+                doc_title = os.path.basename(pdf_file).replace('.pdf', '').replace('_', ' ')
+            
+            image_path = os.path.join(docs_dir, 'am.png')
+            
+            for page_idx in range(total_pages):
+                page = doc[page_idx]
+                width = page.rect.width
+                height = page.rect.height
+                
+                # Header layout
+                # Left: am.png picture (if exists)
+                if os.path.exists(image_path):
+                    image_rect = fitz.Rect(48, 12, 48 + 16, 12 + 16)
+                    page.insert_image(image_rect, filename=image_path)
+                
+                # Middle: document title (centered)
+                # Right: "DOPRO1"
+                r_text = "DOPRO1"
+                fontsize = 8
+                fontname = "helv"
+                
+                m_width = fitz.get_text_length(doc_title, fontname=fontname, fontsize=fontsize)
+                r_width = fitz.get_text_length(r_text, fontname=fontname, fontsize=fontsize)
+                
+                page.insert_text(
+                    fitz.Point((width - m_width) / 2, 22),
+                    doc_title,
+                    fontname=fontname,
+                    fontsize=fontsize,
+                    color=(0.5, 0.5, 0.5)
+                )
+                
+                page.insert_text(
+                    fitz.Point(width - 48 - r_width, 22),
+                    r_text,
+                    fontname=fontname,
+                    fontsize=fontsize,
+                    color=(0.5, 0.5, 0.5)
+                )
+                
+                # Footer layout
+                # Left: "lanfr144"
+                # Middle: "Page X of Y"
+                l_footer = "lanfr144"
+                footer_text = f"Page {page_idx + 1} of {total_pages}"
+                f_width = fitz.get_text_length(footer_text, fontname=fontname, fontsize=fontsize)
+                
+                page.insert_text(
+                    fitz.Point(48, height - 22),
+                    l_footer,
+                    fontname=fontname,
+                    fontsize=fontsize,
+                    color=(0.5, 0.5, 0.5)
+                )
+                
+                page.insert_text(
+                    fitz.Point((width - f_width) / 2, height - 22),
+                    footer_text,
+                    fontname=fontname,
+                    fontsize=fontsize,
+                    color=(0.5, 0.5, 0.5)
+                )
+                
+            # Deflate, clean, garbage collect and linearize the document
+            # to fix Acrobat encoding and save prompts
+            doc.save(pdf_file, clean=True, garbage=3, deflate=True)
+            doc.close()
+            pdf.temp_files.clean()
+            
             print(f"Saved {os.path.basename(pdf_file)}")
             
             # Copy to workspace root if applicable