# JOCYT Business Consult website + client portal — v1.0.0

## UPLOAD THESE FILES

**This is a first install on jocytconsult.com.** Before uploading anything, in cPanel File Manager **download a copy of whatever is in `public_html` now** — especially `index.php`, `index.html` and `.htaccess` at the top level. The JBCS dashboard folder (`dashbaord/`) and `sethrockpass` are not touched by this zip, but a top-level `index.php` or `.htaccess` would be replaced.

The zip `jocyt_site_v1.0.0.zip` has two folders:

| From the zip | Upload to | What it is |
|---|---|---|
| `jocyt_site/` | `/home/YOURUSER/jocyt_site/` — **beside** `public_html`, not inside it | The application, install SQL and private storage |
| everything inside `public_html/` | `/home/YOURUSER/public_html/` | `index.php`, `.htaccess`, `assets/`, `uploads/` |

- If `public_html/.htaccess` **already exists**, do not overwrite it: open both and add this release's lines to the end of yours (the comments in the file say which).
- Then copy `jocyt_site/app/config.sample.php` to `jocyt_site/app/config.php` and fill it in (database, `BASE_URL`, `APP_KEY`, `SETUP_KEY`, `ADMIN_PATH`, e-mail). **`config.php` is never in a zip, so later releases cannot overwrite it.**
- If your host will not let you put folders beside `public_html`, put `jocyt_site/` inside `public_html` and change the one line `$appDir` in `public_html/index.php` to `__DIR__ . '/jocyt_site/app'`. Its `.htaccess` files keep it private (tested).

## RUN THIS SQL

`jocyt_site/install/jocyt_site_setup.sql` — **once**, in phpMyAdmin, on a **new, empty database** created for the website (cPanel → MySQL Databases). It creates 19 tables and the starting content (plans, engagement levels, FAQs, 5 published articles, 3 draft outlines).

Safe to run again: it never drops or deletes anything and never overwrites a row you have edited (tested by running it twice over a populated database).

## DO NOT RUN

**Do not run this SQL in the JBCS database** (`retail_setup.sql`'s database). The website has its own database on purpose: a website problem can never touch shop data. Nothing in this release changes JBCS.

## ORDER MATTERS

1. Create the empty database and user → run the SQL.
2. Upload both folders → create `config.php`.
3. Visit `https://jocytconsult.com/<ADMIN_PATH>/setup`, enter the `SETUP_KEY`, create your administrator. (The page disappears after the first account.)
4. Sign in → you will be asked to set up two-step verification (Google/Microsoft Authenticator) before anything else.
5. Work down the **launch checklist** on the admin dashboard.

## HOW LONG

The SQL runs in under a second. Upload about 5 minutes (≈ 2 MB, mostly fonts). If a page shows "This site is not configured yet", `config.php` is missing or misnamed.

## WHAT TO SWITCH ON

| Where | What |
|---|---|
| cPanel → Cron Jobs | Once a day: `php /home/YOURUSER/jocyt_site/app/cron.php` — renewal invoices, past-due marking, nightly backup (keeps 14) |
| `config.php` | `MAIL_DRIVER = 'smtp'` with a mailbox on the domain. Until then e-mails are written to `jocyt_site/storage/mail` and not sent. |
| DNS | SPF, DKIM, DMARC records for the sending domain (cPanel → Email Deliverability does SPF/DKIM) |
| `config.php` (optional) | Paystack keys — start with **test** keys. Then paste the webhook URL shown in Business settings into Paystack. |
| Admin → Business settings | Phone, WhatsApp, e-mail, address, MoMo/bank details, Search Console code, GA4 id |
| Admin → Logo & favicon | Upload the logo (PNG) and a square icon (512 px+) — every favicon size is generated |
| Admin → Staff accounts | A **second super admin**, so one lost phone cannot lock you out |
| Google Search Console | Add the property, paste the verification code in settings, submit `https://jocytconsult.com/sitemap.xml` |

**Roles.** Super admin (everything), Manager (everything except staff, backups and the 2FA rule), Sales (leads, clients, subscriptions, invoices, support), Content editor (insights, FAQs, page SEO, logo). You hold Super admin by setup, so nothing needs granting for the site to work.

**Locked out?** From cPanel → Terminal: `php ~/jocyt_site/app/recover.php you@example.com --reset`

## Requirements

PHP 8.0 or newer (tested on 8.3) with `pdo_mysql`, `gd` (with WebP if possible), `fileinfo`, `mbstring`, `sodium`, `curl`, `openssl`; MySQL 5.7+ or MariaDB 10.3+ (tested on MariaDB 10.11); Apache with `mod_rewrite` (and `mod_headers` recommended).
