# Vespera House on your cPanel hosting

This package uses the MySQL database that appears in your phpMyAdmin. You do not need Node.js or PostgreSQL.

## 1. Upload the files

In cPanel File Manager, open your subdomain folder:

```text
public_html/vespera
```

Upload everything from this package so the folder looks like this:

```text
vespera/
├── api/
├── assets/
├── database/
├── .htaccess
├── index.html
└── robots.txt
```

If an old Vespera package is already there, replace the old `public`, `server`, and `database` folders with the files from this package. The new package uses `api`, not `server`.

## 2. Import the MySQL database

1. Open **phpMyAdmin** in cPanel.
2. Click your database in the left menu. It is likely:

   ```text
   yjwpofsw_vespera_house
   ```

3. Click the **Import** tab at the top.
4. Choose:

   ```text
   database/vespera-house-mysql.sql
   ```

5. Click **Import** or **Go**.

You should see tables named `products`, `journal_posts`, `subscribers`, `appointments`, and `users`.

## 3. Edit the database connection

In File Manager, open:

```text
api/config.php
```

Change only these values:

```php
const DB_NAME = 'yjwpofsw_vespera_house';
const DB_USER = 'yjwpofsw_vesperauser';
const DB_PASSWORD = 'YOUR_DATABASE_PASSWORD';
const DB_HOST = 'localhost';
```

Replace `YOUR_DATABASE_PASSWORD` with the password you created for the MySQL database user.

Usually the host is `localhost`. If the website reports a database connection error, ask your host for the MySQL host.

## 4. Open the website

Visit:

```text
https://vespera.oluchifaith.com.ng
```

Test these pages:

```text
https://vespera.oluchifaith.com.ng/collections
https://vespera.oluchifaith.com.ng/book
https://vespera.oluchifaith.com.ng/admin
```

Test the API:

```text
https://vespera.oluchifaith.com.ng/api/healthz
```

It should show:

```json
{"status":"ok"}
```

## 5. Enable HTTPS

In cPanel, open **SSL/TLS Status**. Issue or enable a free SSL certificate for:

```text
vespera.oluchifaith.com.ng
```

Then visit the website using `https://`.

## Troubleshooting

### The page is blank

Confirm that `index.html` is directly inside the subdomain folder, not inside another `public` folder.

### Forms do not save

Open `/api/healthz`. If it does not show `{"status":"ok"}`, check `api/config.php`.

### Database connection error

Confirm the database name and user include the cPanel prefix:

```text
yjwpofsw_vespera_house
yjwpofsw_vesperauser
```

Confirm the user has all privileges for the database.

### Direct page links show 404

Confirm that `.htaccess` was uploaded. File Manager may hide files beginning with a dot; enable **Show Hidden Files** in Settings.