# Komal Star — cPanel Deployment Guide

Domain configured: `https://komalstar.com`

## What to upload

After running the build, the ready-to-upload folder is:

```
dist/cpanel/
```

Or use the zip file:

```
dist/cpanel.zip
```

## Build command

```bash
bun run build:cpanel
```

This produces the static site, copies the PHP API bridge, and creates the zip.

## Upload steps

1. Log in to cPanel and open **File Manager**.
2. Navigate to the `public_html` folder for `komalstar.com`.
3. Delete the old contents (keep any existing email/SSL files if unsure, but remove old site files).
4. Upload the contents of `dist/cpanel/` (or extract `dist/cpanel.zip`) into `public_html`.
5. Make sure `index.html` is at the root of `public_html`.

## After upload

1. Open `https://komalstar.com` in a browser.
2. Test deep links: `https://komalstar.com/products`, `https://komalstar.com/about`, `https://komalstar.com/contact`, `https://komalstar.com/blog`.
3. If a page shows 404, ensure the `.htaccess` file was uploaded and Apache `mod_rewrite` is enabled.

## Admin portal

The admin portal is at:

```
https://komalstar.com/admin
```

The PHP API runs at:

```
https://komalstar.com/api/
```

First time: run the install script in a browser to create the database tables and owner user:

```
https://komalstar.com/api/install.php
```

Delete or rename `api/install.php` after the first run for security.

## MySQL setup in cPanel

1. Create database: `rpagroin_komal_star`
2. Create a MySQL user and add it to the database with **All Privileges**.
3. Open `api/config.php` in File Manager and edit:
   - `DB_HOST` (usually `localhost`)
   - `DB_NAME` (`rpagroin_komal_star`)
   - `DB_USER`
   - `DB_PASS`
   - `JWT_SECRET` (generate a strong random string)
4. Save the file.

## SEO / Google indexing

The following are already configured:

- `public/sitemap.xml` (uploaded as `sitemap.xml`) lists all public routes.
- `public/robots.txt` (uploaded as `robots.txt`) points Google to the sitemap.
- Every page has `og:url`, `canonical`, and JSON-LD pointing to `https://komalstar.com`.

To submit to Google:
1. Go to [Google Search Console](https://search.google.com/search-console).
2. Add property `komalstar.com` and verify ownership.
3. Submit the sitemap: `https://komalstar.com/sitemap.xml`.

## Important notes

- The site is a static React SPA. Apache `.htaccess` handles routing so refresh works on any page.
- Product/blog images are stored in `public_html/uploads/` via the PHP API.
- The site uses the `https://komalstar.com` domain. For `www.komalstar.com`, redirect to the non-www version in cPanel or update the domain in `src/lib/site.ts` and rebuild.
