How tuyetnga09/hackathon-viber-code-pro-max works
Viber Coding Pro Max is a three-module AI chat starter: a Next.js chat UI sends messages over HTTP to a FastAPI backend, which calls a LangGraph agent and returns a response for display. The agent currently produces sample text; the configured LLM and example tools are not connected to its graph, and database/vector-store support is configuration-only. The graph reflects documented module wiring and sampled calls; unsampled route and graph details are shown only where the README supports them.
Main entry points: ChatWindow.tsx Chat window · chat_controller.py Chat controller · main.py FastAPI app · chat_service.py Chat service
Components 23
Chat frontend
- Chat page
frontend/src/app/chat/page.tsx - Chat window
frontend/src/features/chat/components/ChatWindow.tsx - Chat state
frontend/src/features/chat/hooks/useChat.ts - Message input
frontend/src/features/chat/components/MessageInput.tsx - Message list
frontend/src/features/chat/components/MessageList.tsx - Chat API
frontend/src/features/chat/api/chatApi.ts - HTTP client
frontend/src/lib/api/client.ts
HTTP backend
- FastAPI app
backend/src/backend/main.py - Chat controller
backend/src/backend/controllers/chat_controller.py - Health controller
backend/src/backend/controllers/health_controller.py - Chat service
backend/src/backend/services/chat_service.py - Chat model
backend/src/backend/models/chat.py - Chat response
backend/src/backend/views/chat_view.py - Health response
backend/src/backend/views/health_view.py
AI agent
- Agent interface
ai/src/ai/__init__.py - Agent graph
ai/src/ai/graph.py - Agent state
ai/src/ai/state.py - Analysis and response
ai/src/ai/nodes/example_node.py - LLM client
ai/src/ai/llm.py - Example tools
ai/src/ai/tools/example_tool.py
Other components
- User
- LLM provider
- Browser
Connections 20
- User → Chat page: opens chat
- Chat page → Chat window: renders
- Chat window → Chat state: uses state
- Chat window → Message input: renders
- Chat window → Message list: renders
- Chat state → Chat API: sends message
- Chat API → HTTP client: posts request
- HTTP client → FastAPI app: HTTP request
- FastAPI app → Chat controller: routes chat
- FastAPI app → Health controller: routes health
- Chat controller → Chat service: calls service
- Chat controller → Chat model: reads request
- Chat controller → Chat response: builds response
- Chat service → Agent interface: calls agent
- Agent interface → Agent graph: runs graph
- Agent graph → Analysis and response: dispatches nodes
- Agent graph → Agent state: uses state
- Chat service → Chat model: creates domain result
- Health controller → Health response: builds response
- LLM client → LLM provider: configured client