# Windows Setup Steps

Use these numbered batch files for local development on Windows.

If you want a simple launcher, start with [00_setup_menu.bat](C:/--QT%20HOSTABLE--/00_setup_menu.bat).

All setup scripts now use guided prompts, defaults, and next-step hints.
Most setup scripts can also auto-open the next step for you when they finish.
The batch files now include more detailed in-script instructions about what each step does and what success should look like.

## Recommended order

1. Run [01_create_venv.bat](C:/--QT%20HOSTABLE--/01_create_venv.bat)
2. Run [02_install_requirements.bat](C:/--QT%20HOSTABLE--/02_install_requirements.bat)
3. Run [03_generate_secret_key.bat](C:/--QT%20HOSTABLE--/03_generate_secret_key.bat)
4. Run [04_create_env_from_template.bat](C:/--QT%20HOSTABLE--/04_create_env_from_template.bat)
5. Enter your app name and let the script write `SECRET_KEY` and `HOSTABLE_APP_NAME` for you
6. Run [05_init_db.bat](C:/--QT%20HOSTABLE--/05_init_db.bat)
7. Run [06_run_local_dev.bat](C:/--QT%20HOSTABLE--/06_run_local_dev.bat)
8. Run [08_run_smoke_test.bat](C:/--QT%20HOSTABLE--/08_run_smoke_test.bat)
9. Run [09_cpanel_prep_check.bat](C:/--QT%20HOSTABLE--/09_cpanel_prep_check.bat)
10. When you want a cPanel upload package, run [07_build_upload_bundle.bat](C:/--QT%20HOSTABLE--/07_build_upload_bundle.bat)
11. Run [11_hosting_wizard.bat](C:/--QT%20HOSTABLE--/11_hosting_wizard.bat) for a guided hosting handoff
12. Run [12_preupload_checklist.bat](C:/--QT%20HOSTABLE--/12_preupload_checklist.bat) for a final upload sanity check
13. If needed, open docs quickly with [10_open_docs.bat](C:/--QT%20HOSTABLE--/10_open_docs.bat)

## What each script does

- `01_create_venv.bat`
  Creates a `venv` folder for local development and can recreate an existing one if you choose.
- `02_install_requirements.bat`
  Installs the Python packages from [requirements.txt](C:/--QT%20HOSTABLE--/requirements.txt) after a confirmation prompt.
- `03_generate_secret_key.bat`
  Prints a strong random `SECRET_KEY` value using [generate_secret_key.py](C:/--QT%20HOSTABLE--/generate_secret_key.py) and can copy it to the clipboard.
- `04_create_env_from_template.bat`
  Creates or updates `.env`, confirms the chosen app name, validates the secret mode prompt, and writes `SECRET_KEY` and `HOSTABLE_APP_NAME` automatically.
- `05_init_db.bat`
  Prompts for admin details with defaults, shows a confirmation summary, checks Flask is installed, then runs [init_db.py](C:/--QT%20HOSTABLE--/init_db.py).
- `06_run_local_dev.bat`
  Explains the local URL and start/stop behavior, checks Flask is installed, then starts the Flask development server from [app.py](C:/--QT%20HOSTABLE--/app.py).
- `07_build_upload_bundle.bat`
  Confirms and then runs [make_hostable_bundle.ps1](C:/--QT%20HOSTABLE--/make_hostable_bundle.ps1) to create a clean ZIP for cPanel upload.
- `08_run_smoke_test.bat`
  Explains what the smoke test covers, checks Flask is installed, and then runs [portal_smoke_test.py](C:/--QT%20HOSTABLE--/portal_smoke_test.py).
- `09_cpanel_prep_check.bat`
  Explains what gets checked, verifies the local environment is ready, and then runs [cpanel_prep_check.py](C:/--QT%20HOSTABLE--/cpanel_prep_check.py) to review local readiness before upload.
- `10_open_docs.bat`
  Lets you choose which setup and deployment docs to open.
- `11_hosting_wizard.bat`
  Collects hosting details with examples, builds the latest upload ZIP, writes `HOSTING_HANDOFF.txt`, and generates `CPANEL_COMMANDS.txt` with ready-to-paste server commands.
- `12_preupload_checklist.bat`
  Shows a plain-English final checklist to review before you upload and configure the app in cPanel.
- `_next_step_prompt.bat`
  Shared helper that asks whether you want to continue automatically to the next step.

## Notes

- These scripts are for local Windows setup.
- Your cPanel server will usually use the Linux commands from [CPANEL_DEPLOY_TUTORIAL.md](C:/--QT%20HOSTABLE--/CPANEL_DEPLOY_TUTORIAL.md).
- Keep `.env` private and never upload test databases unless you intentionally want that data live.
