# Shoeniverse: going live on www.shoeniverse.co.ke

This guide sets the shop up from scratch on the hosting where **shoeniverse.co.ke** will live, for example the Truehost Webhosting Starter plan.

- The shop's address is **https://www.shoeniverse.co.ke**.
- shoeniverse.co.ke without www, shoeniverse.ke and www.shoeniverse.ke all forward to it.
- No SSH or Composer is needed. Everything is already installed.

## What you upload

| File | What it is |
|---|---|
| `shoeniverse-live-app.zip` | The website and its libraries, with all updates up to 14 Nov 2026, the settings file `.env` and the database file |
| `shoeniverse-live-photos-1.zip`, `shoeniverse-live-photos-2.zip` | All product photos (782 photos, 706 products) |

Throughout this guide, `CPANELUSER` stands for your cPanel username. It is shown at the top right of cPanel and in the hosting welcome email.

### How the folders look when you are done

```
/home/CPANELUSER/
├── public_html/            ← main domain of the account (e.g. shoeniverse.ke). Holds only a forwarding .htaccess
└── shoeniverse/            ← the shop (private: app code, settings, logs)
    ├── .env                ← settings: database, M-Pesa, email
    ├── app/  config/  resources/  routes/  vendor/  …
    ├── storage/logs/       ← error logs
    ├── database/cpanel/shoeniverse.sql
    ├── cpanel/htaccess-for-public_html
    └── public/             ← the ONLY folder the web can see. shoeniverse.co.ke points here
        ├── index.php  .htaccess  robots.txt
        ├── css/  js/  img/
        └── storage/products/…   ← photos
```

Only `public/` is reachable from the web. `.env`, the code and the logs stay private.

---

## Step 1: Point the domain at the hosting

- **Bought shoeniverse.co.ke in the same Truehost account as the hosting?** Nothing to do; it already uses Truehost's nameservers.
- **Bought it elsewhere, or on another account?** Set its nameservers to the two listed in the hosting welcome email. In the Truehost client area they are under **Domains › shoeniverse.co.ke › Nameservers**.

DNS changes usually show within an hour. Allow up to 24 hours. You can do steps 2–6 while you wait.

## Step 2: Add the domain in cPanel

cPanel › **Domains** › **Create a New Domain**:

| Field | Value |
|---|---|
| Domain | `shoeniverse.co.ke` |
| Share document root | **Untick** |
| Document root | `shoeniverse/public` |

Click **Submit**. `www.shoeniverse.co.ke` works automatically.

If shoeniverse.co.ke is the account's **main** domain, it uses `public_html`. In that case, follow *Main-domain setup* at the end instead.

## Step 3: Set PHP

cPanel › **MultiPHP Manager** (or **Select PHP Version**):

- Set `shoeniverse.co.ke` to **PHP 8.3** (8.4 also works).
- Under **Extensions**, tick: `pdo_mysql`, `mysqli`, `mbstring`, `intl`, `gd`, `zip`, `fileinfo`, `openssl`, `curl`, `xml`, `tokenizer`, `bcmath`.
- Optional: in **MultiPHP INI Editor**, set `upload_max_filesize` and `post_max_size` to `16M` so the admin can take large photos.

## Step 4: Create the database

**4a. Database and user.** cPanel › **MySQL® Databases**:

1. **Create New Database:** type `shoeniverse` › **Create Database**. cPanel names it `CPANELUSER_shoeniverse`.
2. **MySQL Users › Add New User:**
   - Username: `shoeniverse`. cPanel names it `CPANELUSER_shoeniverse`.
   - Password: use the generator, but keep **letters and numbers only**, at least 16 characters. Symbols like `#` or `$` can break the settings file.
   - Write the password down.
3. **Add User To Database:** choose that user and that database › **Add** › tick **ALL PRIVILEGES** › **Make Changes**.

**4b. Load the shop's data.**

1. Extract `shoeniverse-live-app.zip` on your computer. Inside, find `shoeniverse/database/cpanel/shoeniverse.sql`.
2. cPanel › **phpMyAdmin**. In the left column, click `CPANELUSER_shoeniverse`. The database must be empty.
3. **Import** tab › **Choose File** › `shoeniverse.sql` › leave the other options › **Import** (at the bottom).
4. You should see “Import has been successfully finished”. The left column now lists 21 tables, including `products`, `orders` and `pages`.

If phpMyAdmin says the file is too large, upload it to `shoeniverse/database/cpanel/` in File Manager, right-click › **Compress** › **Zip**, and import the `.zip` instead.

> **Keep edits made on the preview.** If Shoeniverse has already changed products, prices or settings in the preview admin (shoeniverse.alitdigital.com/admin), move that data instead:
> 1. In the **preview's** phpMyAdmin, run `update-2026-11-14-help-pages.sql`, then `update-2026-11-14-tracksuits-prices.sql` (SQL tab › paste › **Go**). Both are in `database/cpanel/`.
> 2. **Export** › Quick › SQL › **Go**.
> 3. Import that file in step 4b instead of `shoeniverse.sql`.

## Step 5: Upload the files

cPanel › **File Manager**:

1. Click **Settings** (top right) › tick **Show Hidden Files (dotfiles)** › **Save**.
2. Open your home folder `/home/CPANELUSER`. This is the folder that contains `public_html`; don't go inside `public_html`.
3. **Upload** `shoeniverse-live-app.zip`. When it finishes, go back, right-click the zip › **Extract** › **Extract Files**. You now have `/home/CPANELUSER/shoeniverse`.
4. Open `shoeniverse/public`. **Upload** both photo zips there, then **Extract** each one. They fill `public/storage/products/`.
5. Delete the three zip files.

## Step 6: Fill in the settings file

In File Manager, right-click `shoeniverse/.env` › **Edit**.

**Required.** Change these three lines, keeping the single quotes:

```
DB_DATABASE='CPANELUSER_shoeniverse'
DB_USERNAME='CPANELUSER_shoeniverse'
DB_PASSWORD='the password from step 4a'
```

**Already set (leave as they are):**

| Line | Meaning |
|---|---|
| `APP_KEY=base64:…` | Encryption key. Never change it after launch, or everyone is logged out |
| `APP_URL=https://www.shoeniverse.co.ke` | The shop's address. Links and photos use it |
| `APP_ENV=production`, `APP_DEBUG=false` | Hides error details from visitors |
| `DB_HOST=localhost` | Correct for cPanel |
| `PUBLIC_STORAGE_IN_PUBLIC=true` | Photos live in `public/storage`. No symlink needed |
| `SESSION_SECURE_COOKIE=true` | Logins only over https |

**Fill in later:**

| Lines | When |
|---|---|
| `MAIL_USERNAME`, `MAIL_PASSWORD` | After creating `shop@shoeniverse.co.ke` (step 9). Enables “Forgot password” |
| `MPESA_CONSUMER_KEY`, `MPESA_CONSUMER_SECRET`, `MPESA_SHORTCODE`, `MPESA_PASSKEY` | When Safaricom issues the live Daraja keys. Until then, orders still come in and the customer is told payment is confirmed on WhatsApp |

Click **Save Changes**.

Permissions: folders `755`, files `644`. If the logs show “Permission denied”, right-click `shoeniverse/storage` and `shoeniverse/bootstrap/cache` › **Change Permissions** › `755`.

## Step 7: Forward shoeniverse.ke

If shoeniverse.ke is on the same hosting and is its main domain, it uses `public_html`:

1. In File Manager, open `shoeniverse/cpanel/` and copy `htaccess-for-public_html` to `/home/CPANELUSER/public_html`.
2. In `public_html`, rename it to `.htaccess`. Replace the old one if asked.
3. Remove any old `index.html` placeholder from `public_html`.

shoeniverse.co.ke without www is forwarded by the shop's own `public/.htaccess`.

## Step 8: Switch on HTTPS

cPanel › **SSL/TLS Status** › tick `shoeniverse.co.ke`, `www.shoeniverse.co.ke`, `shoeniverse.ke` and `www.shoeniverse.ke` › **Run AutoSSL**.

Wait for green padlocks, which takes a few minutes once DNS is pointing at the hosting. Until then, the browser may warn about the certificate.

## Step 9: Check and finish

| Open | You should see |
|---|---|
| https://www.shoeniverse.co.ke | The shop, with photos and the tracksuits at the top of New arrivals |
| http://shoeniverse.co.ke, shoeniverse.ke | Forwarded to https://www.shoeniverse.co.ke |
| https://www.shoeniverse.co.ke/admin | Admin login. The details are in `shoeniverse/FIRST-LOGIN.txt` |
| https://www.shoeniverse.co.ke/sitemap.xml | A list of pages for Google |

Then:

1. **Admin password:** log in › avatar (top right) › **Profile** › set a new password. Delete `FIRST-LOGIN.txt`.
2. **Email:** cPanel › **Email Accounts** › **Create** › `shop@shoeniverse.co.ke`. Open **Connect Devices** and copy the username and password into the `MAIL_` lines of `.env`.
3. **Admin › Store settings:** pick the theme visitors see first (Dark, Light or Auto). Check the phone, WhatsApp and Paybill numbers.
4. **Admin › Help pages:** confirm every [bracketed] item, then tick **Published**.
5. **Close the preview.** In A-Lit's cPanel › **Domains › Redirects**: `shoeniverse.alitdigital.com` → `https://www.shoeniverse.co.ke`, **Permanent (301)**. Delete the preview database a week later.
6. **Google:** add `https://www.shoeniverse.co.ke` in Google Search Console and submit `sitemap.xml`. Update the website link on the Google Business Profile, Instagram, Facebook, TikTok and WhatsApp Business.
7. **M-Pesa (later):** fill the `MPESA_` lines. Safaricom posts payments to `https://www.shoeniverse.co.ke/mpesa/callback`.

---

## If something isn't right

| You see | Fix |
|---|---|
| **500 error** | The real error is in `shoeniverse/storage/logs/` (newest file). The most common cause is the database lines in `.env`. |
| `SQLSTATE[HY000] [1045] Access denied` | Wrong database user or password in `.env`, or the user wasn't added to the database with ALL PRIVILEGES (step 4a). |
| `Base table or view not found` | The database is empty. Redo step 4b. |
| **403 Forbidden** | The domain's document root isn't `shoeniverse/public` (step 2), or there is an extra `.htaccess` in `/home/CPANELUSER/shoeniverse` (there must not be one). |
| Home page works, other pages give **404** | `public/.htaccess` is missing. Turn on Show Hidden Files and check it is there. |
| No photos | The photo zips weren't extracted in `shoeniverse/public`. You should have `public/storage/products/700/…-640.webp`. |
| Old design after an update | Press Ctrl+F5. |

## Main-domain setup (shoeniverse.co.ke uses public_html)

Some hosts don't let you change the main domain's folder. Then:

1. Do steps 3–6 as written.
2. Back up and empty `public_html`.
3. Move everything inside `shoeniverse/public` into `public_html`, including `.htaccess` and the `storage` folder.
4. Delete `public_html/index.php`.
5. Copy `shoeniverse/cpanel/index.php.for-public_html` into `public_html` and rename it to `index.php`.

## Updating later

Code is on GitHub at nnyutho/shoeniverse.

- Upload the changed files over the old ones.
- When an update adds tables, it comes with an SQL file in `database/cpanel/update-*.sql`. Run it once in phpMyAdmin › SQL.
- Never overwrite `.env`, `storage/` or `public/storage/`. They hold the settings, logs and photos.
