====================================================================
 RankOps — SEO Agency CRM · INSTALLATION (shared cPanel hosting)
====================================================================

WHAT YOU NEED
- A cPanel hosting account with PHP 8.0 or higher
- The PDO SQLite extension enabled (standard on almost all shared hosts;
  in cPanel: Software → Select PHP Version → make sure "pdo_sqlite"
  and "sqlite3" are ticked)
- The file rankops.zip from this package

NO database setup is needed. RankOps creates its own SQLite database
file automatically on first run (in the protected data/ folder).
NO Composer, NO Node, NO MySQL.

--------------------------------------------------------------------
STEP-BY-STEP (cPanel File Manager)
--------------------------------------------------------------------

1) CREATE THE SUBDOMAIN (skip if you already created it)
   - Log in to cPanel → Domains → "Create A New Domain"
   - Domain: crm.yourdomain.com  (or any subdomain / domain you want)
   - Untick "Share document root" so it gets its own folder
   - Submit. Note the Document Root it creates
     (usually: /home/USERNAME/crm.yourdomain.com  or  public_html/crm)

2) UPLOAD THE ZIP
   - cPanel → File Manager → open the subdomain's Document Root
   - Click "Upload" → select rankops.zip → wait for 100%
   - Go back, right-click rankops.zip → "Extract" → Extract into the
     SAME folder (the document root)
   - You should now see these items in the document root:
       .htaccess   public/   src/   data/   INSTALL.txt
   - You can delete rankops.zip after extracting.

3) CHECK FOLDER PERMISSIONS (usually fine by default)
   - The data/ folder must be writable by PHP: set permissions 775
     (right-click data → Change Permissions) only if the first visit
     shows a database error.

4) VISIT YOUR SITE
   - Open https://crm.yourdomain.com in the browser
   - You will see the RankOps login screen.
   - Click "Create the Super Admin account", enter your name, email
     and a strong password (min 8 characters) and submit.
   - >>> The FIRST account created becomes the Super Admin. <<<
     After that, public registration closes automatically and only
     the Super Admin can create Manager / Employee / Client accounts
     (Team / Users → Add User).

5) TURN ON HTTPS (recommended)
   - cPanel → Security → SSL/TLS Status → select your subdomain →
     "Run AutoSSL". Wait a few minutes, then always use https://

6) SET UP YOUR AGENCY (inside RankOps)
   - Settings → set your Agency Name
   - Team / Users → create your employees (with their SEO sub-role)
     and any Manager / Client accounts
   - Clients → add your clients
   - Websites → add your websites
   - Project Assignments → assign employees to websites
     (this also drives Issue auto-assignment and who sees what)
   - Each website has its own workspace (tabs: Overview, Keywords,
     Search Console, Ahrefs, Content, Backlinks, Tasks, Team,
     Health, Activity, Settings)

FUTURE UPDATES — NO MANUAL UPLOAD NEEDED
- This package includes a built-in remote updater
  (public/_rankops_update.php). It only accepts code updates sent
  over HTTPS (port 443) with a secret token that Muse holds — the
  server stores only the token's hash, never the token itself.
- Why: cPanel/FTP ports are blocked for Muse's network by the
  server's bot protection, but normal HTTPS (443) works. So after
  this ONE manual install, future fixes and updates are pushed by
  Muse directly — you do not have to upload files again.
- Safety: an update package can only touch public/ and src/ code
  files. It can NEVER overwrite data/ — your database
  (data/rankops.sqlite) is untouchable. Before each update the
  current code is backed up to data/backups/ (last 3 kept), and
  every attempt is written to data/update.log.
- To disable the updater forever: delete public/_rankops_update.php

NOTES
- Optional DEMO data: as Super Admin, go to Settings → "Load demo
  data" to fill the system with clearly-labeled DEMO sample data
  (demo accounts password: demo1234). Delete demo data/accounts
  before real use.
- Google Search Console: the Search Console tab is honest — live
  OAuth sync connects at deployment time on your domain. Until then,
  record real clicks/impressions in the website Overview tab with
  "Record Metrics Snapshot" (source is labeled; nothing is faked).
- Ahrefs: without an Ahrefs API plan the tab shows "Data unavailable
  from current Ahrefs plan/API access" — by design, no fake numbers.
- Backups: download the single file  data/rankops.sqlite  — that
  file IS your whole database. Copy it somewhere safe regularly.
- Troubleshooting: if you see a blank page, enable "display_errors"
  temporarily in cPanel → Select PHP Version → Options, reload, and
  note the message. The most common cause is pdo_sqlite not ticked
  (step "WHAT YOU NEED" above) or data/ not writable (step 3).
====================================================================
