# SSDIWorkflow Cloudflare Pages Setup

## Best $0 Path

Use Cloudflare Pages as the public host and keep SSDIWorkflow data local on the iPhone.

```text
Project folder -> GitHub -> Cloudflare Pages -> iPhone Home Screen app
Evidence files -> iCloud Drive / Google Drive
Records -> CSV export + Backup JSON
```

## Option A: Fast Test With Direct Upload

Use this if you want to confirm the app works on Cloudflare before setting up GitHub.

1. Open Cloudflare Dashboard.
2. Go to Workers & Pages.
3. Choose Create application.
4. Choose Pages.
5. Choose Upload assets.
6. Upload the contents of the `dist` folder, or upload `SSDIWorkflow-cloudflare-pages.zip`.
7. Open the Cloudflare Pages URL on iPhone Safari.
8. Tap Share.
9. Tap Add to Home Screen.
10. Open the new Home Screen app and test Backup JSON restore.

## Option B: Recommended GitHub Deploy

Use this once the direct upload test works.

1. Create a private GitHub repository named `SSDIWorkflow`.
2. Upload the project files.
3. In Cloudflare Pages, choose Create application -> Pages -> Connect to Git.
4. Select the repository.
5. Build settings:

```text
Framework preset: None
Build command: node scripts/build.mjs
Build output directory: dist
Root directory: /
```

6. Deploy.
7. Open the Cloudflare Pages URL on iPhone.
8. Add to Home Screen.
9. Export Backup JSON from the Netlify-installed app.
10. Restore that Backup JSON into the Cloudflare-installed app.

## Before Switching Fully

Keep Netlify live until these checks pass:

- Cloudflare URL opens on iPhone.
- App installs to Home Screen.
- Existing Backup JSON restores.
- Start Work and End Work buttons still work.
- Import tab accepts pasted OCR text.
- Save Work updates Entries.
- Export CSV to Files works.

## Important Notes

- Do not put screenshots, medical notes, SSNs, or tax documents into GitHub.
- Keep evidence files in iCloud Drive or Google Drive.
- Keep monthly `Backup JSON` exports in Files.
- Cloudflare Pages hosts the app code only; the app data remains local unless you later add sync.

## Recommended Monthly Routine

```text
1. Work sessions saved in SSDIWorkflow.
2. Evidence screenshots/statements saved in iCloud/Google Drive.
3. End of month: Export CSV to Files.
4. End of month: Backup JSON to Files.
5. Keep one folder per month for records.
```
