How peterh0323/streamer-sales works
Project Type & Purpose
• Full‑stack, microservices‑based web application for AI “sell‑product” live‑streaming.
• Frontend: Vue + Pinia + Element‑Plus SPA;
• Backend: FastAPI/Uvicorn microservices, PostgreSQL, vector store (RAG), LMDeploy inference, ASR/TTS/digital‑human modules, Agent for external queries.
• Deployed via Docker Compose as discrete containers.
Main Components
a. Frontend (Container)
• Vue SPA (App.vue, router, pinia stores, Element‑Plus UI)
• Communicates over HTTPS/REST to “API Gateway” (Base service)
b. Base Service / API Gateway (Container)
• FastAPI routers (users, products, streaming_room, digital_human, llm, asr, tts, etc.)
• JWT authentication, PostgreSQL ORM & migrations
• Dispatches requests to sub‑services, stores metadata in PostgreSQL
c. Microservices (each in its own container)
• LLM Service: LMDeploy + Turbomind inference (lelemiao‑7b/4bit)
• RAG Service: retrieves embeddings from Faiss/feature_store + file operations
• ASR Service: speech‑to‑text via FunASR or Whisper module
• TTS Service: GPT‑SoVITS pipeline
• Digital Human Service: MuseTalk‑based video synthesis workflow
d. Data Stores
e. External Dependencies
Relationships & Data Flows
• Frontend → Base API (REST over HTTPS)
• Base API ↔ PostgreSQL (CRUD)
• Base API → Microservices via HTTP (REST)
• LLM: generate sales script or answer Q&A
• RAG: retrieve relevant docs/embeddings
• ASR: convert live audio → text
• TTS: convert text → audio
• DigitalHuman: convert script + audio → video stream
• Microservices → Weights/Static Storage (load models, artifacts)
• Agent Module within Base Service calls external APIs (DeliveryTime, Weather)
• Docker Compose orchestrates multi‑container deployment and networks
Architectural Patterns & Principles
• Front‑end/Back‑end separation (SPA vs REST API)
• Microservices: each AI capability decoupled for independent scaling & deployment
• Stateless services behind API Gateway; state persisted in PostgreSQL & vector store
• RAG pattern: retrieval + generation
• Agent pattern: encapsulate external API calls
• Containerized deployment: Docker Compose for service orchestration