Master Mapper — cPanel installation  (v0.1.0)
==========================================================

فارسی
-----
این یک سایت استاتیک است (HTML + جاوااسکریپت + مدل‌های سه‌بعدی). به دیتابیس، Node.js یا تنظیم خاصی نیاز ندارد.
تصویر و ویدئوی مشتری روی هاست ذخیره نمی‌شود؛ فقط در مرورگر خود کاربر می‌ماند.

روش ۱ — نصب‌کننده (پیشنهادی)
 ۱. در cPanel > File Manager وارد پوشه‌ی دامنه شوید (مثلاً public_html یا یک زیرپوشه).
 ۲. هر دو فایل install.php و app.zip را در همان پوشه آپلود کنید (اگر با FTP می‌فرستید حالت Binary).
    (اگر فایل led-configurator-cpanel-*.zip را دارید: آن را آپلود کنید، روی آن Extract بزنید.)
 ۳. در مرورگر باز کنید:  https://دامنه‌ی-شما/install.php
 ۴. مراحل را بروید: بررسی سرور ← ساختن یک فایل خالی با نامی که نشان می‌دهد ← انتخاب محل نصب ← «نصب کن».
 ۵. در پایان حتماً «پاک کردن نصب‌کننده» را بزنید.

روش ۲ — دستی (اگر افزونه‌ی Zip خاموش است)
 ۱. app.zip را در File Manager آپلود و روی آن راست‌کلیک > Extract بزنید.
 ۲. فایل .htaccess را ببینید (در File Manager تنظیمات > Show Hidden Files را روشن کنید).
    اگر قبلاً سایت دیگری با .htaccess در همان پوشه بود، محتوای بلوک «BEGIN LED Configurator … END» را به فایل قبلی اضافه کنید.

فایل .htaccess
 • قوانین سرور (هدرهای امنیتی، نوع فایل .glb/.wasm، فشرده‌سازی، کش) هم داخل app.zip هستند و نصب‌کننده خودش آن‌ها را می‌گذارد؛
   همین قوانین به‌صورت فایل جدا هم در بسته آمده: «.htaccess» و یک کپی با نام قابل‌دیدن «htaccess.txt».
 • اگر File Manager فایل‌های نقطه‌دار را نشان نمی‌دهد: Settings > Show Hidden Files.
 • اگر در همان پوشه از قبل یک .htaccess دارید (مثلاً وردپرس) فایل را رویش کپی نکنید؛ محتوای htaccess.txt را به انتهای/ابتدای فایل خودتان اضافه کنید
   (یا نصب‌کننده را بزنید که بلوک را بدون خراب‌کردن فایل شما اضافه می‌کند).
 • اگر بعد از گذاشتن .htaccess سایت خطای 500 داد، هاست یکی از دستورها را اجازه نمی‌دهد: بلوک «BEGIN … END LED Configurator» را پاک کنید؛ سایت بدون آن هم کار می‌کند.

بخش سرور (حساب کاربری، ثبت سفارش، داشبورد ادمین)
 • قبل از نصب در cPanel > MySQL Databases یک دیتابیس **خالی** و یک کاربر بسازید و کاربر را با «ALL PRIVILEGES» به آن اضافه کنید.
 • در مرحله‌ی «محل نصب» تیک «بخش سرور را هم نصب کن» را نگه دارید و نام دیتابیس/کاربر/گذرواژه و مشخصات ادمین اول را بنویسید.
   نصب‌کننده اتصال را قبل از کپی فایل‌ها امتحان می‌کند، جدول‌ها را می‌سازد، فایل api/config.php (با گذرواژه‌ی دیتابیس) را می‌نویسد و ادمین را می‌سازد.
 • بعد از نصب، کاربران اول ثبت‌نام/ورود می‌کنند؛ ادمین از منوی کاربر «داشبورد ادمین» را باز می‌کند، فهرست قیمت را پر می‌کند و سفارش‌ها را می‌بیند.
 • هیچ قیمتی از پیش نیست: تا ادمین قیمت نگذارد، برآورد «نیازمند استعلام» نشان می‌دهد.
 • به‌روزرسانی: دوباره install.php را اجرا کنید؛ تنظیمات و داده‌ها حفظ می‌شود و فقط ساختار دیتابیس به‌روز می‌شود.
 • اگر نمی‌خواهید حساب کاربری داشته باشید تیک را نزنید: برنامه مثل قبل بدون ورود کار می‌کند.

نکته‌ها
 • برای خروجی ویدئو (MP4) سایت باید با HTTPS باز شود: cPanel > SSL/TLS Status > Run AutoSSL.
 • به‌روزرسانی: نسخه‌ی جدید بسته را بگیرید، دوباره install.php را اجرا کنید (فایل install.lock را پاک کنید).
 • حذف سایت: پوشه‌ی نصب را از File Manager پاک کنید.
 • سازگاری: PHP 7.4 تا 8.x (فقط برای نصب‌کننده لازم است؛ خود سایت PHP استفاده نمی‌کند).

English
-------
A static site (HTML + JavaScript + 3D models): no database, no Node.js, nothing to configure.
Customer pictures and videos are never stored on the host; they stay in the visitor's own browser.

Method 1 — the installer (recommended)
 1. cPanel > File Manager: open your domain's folder (e.g. public_html, or a sub-folder).
 2. Upload BOTH install.php and app.zip into it (FTP: BINARY mode).
    (If you have led-configurator-cpanel-*.zip: upload it and Extract it there.)
 3. Open  https://your-domain/install.php
 4. Follow the steps: server check > create the empty proof file it names > choose the place > "Install".
 5. Finally press "Delete the installer".

Method 2 — by hand (if the PHP Zip extension is off)
 1. Upload app.zip in File Manager, right-click > Extract.
 2. Check the .htaccess file (File Manager > Settings > Show Hidden Files). If another site already had a
    .htaccess in that folder, add the "BEGIN LED Configurator … END" block to it instead of replacing it.

The .htaccess file
 • The server rules (security headers, .glb/.wasm types, compression, caching) are inside app.zip and the installer puts them in place;
   they also ship as a loose file: ".htaccess" and a visible copy named "htaccess.txt".
 • If File Manager does not show dot-files: Settings > Show Hidden Files.
 • If the folder already has a .htaccess (e.g. WordPress) do not copy the file over it; add the content of htaccess.txt to your own file
   (or use the installer, which adds the block without damaging yours).
 • If the site answers 500 after the .htaccess is in place, the host forbids one of the directives: delete the
   "BEGIN … END LED Configurator" block; the site works without it.

The server part (accounts, orders, admin dashboard)
 • Before installing, in cPanel > MySQL Databases create an EMPTY database and a user, and add the user to it with ALL PRIVILEGES.
 • In the "where to install" step keep "Install the server part too" ticked and enter the database name / user / password and the first administrator.
   The installer tests the connection BEFORE copying any file, creates the tables, writes api/config.php (it holds the database password) and creates the administrator.
 • Afterwards customers sign up / sign in first; the administrator opens "Admin dashboard" from the user menu, fills in the price list and sees the orders.
 • No price is ever pre-filled: until the administrator sets prices the estimate says "needs a quote".
 • Update: run install.php again; settings and data are kept, only the database structure is updated.
 • Leave the box unticked if you do not want accounts: the app then works as before, without sign-in.

Notes
 • MP4 video export needs HTTPS: cPanel > SSL/TLS Status > Run AutoSSL.
 • Update: get the new package and run install.php again (delete install.lock first).
 • Uninstall: delete the install folder in File Manager.
 • Compatibility: PHP 7.4 – 8.x (only the installer uses PHP; the site itself does not).

Integrity: app.zip SHA-256 = efd4953bc0ce2601f5a96bcb43ed49c70702fe7c07f0fd6cd7bc976735d7ed0f
