Ho Ngoc Hai
e60b95cdec
fix(infra): harden AI service — graceful shutdown, rate limiting, API key auth, pinned deps, Grafana secrets
...
- Add dumb-init + --timeout-graceful-shutdown 30 to AI service Dockerfile
- Add slowapi rate limiting (configurable via AI_RATE_LIMIT) and X-API-Key auth middleware
- Pin all Python dependencies to exact versions for reproducible builds
- Move Grafana admin credentials from env vars to Docker secrets in production compose
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 06:13:29 +07:00
Ho Ngoc Hai
811417d77d
fix: restrict CORS origins, require payment env vars, replace raw SQL with Prisma findMany
...
- AI service: replace allow_origins=["*"] with env-configured AI_CORS_ORIGINS
- Payment services (VNPay, MoMo, ZaloPay): use requireEnv() instead of empty string defaults for credentials
- Search indexer: replace raw SQL template literals with Prisma findMany + parameterized PostGIS queries
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 06:11:59 +07:00
Ho Ngoc Hai
b392bc3570
feat(ai-services): add Python FastAPI AI/ML services container
...
Create libs/ai-services/ with FastAPI app providing:
- POST /avm/predict — XGBoost-backed property price prediction (heuristic fallback)
- POST /avm/extract-features — Vietnamese NLP feature extraction from listing text
- POST /moderation/check — content moderation with rule-based flagging
- GET /health — health check endpoint
Includes Dockerfile (Python 3.12), docker-compose integration, Pydantic models,
and 9 passing tests covering all endpoints.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 03:08:39 +07:00