# ALO AI English Test Ecosystem
## Production Stabilization Guide

## Stack
- Frontend: React + Vite (`apps/frontend`)
- Backend: Node.js + Express + Prisma (`apps/backend`)
- AI Engine: FastAPI + Whisper + LLM router (`apps/ai-engine`)

## Security Baseline
- JWT auth + RBAC
- API rate limiting + Helmet
- Webhook signature validation
- Admin audit logs
- Exam anti-cheat event logging (tab switch / blur)
- Timed autosave during monitored exams
- Encrypted speaking recording archival

## Exam Coverage
- IELTS
- PTE
- TOEFL
- Duolingo English Test
- CELPIP
- OET
- UKVI mock
- AI Speaking
- AI Writing
- AI Examiner
- AI Study Coach

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

## Core Validation Commands
Run from repository root:
```bash
pnpm test
pnpm lint
pnpm build
```

Additional checks:
```bash
cd apps/backend && pnpm exec prisma validate
cd apps/backend && node --check app.js && find src prisma -name '*.js' -print0 | xargs -0 -n1 node --check
cd apps/ai-engine && python3 -m py_compile main.py services/*.py agents/*.py
```

## Deployment
Use `DEPLOYMENT_MASTER.md` and `deploy-cpanel.sh` for the official cPanel Passenger deployment flow.
