React (WebSocket) ⇄ NestJS (WS Gateway + gRPC client) ⇄ Python (gRPC streaming mock LLM)
/frontend— React + Vite app/backend— NestJS app with WS gateway and gRPC client/llm_service— Python gRPC server simulating an LLM/proto— Protocol buffers definitions
- Node.js 18+
- Python 3.10+
npm install
cd backend && npm install
cd ../frontend && npm install
cd ../llm_service && python -m pip install -r requirements.txtIn three terminals:
npm run start:llmnpm run start:backendnpm run start:frontendOpen http://localhost:5173.
- WebSocket endpoint: frontend connects to
ws://localhost:3000. - Backend proxies
chat:sendevents to the Python gRPCChatStreamand relays streamed chunks back aschat:chunkevents. - gRPC uses proto at
proto/chat.proto.