# APSS cPanel Deployment Steps

## 1. Upload files
Upload the full `apss_flask_cpanel_v2` folder contents to your cPanel account. You can upload the zip and extract it in File Manager.

## 2. Create Python app
In cPanel:

- Open **Setup Python App**
- Choose Python 3.10+ if available
- Application root: your extracted project folder
- Application startup file: `passenger_wsgi.py`
- Application entry point: `application`

## 3. Install requirements
Use the cPanel Python app interface or Terminal:

```bash
pip install -r requirements.txt
```

## 4. Database option A — SQLite first
For first cPanel test, SQLite is simplest. The app creates:

```text
instance/apss_local.db
```

Make sure the app folder and `instance` folder are writable.

## 5. Database option B — MySQL/MariaDB
Create database and user from cPanel, then add environment variable:

```text
DATABASE_URL=mysql+pymysql://username:password@localhost/database_name
```

## 6. Environment variables
Set:

```text
SECRET_KEY=put-a-long-random-secret-here
DATABASE_URL=optional-if-using-mysql
```

## 7. Restart app
Click **Restart** in Setup Python App.

## 8. Test URLs

```text
https://apss.org.np/
https://apss.org.np/login
```

Default admin:

```text
admin@apss.org.np / admin123
```

Change password from code or add a password-change feature in the next version.
