# eduCRM Sprint 0 — Deployment Guide (CepatCloud cPanel)

Goal: see the "Foundation Live" page at https://educrm.viswaminfotech.com
and a healthy JSON at /health. Same playbook as BusTrack/EnglishEval.

## 1. Upload
- Zip is `educrm_sprint0.zip`. Upload via File Manager into the `educrm`
  app folder (the folder your Python App points to) and Extract.
- Folder should contain: passenger_wsgi.py, requirements.txt,
  .env.example, app/

## 2. passenger_wsgi
- If your working pattern on this server is the entry file WITHOUT the
  .py extension (as on BusTrack), rename it:
      mv passenger_wsgi.py passenger_wsgi
  Match whatever your Python App's "Application startup file" expects.

## 3. Create .env
    cd ~/educrm        # your app folder
    cp .env.example .env
    nano .env
- Set the real DB password in DATABASE_URL
- Generate SECRET_KEY:
      python3 -c "import secrets; print(secrets.token_hex(32))"
  Paste the output as SECRET_KEY. Save.

## 4. Install dependencies (inside the virtualenv)
- cPanel → Setup Python App → your app → copy the "Enter to the
  virtual environment" command, run it in Terminal, then:
      pip install -r requirements.txt
  (No --user flag inside the virtualenv — BusTrack lesson.)
- bcrypt is pinned to 4.0.1 — do not upgrade it.

## 5. Restart + clear cache
    find ~/educrm -name "__pycache__" -type d -exec rm -rf {} +
- cPanel → Setup Python App → Restart, or:
    touch ~/educrm/tmp/restart.txt

## 6. Verify
1. https://educrm.viswaminfotech.com/health
   Expect: {"app":"eduCRM","status":"ok","tables":12,"terminology_labels":12}
2. https://educrm.viswaminfotech.com/
   Expect: Foundation Live page showing the three skins
   (coaching → Student, school → Child, college → Applicant)
   — those words are read live from PostgreSQL, proving the whole pipe.

## Troubleshooting quick hits
- 503 / "Web application could not be started": check
  ~/educrm/stderr.log — usually a missing package or .env typo.
- "password authentication failed" in /health: DATABASE_URL password
  wrong, or special characters in the password need URL-encoding
  (@ → %40, # → %23, etc.).
- Changes not reflecting: clear __pycache__ + restart (always both).

When both URLs pass: ground floor complete. Sprint 1 (login, lead
capture, follow-up screen) builds on this without touching anything
laid here.
