How sheldon715/shopmate works
ShopMate is an Android conversational shopping assistant backed by an Express API. The main workflow takes a natural-language request from the Android chat, retrieves grounded catalog facts, generates and streams recommendations, and lets the user continue into product details, cart actions, and a mock checkout. Separate capabilities include image search and speech transcription. PostgreSQL holds structured product, cart, and order facts; Qdrant supports vector retrieval. The README documents the overall RAG and streaming flow; unsampled implementation details are represented only where supported by the repository tree or README.
Main entry points: rag.service.ts RAG orchestration · ChatRecommendationScreen.kt Chat and recommendations · chat.controller.ts Chat API · DefaultChatRepository.kt Chat data client
Components 20
Android app
- Android app entry
client/android/app/src/main/java/com/shopmate/app/MainActivity.kt - Chat and recommendations
client/android/app/src/main/java/com/shopmate/app/ui/chat/ChatRecommendationScreen.kt - Chat data client
client/android/app/src/main/java/com/shopmate/app/data/chat/DefaultChatRepository.kt - Product details
client/android/app/src/main/java/com/shopmate/app/ui/product/ProductDetailScreen.kt - Cart and checkout UI
client/android/app/src/main/java/com/shopmate/app/ui/cart/CartScreen.kt
Backend API
- Chat API
server/src/modules/chat/chat.controller.ts - SSE response writer
server/src/modules/chat/sse-writer.ts
Discovery services
- RAG orchestration
server/src/modules/chat/rag.service.ts - Query rewriting
server/src/modules/chat/query-rewrite.service.ts - Vector retrieval
server/src/modules/vector/vector-search.service.ts - Qdrant index
server/src/modules/vector/qdrant.client.ts - LLM providers
server/src/modules/llm/openai-compatible-chat.client.ts - Image search API
server/src/modules/image-search/image-search.controller.ts - Visual interpretation
server/src/modules/image-search/visual-intent.client.ts - Speech transcription
server/src/modules/asr/asr.controller.ts
Commerce and data
- Product catalog API
server/src/modules/products/product.service.ts - PostgreSQL facts
server/src/lib/db/pool.ts - Cart operations
server/src/modules/cart/cart.service.ts - Checkout and orders
server/src/modules/orders/order.service.ts
Other components
- Shopper
Connections 22
- Shopper → Android app entry: uses
- Android app entry → Chat and recommendations: opens chat
- Chat and recommendations → Chat data client: submits request
- Chat data client → Chat API: calls API
- Chat API → RAG orchestration: runs RAG
- RAG orchestration → Query rewriting: rewrites query
- RAG orchestration → Vector retrieval: retrieves products
- Vector retrieval → Qdrant index: searches vectors
- RAG orchestration → Product catalog API: loads product facts
- Product catalog API → PostgreSQL facts: reads catalog
- RAG orchestration → LLM providers: generates response
- Chat API → SSE response writer: streams events
- SSE response writer → Chat data client: streams response
- Chat and recommendations → Product details: opens product
- Chat and recommendations → Cart operations: requests cart action
- Cart and checkout UI → Cart operations: manages cart
- Cart operations → PostgreSQL facts: reads and writes
- Cart and checkout UI → Checkout and orders: starts checkout
- Checkout and orders → PostgreSQL facts: reads and writes
- Shopper → Image search API: provides image
- Image search API → Visual interpretation: interprets image
- Shopper → Speech transcription: provides speech