# RecordVault — Setup Guide

A private, password-protected web app for downloading MP3 recordings from Telesure Excel exports.

---

## Quick Start

### 1. Install dependencies
```bash
pip install -r requirements.txt
```

### 2. Run the server
```bash
python app.py
```

Then open your browser to: **http://localhost:5000**

---

## Managing Users & Passwords

Open `app.py` and find the `USERS` dictionary near the top:

```python
USERS = {
    "admin": "SecurePass123!",
    "user1": "Password456!",
}
```

Add, remove, or change users and passwords here. Each key is a username, each value is the password.

> **For production use**, replace this with a proper database (SQLite + bcrypt is a good lightweight choice).

---

## Configuration

At the top of `app.py`:

| Variable           | Default          | Description                              |
|--------------------|------------------|------------------------------------------|
| `HYPERLINK_COLUMN` | `11` (Column K)  | Which Excel column contains the MP3 URLs |
| `UPLOAD_FOLDER`    | `uploads/`       | Temporary storage for uploads/ZIPs       |
| `MAX_CONTENT_LENGTH` | 50 MB          | Maximum upload file size                 |

---

## Running Securely (Production)

### Change the secret key
Set the `SECRET_KEY` environment variable to a long random string:
```bash
export SECRET_KEY="your-very-long-random-secret-key-here"
python app.py
```

### Use HTTPS
Run behind a reverse proxy (nginx or Caddy) with an SSL certificate. Never expose this app on a public IP without HTTPS.

### Use gunicorn instead of Flask dev server
```bash
pip install gunicorn
gunicorn -w 4 app:app
```

---

## How It Works

1. User logs in with username + password
2. User uploads an `.xlsx` file and optionally provides a filename prefix and sheet name
3. The server reads Column K for URLs, downloads each MP3 in a background thread
4. Progress is shown live in the browser
5. When complete, a `.zip` of all recordings is offered for download
6. Files are cleaned up after download
