mirror of
https://github.com/run-llama/chat-ui.git
synced 2026-07-01 21:24:01 -04:00
1.0 KiB
1.0 KiB
FastAPI + ChatUI Example
This is an example fullstack application that uses FastAPI for the backend and @llamaindex/chat-ui with NextJS for the frontend.
The backend just send example data to the frontend.
🚀 Quick Start
Prerequisites
- uv (recommended) for Python package management
- pnpm for JavaScript package management
Start the app
Backend
Navigate to the backend directory, and run:
-
Create a virtual environment and install dependencies using uv (recommended):
uv sync -
Start a FastAPI server:
uv run fastapi dev
The API will be available at http://localhost:8000 and you can check the API documentation at http://localhost:8000/docs.
Frontend
Navigate to frontend, then build and run the development server:
cd frontend
pnpm install
pnpm dev
Go to http://localhost:3000 to see the chat UI.
Test with different events:
Go to backend/app/chat.py to send different events from the backend to test the UI components.