# System Prerequisites & Setup Requirements

Before deploying and launching **Khandan (خاندان)**, make sure the hosting and local development environments meet these requirements.

## 1. Local & Hosting Server Requirements

### PHP Version
- **Minimum:** PHP 8.0
- **Recommended:** PHP 8.2+

### Required PHP Extensions
Ensure these extensions are enabled in your `php.ini` file:
1. **`pdo_sqlite` / `sqlite3`**: Necessary to read, write, and run transaction processes on the SQLite database file.
2. **`openssl`**: Crucial for encryption and decryption of sensitive user information inside the Digital Safety Deposit Box (AES-256-CBC).
3. **`fileinfo`**: Highly recommended to safely detect file mime types on uploads, preventing malicious extensions.
4. **`mbstring`**: Handles multi-byte character strings (essential for Persian/Arabic translations).

### Directory Access Rights
The web server (e.g., Apache, Nginx, or LiteSpeed) must have **write permissions** on:
- `src/database/` (to write and lock the `khandan.db` file).
- `public/uploads/` and all its subfolders (to save profile pictures, wills, archives, and recipes).

---

## 2. Client Browser Requirements
Since the front-end has no external libraries, it relies on modern browser APIs:
- **Service Workers & Cache Storage**: Required for PWA installation and offline layouts (Chrome, Safari Mobile, Firefox).
- **HTML5 Canvas / SVG**: Needed for rendering the interactive Drag-and-Drop Family Tree.
- **MediaRecorder API**: Must be supported to capture audio and video wills directly from user devices (requires HTTPS or localhost contexts).
- **Geolocation API**: Necessary to navigate and find ancestor grave locations.

---

## 3. Developer Local Machine Prerequisites
- **Python 3.x**: Installed and registered on path to execute the FTP deployment synchronization script:
  ```powershell
  python .agents/skills/ftp-deploy/scripts/deploy.py
  ```
- No extra pip packages are required (uses built-in `ftplib`, `hashlib`, `json`, `os`, and `argparse`).
