Trae Chat is a real-time chat application built with FastAPI and WebSocket, featuring a modern and responsive user interface. This project demonstrates how to create a simple chatbot interface with real-time communication capabilities.
- Real-time messaging using WebSocket
- Clean and modern user interface
- Responsive design that works on both desktop and mobile
- Simple bot responses to user messages
- Message history tracking
Before you begin, ensure you have Python 3.7+ installed on your system.
-
Clone the repository:
git clone https://github.com/rihoneailabs/trae-chat.git cd trae-chat
-
Install the required dependencies:
pip install -r requirements.txt
-
Start the FastAPI server:
python main.py
Or alternatively:
uvicorn main:app --reload
-
Open your web browser and navigate to:
http://localhost:8000
.
├── main.py # FastAPI application and WebSocket endpoints
├── requirements.txt # Python dependencies
├── static/ # Static files directory
│ └── index.html # Frontend chat interface
└── README.md # Project documentation
The application consists of two main components:
-
Backend (main.py):
- FastAPI server handling WebSocket connections
- Chat history management
- Bot response logic
-
Frontend (static/index.html):
- Modern chat interface
- Real-time message updates
- WebSocket client implementation
This project is open-source and available under the MIT License.
Built with Trae IDE - A powerful AI-powered development environment.