How dawaaaaaa8/yamat-mlsp works
ҮАМАТ is a Mongolian occupational classification browser with an administration interface and AI-assisted search/chat. Users browse categories, occupational details, content and catalog tables, or ask questions; administrators manage categories and users. The repository separates a Next.js frontend, an Express/MySQL domain API and a FastAPI AI service. AI chat can use cached or direct answers, category search and an Ollama-generated response. Frontend-to-service wiring is not shown in the excerpts, so those links are left unverified.
Main entry points: chat.py Chat orchestration · index.ts API router · db.ts MySQL access · managementRoutes.ts Admin management
Components 29
Web application
- Browse pages
yamat-08/src/app/[locale]/angilal/page.tsx - Search page
yamat-08/src/app/[locale]/hailt/page.tsx - Detail and content
yamat-08/src/app/[locale]/content/[id]/page.tsx - Catalog tables
yamat-08/src/components/CatalogTable.tsx - AI chat UI
yamat-08/src/components/AiChat.tsx - Admin workspace
yamat-08/src/components/AdminWorkspace.tsx - Session context
yamat-08/src/lib/auth/AuthContext.tsx - AI and catalog routes
yamat-08/src/app/api/ai/chat/route.ts
Domain API
- API router
yamat-api/src/index.ts - Category browsing
yamat-api/src/controllers/categoryController.ts - Content and catalog
yamat-api/src/controllers/contentController.ts - Admin management
yamat-api/src/routes/managementRoutes.ts - User management
yamat-api/src/controllers/userController.ts - Authentication
yamat-api/src/middleware/authMiddleware.ts - AI endpoints
yamat-api/src/routes/ai.ts
AI assistant
- AI service
yamat-ai/main.py - Chat orchestration
yamat-ai/app/routers/chat.py - Category search
yamat-ai/app/search.py - Intent handling
yamat-ai/app/intents.py - Answer cache
yamat-ai/app/cache.py - Answer generation
yamat-ai/app/llm.py - Semantic embeddings
yamat-ai/app/embeddings.py - Chat feedback
yamat-ai/app/routers/feedback.py - AI administration
yamat-ai/app/routers/admin.py
Data and integrations
- MySQL access
yamat-api/src/config/db.ts - MySQL access
yamat-ai/app/db.py - Ollama service
Other components
- Visitor
- Administrator
Connections 34
- Visitor → Browse pages: opens
- Visitor → Search page: searches
- Visitor → AI chat UI: asks
- Administrator → Admin workspace: manages
- Session context → Admin workspace: guards
- AI and catalog routes → API router: forwards requests
- Browse pages → Category browsing: requests categories
- Detail and content → Content and catalog: requests content
- Catalog tables → Content and catalog: requests catalog
- AI chat UI → AI and catalog routes: sends chat
- Admin workspace → Admin management: submits changes
- API router → Category browsing: mounts routes
yamat-api/src/index.ts - API router → Content and catalog: mounts routes
yamat-api/src/index.ts - API router → Admin management: mounts routes
yamat-api/src/index.ts - API router → AI endpoints: mounts routes
yamat-api/src/index.ts - Admin management → Authentication: checks roles
yamat-api/src/routes/managementRoutes.ts - Admin management → MySQL access: reads and writes
yamat-api/src/routes/managementRoutes.ts - Category browsing → MySQL access: queries categories
yamat-api/src/controllers/categoryController.ts - Content and catalog → MySQL access: queries content
yamat-api/src/controllers/contentController.ts - User management → MySQL access: queries users
yamat-api/src/controllers/userController.ts - Authentication → MySQL access: checks user
yamat-api/src/middleware/authMiddleware.ts - AI service → Chat orchestration: mounts router
yamat-ai/main.py - AI service → AI administration: mounts router
yamat-ai/main.py - AI service → Chat feedback: mounts router
yamat-ai/main.py - Chat orchestration → Answer cache: checks cache
yamat-ai/app/routers/chat.py - Chat orchestration → Intent handling: classifies query
yamat-ai/app/routers/chat.py - Chat orchestration → Category search: searches categories
yamat-ai/app/routers/chat.py - Chat orchestration → Answer generation: generates answer
yamat-ai/app/routers/chat.py - Category search → Semantic embeddings: uses semantic index
yamat-ai/app/search.py - Category search → MySQL access: loads categories
yamat-ai/app/search.py - Chat orchestration → MySQL access: logs and saves
yamat-ai/app/routers/chat.py - Chat feedback → MySQL access: stores feedback
yamat-ai/app/routers/feedback.py - AI administration → MySQL access: manages data
yamat-ai/app/routers/admin.py - Answer generation → Ollama service: requests completion
yamat-ai/app/llm.py