# ALO AI ENGLISH TEST ECOSYSTEM
## Final Production Deployment Master

This deployment is **strict production stabilization**.

## Archive Rule
- Use only: `ALO-CD-ETS-full-project.zip`
- Ignore: `ALO-CD-ETS-superadmin.zip`

After extraction, final project root must contain:
- `apps/`
- `config/`
- `logs/`
- `storage/`
- `package.json`
- `pnpm-workspace.yaml`
- `deploy-cpanel.sh`
- `DEPLOYMENT_MASTER.md`
- `PROJECT_GUIDE.md`

## Upload Rule
Upload **contents only** to:
- `/home/aloeduca/english.aloeducation.com`

Do not create nested path:
- `/home/aloeduca/english.aloeducation.com/ALO-CD-ETS-full-project`

## cPanel Node.js App Manager (Passenger)
- Node.js Version: `24`
- Application Mode: `Production`
- Application Root: `english.aloeducation.com/apps/backend`
- Startup File: `app.js`

Reference:
- https://docs.cpanel.net/cpanel/software/application-manager/

## Backend Commands
```bash
cd /home/aloeduca/english.aloeducation.com/apps/backend
source /home/aloeduca/nodevenv/english.aloeducation.com/apps/backend/24/bin/activate
npm install
npm run build || true
pnpm prisma generate
mkdir -p tmp
touch tmp/restart.txt
```

## Frontend Commands
```bash
cd /home/aloeduca/english.aloeducation.com/apps/frontend
npm install
npm run build
cp -r dist/* /home/aloeduca/public_html/
```

## AI Engine Commands
```bash
cd /home/aloeduca/english.aloeducation.com/apps/ai-engine
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
uvicorn main:app --host 127.0.0.1 --port 8000
```

Use `python3`, not `python`.

## AI Fallback Order
1. OpenRouter Gemini Flash
2. DeepSeek
3. Groq
4. Ollama
5. Local fallback logic

## Quick Fixes
Port busy:
```bash
lsof -i :8000
kill -9 <PID>
```

Missing multipart:
```bash
pip install python-multipart
```

Whisper import check:
```bash
uv run python -c "import whisper; print('READY')"
```
