# Manual Frontend Deployment Guide

⚠️ **KEY ISSUE**: You must upload the **CONTENTS** of `frontend/dist/spa/`, NOT the folders themselves!

## Build Locally

1. Navigate to the frontend directory:
   ```bash
   cd frontend
   ```

2. Build the production version:
   ```bash
   npm run build
   ```

3. The build output will be in: `frontend/dist/spa/`

## How to Upload Correctly

### ✅ CORRECT Structure on Server:
Your `public_html` (or `www` or `htdocs`) should look like:
```
public_html/
├── index.html          ← Must be directly here!
├── css/
├── js/
├── fonts/
├── icons/
└── ...
```

### ❌ WRONG (This is what you're doing now):
```
public_html/
└── dist/
    └── spa/
        └── index.html  ← This will NOT work!
```

## Upload Methods

### Method 1: ZIP and Extract (EASIEST)
1. On your computer, **go inside** the `frontend/dist/spa/` folder
2. **Select all files inside** (not the spa folder itself!)
   - You should see: index.html, css/, js/, fonts/, icons/, etc.
3. Right-click → Compress to ZIP (e.g., `build.zip`)
4. Upload `build.zip` to your `public_html` directory via cPanel
5. In cPanel File Manager, right-click `build.zip` → Extract
6. Delete the `build.zip` file
7. Verify `index.html` is directly in `public_html`

### Method 2: cPanel File Manager
1. Log into cPanel → File Manager
2. Navigate to `public_html` (your web root)
3. On your computer, **open** `frontend/dist/spa/`
4. **Select all files inside** (Ctrl+A)
5. Drag them into cPanel File Manager
6. Wait for upload to complete
7. Verify `index.html` is directly in `public_html`

### Method 3: FTP (FileZilla)
1. Connect to your server via FTP
2. Navigate to `public_html` on the server (right side)
3. On your computer (left side), navigate **inside** `frontend/dist/spa/`
4. **Select all files** inside the spa folder
5. Drag and drop to `public_html` on the server
6. Verify `index.html` is directly in `public_html`

## Quick Check

After uploading, your `public_html` should have:
- ✅ index.html (file)
- ✅ css (folder)
- ✅ js (folder)
- ✅ fonts (folder)
- ✅ icons (folder)

If you see `dist` or `spa` folders instead, you uploaded the wrong thing!

## Troubleshooting

**Problem**: Website shows folder listing or 404
- **Solution**: Make sure `index.html` is directly in `public_html`, not in subfolders

**Problem**: Blank page
- **Solution**: Check browser console (F12) for errors

**Problem**: Files already exist
- **Solution**: Delete old files first, or overwrite them

## Server Configuration (Optional)

If using Apache, create `.htaccess` in `public_html`:
```apache
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>
```
