Ho Ngoc Hai
3e4f681adb
fix: API install prisma+generate in pruned, AI use absolute cargo path
...
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 16s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 24s
Deploy / Build Web Image (push) Failing after 35s
Deploy / Build AI Services Image (push) Failing after 1m22s
E2E Tests / Playwright E2E (push) Failing after 19s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- API: npm install prisma @prisma/client in pruned dir before generate
- AI: use /root/.cargo/bin/cargo directly, install underthesea with --no-build-isolation
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com >
2026-04-13 23:59:14 +07:00
Ho Ngoc Hai
1c3dd305b8
fix: all 3 Dockerfiles — Prisma copy, standalone paths, maturin PATH
...
CI / E2E Tests (push) Has been skipped
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 20s
Deploy / Build API Image (push) Failing after 27s
Deploy / Build Web Image (push) Failing after 17s
Deploy / Build AI Services Image (push) Failing after 20s
E2E Tests / Playwright E2E (push) Failing after 22s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- API: copy .prisma + @prisma into pruned node_modules, restore dist/prisma COPY
- Web: fix standalone paths for monorepo (node_modules + apps/web/server.js)
- AI: source cargo env in same RUN layer, wrap fallback pip install in subshell
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com >
2026-04-13 16:23:51 +07:00
Ho Ngoc Hai
9cf71719ae
fix: API pnpm deploy --legacy flag, AI add maturin for underthesea build
...
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 5s
Deploy / Build API Image (push) Failing after 13s
Deploy / Build Web Image (push) Failing after 13s
E2E Tests / Playwright E2E (push) Failing after 10s
CI / E2E Tests (push) Has been skipped
Deploy / Build AI Services Image (push) Failing after 12s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- API Dockerfile: add --legacy to pnpm deploy (pnpm v10 breaking change)
- AI Dockerfile: install Rust toolchain + maturin (required by underthesea 6.8.0)
Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com >
2026-04-13 15:46:25 +07:00
Ho Ngoc Hai
62f4f001b6
test(api): add domain layer unit tests across all modules
...
Cover admin events, notifications, reviews, search VOs, listings (property,
media, events, price/geo/address VOs), auth events, payment events,
subscription events, and analytics events. Raises domain test coverage
from ~24% to ~75%.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-09 00:36:39 +07:00
Ho Ngoc Hai
ee3ae2e81d
feat(ai-services): add Vietnamese NLP pipeline for property description analysis
...
Implement auto-tagging (amenities, location features, condition/legal),
content quality scoring with moderation integration, and FastAPI endpoints
for single and batch text analysis. Uses underthesea for Vietnamese
tokenization/POS when available, with regex fallback.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 22:42:31 +07:00
Ho Ngoc Hai
a2e87c34e4
test(mcp-servers): add unit tests for property search, market analytics, and valuation servers
...
29 tests covering all 9 MCP tools: search_properties, compare_properties,
get_property_details, market_report, price_trends, district_comparison,
estimate_property_value, extract_listing_features, and batch_valuation.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 16:31:35 +07:00
Ho Ngoc Hai
767afb56d5
fix(docker): harden production deployment config for all services
...
- Add resource limits (memory/CPU) and reservations for all services
- Add security hardening: read_only, no-new-privileges, tmpfs for temp dirs
- Add missing prod services: loki, promtail, pg-backup from dev compose
- Fix API healthcheck to include catch() for proper exit codes
- Add json-file logging driver with rotation limits across all services
- Remove exposed PostgreSQL port in prod (internal only)
- Add shm_size for PostgreSQL shared memory
- Add non-root user (appuser) to AI services Dockerfile
- Add --chown=node:node to COPY directives in API/Web Dockerfiles
- Harden .dockerignore: exclude IDE files, OS files, docker-compose files
- Fix Redis URL to include password authentication
- Add JWT_REFRESH_SECRET to API environment
- Add Grafana dependency on Loki for log datasource
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 13:44:44 +07:00
Ho Ngoc Hai
af71270a2e
feat: upgrade major dependencies to latest versions
...
- Prisma 6.19 → 7.7 (driver adapter pattern, prisma.config.ts)
- TypeScript 5.9 → 6.0 (ignoreDeprecations, CSS type declarations)
- Vitest 3.2 → 4.1
- Pino 9.14 → 10.3
- @types/node 22.x → 25.x
All 307 tests pass, typecheck clean, build succeeds.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 13:15:36 +07:00
Ho Ngoc Hai
9b2b8c2ba5
test(e2e): add 14 new web E2E test files for critical user flows
...
Cover auth (login, register, OAuth callbacks), search with filters,
listing detail, dashboard, analytics, create listing form, admin
dashboard/users/moderation/KYC, navigation routing, and responsive
design. Total 91 test cases using Playwright with API route mocking.
Also fix mcp-servers tsconfig deprecation warning for TS 7.x compat.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 13:13:46 +07:00
Ho Ngoc Hai
2502aa69b7
fix: production readiness — resolve build, lint, and code quality issues
...
- Fix Next.js build failure: remove duplicate route at (dashboard)/listings/[id]
that conflicted with (public)/listings/[id] (same URL path in two route groups)
- Fix 772 ESLint errors: auto-fix import ordering (import-x/order), remove unused
imports/variables, convert empty interfaces to type aliases, replace require()
with ESM imports, fix consistent-type-imports violations
- Add CLAUDE.md for developer onboarding documentation
- All checks pass: 0 lint errors, typecheck clean, 230 tests passing, build success
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 07:15:06 +07:00
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
271ad76e6f
fix: resolve E2E test failures and API runtime issues for Docker dev environment
...
- Fix DI issues: circular MCP module dependency, EventBus type import,
SearchModule provider, CacheService metric counters placement
- Fix Express 5 readonly req.query in SanitizeInputMiddleware
- Fix Typesense client lazy initialization (getter instead of constructor)
- Fix MinIO bucket init error handling (non-fatal on 403)
- Fix missing class-validator decorators on bigint DTO fields (priceVND, amountVND)
- Fix subscription plan 404 (was returning 500 for invalid tier)
- Disable CSRF and raise rate limits in test environment
- Update E2E tests to match actual API response shapes
- Update CI workflow with Redis, Typesense, MinIO services and env vars
All 101 API E2E tests now pass against Docker dev environment.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 05:44:00 +07:00
Ho Ngoc Hai
cb00b12d7b
feat(mcp): add MCP Server Integration — Property Search, Analytics, Valuation
...
Implement 3 MCP servers in libs/mcp-servers/ using @modelcontextprotocol/sdk:
- Property Search: NL search via Typesense, property comparison, detail lookup
- Market Analytics: market reports, price trends, district comparison
- Valuation: AVM integration with Python AI service, feature extraction, batch valuation
Includes NestJS integration module with SSE transport for in-process hosting.
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 03:22:27 +07:00
Ho Ngoc Hai
d99dfbafbc
feat(monitoring): add Prometheus metrics endpoint and Grafana dashboards
...
Add observability stack with @willsoto/nestjs-prometheus for /metrics endpoint,
Prometheus scraping config, and 4 auto-provisioned Grafana dashboards
(API overview, database, search, business metrics).
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-08 03:08:54 +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