# MarineRelay Outreach Dashboard - Namecheap Deployment

This package creates a private, phone-friendly outreach dashboard without changing the public MarineRelay website.

## 1. Create the subdomain

In cPanel, open **Domains** and create:

`outreach.marinerelay.com`

Keep its document root separate from `public_html` when cPanel permits it.

## 2. Upload the application

Upload and extract `MarineRelay-Outreach-Web-App.zip` into a private application folder such as:

`/home/YOUR_CPANEL_USER/marinerelay-outreach-app`

Do not place `data`, mailbox passwords, or environment-variable values in `public_html`.

## 3. Create the Python application

Open **cPanel > Software > Setup Python App** and choose:

- Python version: 3.12 or the newest available stable 3.x version
- Application root: `marinerelay-outreach-app`
- Application URL: `outreach.marinerelay.com`
- Startup file: `passenger_wsgi.py`
- Application entry point: `application`

Create the app.

## 4. Install the requirement

In the Python App screen, add `requirements.txt` as the configuration file and click **Run Pip Install**.

## 5. Create the private data directory

In cPanel File Manager, create this folder outside the public web root:

`/home/YOUR_CPANEL_USER/marinerelay-outreach-data`

The application creates its SQLite ledger and encrypted-transport email archive inside that directory. Confirm the Python app can write to it.

## 6. Add protected environment variables

Add these in the Python App environment-variable section. Replace the example values directly in cPanel; never add the real values to a source file.

- `SECRET_KEY`: a randomly generated value of at least 48 characters
- `DASHBOARD_PASSWORD`: a new password used only for this dashboard
- `MAILBOX_PASSWORD`: the password for `bglasgow@marinerelay.com`
- `SENDER_NAME`: `Braden Glasgow`
- `SENDER_EMAIL`: `bglasgow@marinerelay.com`
- `SMTP_HOST`: `mail.privateemail.com`
- `SMTP_PORT`: `465`
- `IMAP_HOST`: `mail.privateemail.com`
- `IMAP_PORT`: `993`
- `COOKIE_SECURE`: `1`
- `MARINERELAY_DATA_DIR`: `/home/YOUR_CPANEL_USER/marinerelay-outreach-data`

You can generate `SECRET_KEY` from the cPanel Terminal with:

`python -c "import secrets; print(secrets.token_urlsafe(48))"`

## 7. Restart and verify

Click **Restart** in Setup Python App, then open:

`https://outreach.marinerelay.com`

Confirm that HTTPS is active before entering the dashboard password. Sign in and verify that the historical ledger appears.

## 8. First safe sending test

Add a draft addressed to an email account you control. Review the exact recipient, subject, and body. Type `SEND` and submit. Confirm all three outcomes:

1. The message arrives at the test inbox.
2. The message appears in Thunderbird's Sent folder.
3. The dashboard records it and schedules the follow-up.

Do not begin prospect outreach until this test passes.

## Operating workflow

1. Ask Codex for a verified next prospect and personalized email.
2. Paste the approved prospect and email into **Add next prospect**.
3. Review the final message on your phone.
4. Type `SEND` to approve the exact email.
5. The application sends through Namecheap, saves an IMAP Sent copy, blocks duplicates, updates the ledger, and schedules a two-business-day follow-up.

## Backups

Download `/home/YOUR_CPANEL_USER/marinerelay-outreach-data/outreach.db` regularly. This database becomes the permanent hosted ledger after launch.

## Security notes

- Never put mailbox or dashboard passwords in an uploaded file.
- Keep HTTPS enabled.
- Use a unique dashboard password.
- Do not expose the data directory under a public URL.
- The application uses secure, HTTP-only, same-site cookies; CSRF protection; security headers; one-time draft states; exact `SEND` confirmation; and duplicate-recipient blocking.
