Chat Reader is a web platform designed for conveniently viewing conversations between users and assistant bots, such as Telegram or WhatsApp bots. This project allows developers to review conversations to ensure the correctness of bot operations and identify potential errors in code or the database.
-
Clone the Repository
First, clone the repository to your local machine:
git clone https://github.com/Abylkair/chat_reader cd chat_reader -
Install Dependencies
Ensure you have Python and pip installed. Then, install the required dependencies:
pip install -r requirements.txt
-
Set Up Environment
Create a
.envfile in the root directory of the project and add your database URL:DATABASE_URL=<your_database_url> -
Run the Application
Start the server using:
python app.py
The server will be available at
http://127.0.0.1:5000by default.
-
Access the Platform
Open your browser and go to
http://127.0.0.1:5000. -
Load Data
Click the "Load Data" button to fetch and display conversations from the database.
-
View Conversations
- User List: The left side of the screen shows a list of users. Click on a user’s name to view their conversations.
- Chat: The right side of the screen displays messages from the selected user in chronological order.
app.py: Main application file containing server logic.static/css/styles.css: Styles for visual appearance.static/js/script.js: Scripts for webpage functionality.templates/index.html: HTML template for the main page.
- Ensure your database is set up and contains the
user_messagesandbot_messagestables with appropriate data. - In case of errors, check the server console and debug the code based on the error messages received.