A dual-interface client for the real-time Student Chat system — combining a browser-based UI and a Python asyncio WebSocket client to simulate or enable student-like behavior during live sessions.
This project interacts with the FastAPI+Socket.IO backend to send prompts, receive model responses, and log structured chats for learning analysis.
- Clean, user-friendly chat interface (HTML + JavaScript)
- Alternative headless chat interface via Python asyncio client
- Token-based login and session tracking
- Real-time messaging powered by WebSocket (via Socket.IO)
- Seamless integration with backend logging
- End-session handling with UI redirect
.
├── README.md
├── requirements.txt
├── src
│ ├── __init__.py
│ ├── asyncio_client.py
│ ├── create_dummy_secret_key.py
│ └── main.py
├── static
│ ├── css
│ │ ├── chat.css
│ │ └── login.css
│ ├── images
│ │ └── pink-girl-icon.png
│ └── js
│ └── chat.js
└── templates
├── chat.html
└── login.html
git clone git@github.com:M-Nkirote/Simple-Text-to-SQL-Solution.git
cd Student-Chat-Python-websocket-client
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd /Student-Chat-Python-websocket-client/src
uvicorn main:app --reload --port 8000
Note! You should ensure that the backend server is already running (Refer to the server project: https://github.com/M-Nkirote/Student-Chat-Python-websocket-server, to set it up.)
- Go to https://jwt.io/
- Select the option "JWT Encoder"
- Add your payload

- Add the secret key for encoding
-
- To create the random key, after cloning this project, run the file
src/create_dummy_secret_key.py, and copy the output. - Paste the created key in the section 'Sign JWT: Secret' at https://jwt.io/

- To create the random key, after cloning this project, run the file
- Copy your generated token and use it to log in 🎊
☺️ 
Feel free to fork the repo, suggest improvements, or file issues.