How wsss777/wsai works
WsAI is an AI conversation and knowledge-document platform. Users authenticate, upload and manage documents, bind documents to a chat session, and send messages through streaming chat; the backend exposes these capabilities through authenticated HTTP routes. The frontend API client and backend router establish the HTTP boundary. Source excerpts do not show most application-to-infrastructure calls, so uncertain internal connections are omitted; major RAG and persistence stages are represented without asserting unverified call sequences.
Main entry points: router.go HTTP router · App.vue Vue application · session.go Session application · api.js API client
Components 28
Web frontend
- Vue application
frontend/src/App.vue - Account access
frontend/src/views/AuthView.vue - Streaming chat
frontend/src/views/ChatView.vue - Document workspace
frontend/src/views/DocumentsView.vue - Auth state
frontend/src/stores/auth.js - API client
frontend/src/services/api.js
HTTP interface
- Backend server
backend/cmd/server/main.go - HTTP router
backend/handler/router.go - Account endpoints
backend/handler/user/user.go - Chat endpoints
backend/handler/session/session.go - Document endpoints
backend/handler/rag/document.go - Image endpoint
backend/handler/image/image.go
Knowledge pipeline
- Document management
backend/application/rag/document_application.go - Document ingestion
backend/application/rag/ingest_application.go - Document parsing
backend/domain/rag/parser.go - Text chunking
backend/domain/rag/chunker.go - Query planning
backend/application/rag/query_preprocessor.go - Context retrieval
backend/application/rag/retrieval_application.go
Application services
- Session application
backend/application/session/session.go - User application
backend/application/user/user.go - Image application
backend/application/image/image.go
Infrastructure
- Model integration
backend/infra/llm/aiModel.go - Chat helper manager
backend/infra/llm/helperManager.go - RAG client
backend/infra/rag/client.go - MySQL repositories
backend/infra/mysql/repository - Redis client
backend/infra/redis/client.go - RabbitMQ client
backend/infra/rabbitmq/client.go
Other components
- Platform user
Connections 27
- Platform user → Vue application: uses
- Vue application → Account access: routes
- Vue application → Streaming chat: routes
- Vue application → Document workspace: routes
- Account access → API client: calls
frontend/src/views/AuthView.vue - Account access → Auth state: updates
frontend/src/views/AuthView.vue - API client → Auth state: reads token
frontend/src/services/api.js - Streaming chat → API client: requests chat
- Document workspace → API client: requests documents
- Backend server → HTTP router: initializes
backend/cmd/server/main.go - HTTP router → Account endpoints: routes account
backend/handler/router.go - HTTP router → Chat endpoints: routes chat
backend/handler/router.go - HTTP router → Document endpoints: routes documents
backend/handler/router.go - HTTP router → Image endpoint: routes images
backend/handler/router.go - Document endpoints → Document management: delegates
- Document management → Document ingestion: delegates
- Document ingestion → Document parsing: parses
- Document ingestion → Text chunking: chunks
- Chat endpoints → Session application: delegates
- Account endpoints → User application: delegates
- Image endpoint → Image application: delegates
- Session application → Query planning: plans retrieval
- Query planning → Model integration: creates model
backend/application/rag/query_preprocessor.go - Session application → Context retrieval: retrieves context
- Context retrieval → RAG client: queries
- Session application → Chat helper manager: manages helpers
- Chat helper manager → MySQL repositories: loads messages
backend/infra/llm/helperManager.go