diff --git a/docs/architecture/IMPLEMENTATION_QUICK_REFERENCE.md b/docs/architecture/IMPLEMENTATION_QUICK_REFERENCE.md index 54afabe..d38dfbd 100644 --- a/docs/architecture/IMPLEMENTATION_QUICK_REFERENCE.md +++ b/docs/architecture/IMPLEMENTATION_QUICK_REFERENCE.md @@ -3,7 +3,7 @@ ## 🎯 Key Findings at a Glance ### Current State -- ✅ **Next.js 14** with App Router (well-structured) +- ✅ **Next.js 15** with App Router (well-structured) - ✅ **React 18** + TypeScript (type-safe) - ✅ **Tailwind CSS** with dark mode support (HSL-based theme) - ✅ **Good component library** (~35 components) diff --git a/docs/load-testing/K6_LOAD_TESTING_GUIDE.md b/docs/load-testing/K6_LOAD_TESTING_GUIDE.md index b83cc03..8c92aad 100644 --- a/docs/load-testing/K6_LOAD_TESTING_GUIDE.md +++ b/docs/load-testing/K6_LOAD_TESTING_GUIDE.md @@ -15,7 +15,7 @@ ``` goodgo-platform/ ├── apps/api # NestJS backend (port 3001) -├── apps/web # Next.js 14 frontend (port 3000) +├── apps/web # Next.js 15 frontend (port 3000) ├── libs/mcp-servers # MCP tool server library ├── prisma/ # Database schema & migrations ├── e2e/ # Playwright E2E tests (api + web) diff --git a/libs/ai-services/README.md b/libs/ai-services/README.md new file mode 100644 index 0000000..8c8043b --- /dev/null +++ b/libs/ai-services/README.md @@ -0,0 +1,69 @@ +# @goodgo/ai-services + +Python FastAPI AI/ML microservice for the GoodGo Platform. + +## Services + +| Service | Router | Description | +|---------|--------|-------------| +| **AVM** | `/avm` | Automated Valuation Model — XGBoost-based property price predictions | +| **Moderation** | `/moderation` | Content moderation for listings (text + image analysis) | +| **NLP** | `/nlp` | Vietnamese NLP — feature extraction, search query understanding | + +## Tech Stack + +- **Python** 3.12+ +- **FastAPI** 0.115 + Uvicorn +- **XGBoost** 2.1 (property valuation model) +- **Underthesea** 6.8 (Vietnamese NLP tokenizer) +- **Pydantic** 2.9 (request/response schemas) + +## Quick Start + +```bash +# Via Docker (recommended — runs as part of the platform stack) +docker compose up -d ai-services + +# Standalone +cd libs/ai-services +pip install -e ".[dev]" +uvicorn app.main:app --reload --port 8000 +``` + +## Project Structure + +``` +libs/ai-services/ +├── app/ +│ ├── main.py # FastAPI app entry point +│ ├── config.py # Settings (Pydantic BaseSettings) +│ ├── middleware.py # CORS, rate limiting, error handling +│ ├── models/ # Pydantic request/response schemas +│ │ ├── avm.py +│ │ ├── moderation.py +│ │ └── nlp.py +│ ├── routers/ # API route handlers +│ │ ├── avm.py +│ │ ├── moderation.py +│ │ └── nlp.py +│ └── services/ # Business logic +│ ├── avm_service.py +│ ├── moderation_service.py +│ └── nlp_service.py +├── tests/ # pytest test suite +├── Dockerfile # Production container image +└── pyproject.toml # Dependencies and config +``` + +## Testing + +```bash +cd libs/ai-services +pytest +``` + +## Health Check + +``` +GET /health → {"status": "ok"} +``` diff --git a/libs/mcp-servers/README.md b/libs/mcp-servers/README.md new file mode 100644 index 0000000..2d08a41 --- /dev/null +++ b/libs/mcp-servers/README.md @@ -0,0 +1,54 @@ +# @goodgo/mcp-servers + +MCP (Model Context Protocol) tool server library for the GoodGo Platform. Provides structured tools that AI assistants can use to query property data, run analytics, and perform valuations. + +## Tool Servers + +| Server | Path | Description | +|--------|------|-------------| +| **Property Search** | `property-search/` | Geo search, full-text search, filter by type/price/area | +| **Market Analytics** | `market-analytics/` | Price trends, heatmaps, district comparisons | +| **Valuation** | `valuation/` | AVM property valuation requests | + +## Tech Stack + +- **TypeScript** 6+ +- **@modelcontextprotocol/sdk** 1.12 (MCP protocol implementation) +- **Zod** 3.24 (schema validation) +- **NestJS** integration module (optional peer dependency) + +## Project Structure + +``` +libs/mcp-servers/ +├── src/ +│ ├── index.ts # Public API exports +│ ├── property-search/ # Property search tool server +│ ├── market-analytics/ # Market analytics tool server +│ ├── valuation/ # AVM valuation tool server +│ ├── nestjs/ # NestJS module integration +│ ├── shared/ # Shared types and utilities +│ └── __tests__/ # Test suite +├── package.json +└── tsconfig.json +``` + +## Usage + +```typescript +import { PropertySearchServer, MarketAnalyticsServer } from '@goodgo/mcp-servers'; +``` + +The MCP endpoints are exposed via the API's `apps/api/src/modules/mcp/` module. + +## Building + +```bash +pnpm --filter @goodgo/mcp-servers build +``` + +## Testing + +```bash +pnpm --filter @goodgo/mcp-servers test +```